Skip to content

Add @mention with deep-link to node detail #2043

Description

@garthvh

What

Per meshtastic/design#21, add @mention support to messaging: typing @ in the compose field should offer an autocomplete of nearby/known nodes (matched by long name, short name, or user ID), and a received message containing a mention should render it as tappable text that deep-links to that node's detail screen.

No implementation exists on any platform today — this is a from-scratch feature, not a fix.

Wire format (must match Android/Web exactly — this is the cross-platform contract)

The message text payload packages a mention as the literal string @!<hex-id> (e.g. @!ffccee11) — the node's numeric ID, hex-encoded, not the display name. This is required so the mention stays valid and correctly resolvable even if the mentioned node's long/short name changes later, and so all three clients parse the exact same wire format regardless of which one composed the message.

Compose side

  • In Views/Messages/TextMessageField/TextMessageField.swift, detect @ typed in the input and show an autocomplete list of known nodes, filterable by long name, short name, or user ID (UserEntity.userId).
  • On selection, insert @!<hex-id> into the underlying text that gets sent (not the display name) — but the compose field should still show the friendly name to the user while typing, with the hex form being what actually goes out over the wire (similar in spirit to how the existing tapback/reply UI shows friendly affordances backed by numeric IDs on the wire — see AccessoryManager+ToRadio.swift for how outgoing message text is assembled).

Render side

  • In Views/Messages/MessageText.swift (where message bubbles render text, alongside the existing link-underlining via AttributedString(markdown:)), detect @!<hex-id> tokens in the message text and render each as tappable text showing the current display name resolved live from the node database (a name changes should update the mention's displayed text without needing to re-send anything — only the hex ID is stable/stored).
  • Tapping a mention should deep-link to that node's detail screen, consistent with how other node-tap navigation already works elsewhere in the app (e.g. the NavigationLink(value: Int64(...)) pattern used for the sender avatar in UserMessageRow.swift).

Notification behavior

When the local node's own ID is mentioned in a channel broadcast, that should be treated at least as prominently as a direct message for notification purposes — e.g. still notify even if channel notifications are otherwise muted, since a mention is a targeted ping within an otherwise-broadcast conversation. Coordinate the exact behavior with the Android/Web implementations so all three treat a self-mention consistently.

Reference

Cross-platform alignment tracking issue: meshtastic/design#21.

Metadata

Metadata

Labels

enhancementNew feature or requesthelp wantedExtra attention is needed

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions