Skip to content

Conversation

@cybernova2
Copy link

@cybernova2 cybernova2 commented Dec 5, 2025

Fixes #1320.

What this PR changes

This PR adds a localized "(you)" marker after the current user's own
display name in the DM conversation list. This helps distinguish the
self-user from other participants in self-DMs and group DMs.

Screenshots

Before:
Screenshot_20251206_011218

After:
Screenshot_20251206_004856

Adding "(you)" improves clarity and matches common UX patterns.

@cybernova2 cybernova2 force-pushed the add-you-indicator-1320 branch from 20d2bbe to c8cf146 Compare December 6, 2025 10:22
@cybernova2
Copy link
Author

cybernova2 commented Dec 6, 2025

Fixes #1320.

Summary

This PR adds a localized “(you)” indicator next to the self user’s display
name in Recent DM Conversations. This improves clarity when viewing DM
threads, especially in cases where the participant list might otherwise be
ambiguous.

Main changes

  • Add youLabel to the self user's display name in:
    • self-DMs (case [])
    • 1:1 DMs where the other participant is the self user
  • Preserve existing formatting and status emoji spans
  • Avoid changes for multi-user DMs to keep behavior consistent

Test updates

  • The test helper checkTitle() is rewritten to match rendered title text
    using widget inspection, making tests resilient to:
    • WidgetSpans
    • status emoji
    • the new “(you)” label

All tests pass locally.

Ready for review

@cybernova2 cybernova2 force-pushed the add-you-indicator-1320 branch from c8cf146 to 1af1048 Compare December 6, 2025 10:49
@chrisbobbe
Copy link
Collaborator

This sounds familiar; is there an issue in the tracker about this? Please change the commit message and PR description so that they both refer to the issue, according to the project style. That way, when reviewing, we can compare your work to the requirements.

@cybernova2
Copy link
Author

This sounds familiar; is there an issue in the tracker about this? Please change the commit message and PR description so that they both refer to the issue, according to the project style. That way, when reviewing, we can compare your work to the requirements.

Yes — the related issue is #1320.
I have updated the commit message and PR description to reference it

@cybernova2 cybernova2 force-pushed the add-you-indicator-1320 branch from 1af1048 to af69e30 Compare December 9, 2025 09:55
@chrisbobbe
Copy link
Collaborator

Thanks! I see part of the issue description that looks like it's not yet implemented here:

It should be at reduced opacity compared to the name itself.

Please do that (maybe try 50% opacity?) and update the screenshots to show what it looks like.

@cybernova2 cybernova2 force-pushed the add-you-indicator-1320 branch from af69e30 to be6e33b Compare December 10, 2025 14:37
@cybernova2 cybernova2 force-pushed the add-you-indicator-1320 branch from be6e33b to 598feb9 Compare December 10, 2025 14:56
@cybernova2
Copy link
Author

cybernova2 commented Dec 10, 2025

@chrisbobbe
Implemented the “(you)” indicator for direct messages with yourself in RecentDmConversationsItem.

The label appears next to the user’s display name at 50% opacity using withValues(alpha: 0.5), matching the style used in message headers and keeping visual distinction clear without disrupting the list layout.

I’ve attached screenshots in both light mode and dark mode to show consistent rendering across themes.
Screenshot_20251210_151121

Screenshot_20251210_195554

Copy link
Collaborator

@chrisbobbe chrisbobbe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Here's a brief review of the app code; I haven't read the tests yet.

Comment on lines 668 to 671
"youLabel": "(you)",
"@youLabel": {
"description": "Label shown after the current user's display name in direct messages."
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: make indentation consistent with surrounding code

},
"youLabel": "(you)",
"@youLabel": {
"description": "Label shown after the current user's display name in direct messages."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: "Label shown after the self-user's name on the 'Direct messages' page."

switch (narrow.otherRecipientIds) { // TODO dedupe with DM items in [InboxPage]
case []:
title = TextSpan(text: store.selfUser.fullName, children: [
final youLabel = ZulipLocalizations.of(context).youLabel;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to organize the code differently:

  • Make a helper function that takes a user ID and returns a TextSpan with all the appropriate elements: name, then status emoji if applicable, then "(you)" if applicable.
  • Use that helper function here and in the other cases.

I notice that status emojis aren't being shown in the group-DM case. This approach will cause them to be shown, which seems desirable. Since that's an independent behavior change, please make that happen in a separate commit from the commit that implements the "(you)" label.

Comment on lines 206 to 207
textScaler: MediaQuery.textScalerOf(context),),],);}
else {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please pay attention to the style of the existing code—we don't say ),),],);} anywhere else. "Be tofu" 🙂

@chrisbobbe
Copy link
Collaborator

I see you've pushed some changes to the PR but I don't know if you intend it to be ready for another review. Please reply here to request another review when ready. Thanks!

@cybernova2
Copy link
Author

Hi @chrisbobbe ,
Thanks for the feedback! I’ve addressed the requested changes and updated the code to match the existing style.
The PR is now ready for another review. 😊

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.

Add a "(you)" indicator in direct messages list

2 participants