Skip to content

Fix custom server emojis displaying as raw shortcodes in headers - #2496

Open
jadetheda wants to merge 1 commit into
Dimillian:mainfrom
jadetheda:fix-server-emojis-header
Open

Fix custom server emojis displaying as raw shortcodes in headers#2496
jadetheda wants to merge 1 commit into
Dimillian:mainfrom
jadetheda:fix-server-emojis-header

Conversation

@jadetheda

Copy link
Copy Markdown
Contributor

This PR fixes a long-standing visual bug where custom server emojis embedded in an account's display name would render as raw shortcode strings (e.g., :blobcat:) in the navigation bar when viewing user profiles and within Settings.

Details

The standard SwiftUI .navigationTitle(_:) modifier only accepts plain Text or String primitives, which inherently lacks the ability to asynchronously download or parse custom remote emojis.

To resolve this:

  1. Removed .navigationTitle from AccountDetailMediaGridView.swift.
  2. Replaced it with a .toolbar item injected directly into the .principal placement (the center of the navigation bar).
  3. Swapped the raw strings out for the EmojiTextApp component, allowing the header to seamlessly fetch and render custom emojis exactly as they appear in the timeline.

We then applied this consistent ToolbarItem(placement: .principal) structure across AccountDetailMediaGridView, AccountDetailToolbar, and AccountSettingView.

Testing

Tested on iOS 26.5.2. Profiles with custom server emojis in their display names now render correctly at the top of the screen instead of showing raw text.

IMG_1737

This commit resolves an issue where custom server emojis would display as raw shortcodes (e.g. `:blobcat:`) in the navigation bar when viewing user profiles or settings.

Potential Root Cause:
The standard SwiftUI `.navigationTitle(_:)` modifier only accepts plain `Text` or `String` primitives and lacks the ability to asynchronously download or render remote custom server emojis.

Attempted Solution:
- Replaced `.navigationTitle` with a `.toolbar` item injected into the `.principal` placement (the center of the navigation bar).
- Passed `account.safeDisplayName` and `account.emojis` into a custom `EmojiTextApp` component to seamlessly fetch and render custom emojis within the header hierarchy.
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.

1 participant