Skip to content

Conversation

@AshutoshKhadse23
Copy link

@AshutoshKhadse23 AshutoshKhadse23 commented Jan 13, 2026

Demo:

issue1899.mp4

Closes #1867

This adds a userId field to UserMentionNode to store the user ID
extracted from the data-user-id HTML attribute during parsing.

The field is nullable (int?) because:
- Individual user mentions have a numeric user ID
- Wildcard mentions (@ALL, @channel) have data-user-id="*"
- Group mentions use data-user-group-id instead
- Topic mentions don't have a user ID attribute

This field will be used by the UserMention widget to enable
navigation to the user's profile page when tapped.
Fixes: zulip#1867

Tapping on an @-mention of an individual user now navigates to
that user's profile page, matching the behavior when tapping on
a sender's name or avatar in the message list.

Group mentions, wildcard mentions (@ALL, @channel), and topic
mentions do not navigate, as they don't represent specific users.

The UserMention widget is converted from StatelessWidget to
StatefulWidget to properly manage the TapGestureRecognizer
lifecycle, following the established pattern in this codebase
(e.g., TextWithLink, _BlockInlineContainer).
Update all ContentExample instances for user mentions to include
the userId parameter, matching the updated UserMentionNode signature.

Add tests for @-mention tap behavior:
- Tapping user mention navigates to profile page
- Tapping group mention does not navigate
- Tapping wildcard mention does not navigate
- Tapping topic mention does not navigate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tap an @-mention to go to user's profile page

1 participant