Conversation
🔐 Codex Security Review
|
masfour7
force-pushed
the
fix/mobile-link-label-scopes
branch
from
September 9, 2026 22:10
73bcafb to
1ec6c4d
Compare
wesbillman
approved these changes
Sep 9, 2026
gpt_markdown renders a link's label by recursing with MarkdownScope.linkLabel. _ChannelLinkMd, _MentionMd, and CustomEmojiMd must not return WidgetSpans inside that label, because nested placeholders do not paint on iOS. Opt the three components out of the link-label scope and update the tests to find RichText subclasses rendered through BidiRichText. Fixes block#6124 Signed-off-by: Mohammad Asfour <masfour700@gmail.com>
masfour7
force-pushed
the
fix/mobile-link-label-scopes
branch
from
September 20, 2026 00:49
5aef6db to
b55b425
Compare
This branch has not been deployed
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.
Summary
On iOS, an authored Markdown link renders as blank when its label is recognized as a Buzz channel, mention, or custom emoji. For example:
The surrounding text remains visible, but the link has no visible label or tap target.
Buzz's
_ChannelLinkMd,_MentionMd, andCustomEmojiMdcomponents returnWidgetSpans.gpt_markdownalso renders an authored link through aWidgetSpanand reparses its label through the registered components. Because the Buzz components were allowed to run inside link labels, the result was a placeholder nested inside another placeholder, which does not paint on iOS.This PR adds the same scope restriction used by
gpt_markdown's built-in link component:The override is applied to all three widget-based components. Authored labels such as
[#2959](url),[@Alice](url), and[:wave:](url)therefore remain ordinary link text, while the same tokens outside links continue rendering as Buzz pills and custom emoji.The PR also updates the shared test helpers to find
RichTextsubclasses. Since the upgrade togpt_markdown1.2.1, body paragraphs can render throughBidiRichText;find.byType(RichText)does not match that subclass and could allow an absence assertion to pass without inspecting the message text.The handling of unknown bare
#tokensis deliberately unchanged. Whether those should remain non-interactive pills or become plain text is a separate product decision.Related issue
Fixes #6124.
This supersedes #6135. That PR solves the same issue by maintaining a custom fork of
gpt_markdown's link component; this PR instead uses the scoped-component API already available ingpt_markdown1.2.1.Testing
Focused suites:
flutter test \ test/features/channels/message_content_test.dart \ test/features/channels/message_content_custom_emoji_test.dartResult: 95 tests passed, 0 failed.
Additional checks:
just mobile-check— passed; analyzer reported no issues.just mobile-fmt— passed; 549 files formatted with 0 changes._ChannelLinkMdoverride causes two regression tests to fail; removing_MentionMdorCustomEmojiMdcauses one test to fail in each case.message_content_test.dartdirectly assert that the nested-placeholder structure is absent. The custom-emoji tests separately verify literal text and the absence or presence ofCustomEmojiImage, depending on whether the shortcode is inside or outside a link.The complete local mobile suite reports 15 failures that reproduce identically on a clean checkout of
mainat44316ff7. In CI for that same commit,Clients / Mobile,Mobile, andMobile Swift Domain / Mobile Swiftall passed.No native-device screenshot is included. The nested-placeholder fix was verified through the rendered widget structure, but an iOS simulator build was blocked by the existing
MLImage.frameworkarm64-simulator incompatibility.