fix(mobile): keep #-prefixed markdown link labels visible - #6135
Draft
olympusbuildz wants to merge 1 commit into
Draft
fix(mobile): keep #-prefixed markdown link labels visible#6135olympusbuildz wants to merge 1 commit into
olympusbuildz wants to merge 1 commit into
Conversation
gpt_markdown re-runs inline components on link labels, so _ChannelLinkMd turned [block#2959](url) into a nested token pill and the link drew blank on iOS. Own the ATag path so labels skip mention/channel/emoji components, and reject digits-only bare #tokens as channels. Regression coverage in message_content_test for GitHub-style issue labels and known channel names inside link text. Signed-off-by: Olympusbuildz <Olympus.roots@outlook.com> Co-authored-by: Olympusbuildz <Olympus.roots@outlook.com> Signed-off-by: Olympusbuildz <Olympus.roots@outlook.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.
Problem
On iOS, Markdown links whose label starts with
#render as nothing. A body like:shows
See for details.— no label, no underline, no tap target. Desktop renders the same message correctly.Root cause
MessageContentregisters_ChannelLinkMd(and mentions/emoji) ahead of gpt_markdown defaults.ATagMdbuilds the link label by re-running the fullinlineComponentslist on the label text._ChannelLinkMdmatches digits-only tokens (#2959) and replaces them with a_TokenPillWidgetSpan._buildLinkonly collects plainTextSpan.text, so the label becomes empty nested placeholders and draws blank on device.Paths:
mobile/lib/features/channels/message_content.dart,message_content/token_pill.dart.Fix
_AuthoredMarkdownLinkMd: own the[label](url)path; generate labels with stock formatting components only (no mention/channel/emoji). Drop stockATagMdfrom the list to avoid double handling.#2959is never a channel pill (defense in depth for non-link text too).Why it matters
GitHub-style issue/PR links in chat are common. Invisible links on mobile lose the destination and break reading flow; desktop already works.
Test plan
Named regressions:
digits-only bare #token is not a channel pillkeeps #-prefixed link labels visible (not channel pills)known channel name inside a link label stays plain text#channel linksgroup still greenManual verify
See [#2959](https://github.com/block/buzz/issues/2959) for details.from Desktop.#2959visible, tappable, opens the URL.#generalfor a real channel still pills and navigates.Risk / blast radius
[label](url)keeps plain label text). Bare#channel/@mentionoutside links unchanged.#Nno longer becomes a non-interactive channel pill (never a valid channel name).Closest work
none found (issue #6124 unlinked; related area #4572 is tappable-links, different symptom)
Fixes #6124