Add "show username instead of name" toggle and always-visible usernam… - #2331
Open
6a6179 wants to merge 3 commits into
Open
Add "show username instead of name" toggle and always-visible usernam…#23316a6179 wants to merge 3 commits into
6a6179 wants to merge 3 commits into
Conversation
…e row - Settings > Appearance: new "Show Username Instead of Name" switch (PresentationThemeSettings.showUsernameInsteadOfName, persisted in shared presentation settings, default off). - Profile: username row is always shown, with "None" when the user has no username. Header title becomes @username when the toggle is on. - Chat screen: navigation title shows @username for users when the toggle is on, and refreshes live when the setting changes. - Notifications: NotificationService extension uses @username for the title and sender identity of DM pushes; in-app banner does the same. Users without a username, bots, groups and channels fall back to the display name everywhere. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
|
Extend the "Show Username Instead of Name" setting to the Chats tab. ChatListPresentationData now carries showUsernameInsteadOfName, and ChatListItem uses it for the row title (users and bots with a username render as @username; groups, channels and people without a username keep their name). The ChatListController and ChatListNode refresh guards include the flag so toggling it re-lays out the list live without a restart. All ChatListNode / ChatListPresentationData call sites pass the flag through, and ChatInlineSearchResultsListComponent.Presentation gains it so the chat search list matches. Also reword the Appearance section: header "Name Display" and info text covering chats, chat list, notifications and profiles. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Replaces the single showUsernameInsteadOfName Bool with a PresentationUsernameDisplaySettings struct (users + channels flags) so each peer kind has its own switch and a future groups toggle is a one-liner. The struct owns the "which name to show" rule via username(for:), so the chat list, chat title, profile header, in-app notification banner and the notification extension all share one implementation instead of five copies of the same condition. Channels means broadcast channels only; supergroups and groups keep their titles. Persistence stays backward compatible: the users flag keeps the old "showUsernameInsteadOfName" key, channels is stored under "showChannelUsernameInsteadOfName". Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…e row
Users without a username, bots, groups and channels fall back to the display name everywhere.