Skip to content

Add "show username instead of name" toggle and always-visible usernam… - #2331

Open
6a6179 wants to merge 3 commits into
TelegramMessenger:masterfrom
6a6179:username-display-toggle
Open

Add "show username instead of name" toggle and always-visible usernam…#2331
6a6179 wants to merge 3 commits into
TelegramMessenger:masterfrom
6a6179:username-display-toggle

Conversation

@6a6179

@6a6179 6a6179 commented Sep 10, 2026

Copy link
Copy Markdown

…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.

…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>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

6a6179 and others added 2 commits September 10, 2026 09:32
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>
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.

2 participants