Fix custom server emojis displaying as raw shortcodes in headers - #2496
Open
jadetheda wants to merge 1 commit into
Open
Fix custom server emojis displaying as raw shortcodes in headers#2496jadetheda wants to merge 1 commit into
jadetheda wants to merge 1 commit into
Conversation
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.
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.
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 plainTextorStringprimitives, which inherently lacks the ability to asynchronously download or parse custom remote emojis.To resolve this:
.navigationTitlefromAccountDetailMediaGridView.swift..toolbaritem injected directly into the.principalplacement (the center of the navigation bar).EmojiTextAppcomponent, 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 acrossAccountDetailMediaGridView,AccountDetailToolbar, andAccountSettingView.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.