Skip to content

feat(chat): render formatted message text - #1036

Closed
bmc08gt wants to merge 1 commit into
feat/shared-core-text-format-pinfrom
feat/chat-text-format-render
Closed

bmc08gt wants to merge 1 commit into
feat/shared-core-text-format-pinfrom
feat/chat-text-format-render

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator

Stacked on #1035. Retarget to main after #1035 merges.

Text messages now go through the shared TextFormat parser, and the bubble draws the display text with its spans.

  • ChatTextFormatter parses a row and moves its detected links and mentions to display offsets. ChatMessage.format carries the raw text and the spans.
  • ChatTextStyling applies bold, italic, strike, code, quote and list indents to ChatBubbleView.displayText. Code uses UIFont.roboto.
  • Quote and list messages route to LinkableBubbleView, which draws one bar per run of quoted lines. Bold, italic, strike and code stay on the label.
  • A masked link is linked over its text. Its target is never a link card. A masked link whose URL does not parse is left as plain text.
  • Reply quotes, chat list previews, NotificationPayload.decryptedBody and Spotlight use the display text. Copy keeps the raw text.
  • Mention detection allows one _ before the @ and trims a closing _ it opened (spec rule 6, mirroring feat(chat): render chat text formatting code-android-app#1748): _@jeff_ is an italic mention, _@jeff__ is @jeff_.

DetectedLink.maskedLabel carries a masked link's text, but tapping it still opens through onOpenURL. Passing the label to the leaving-Flipcash warning is a follow-up once #1033 merges.

Parse each text message with the shared TextFormat parser and draw the display text with its
spans: bold, italic, strike, code, quote bars and list indents. Masked links and mentions are
remapped to display offsets; quote and list messages go to the text view path. Reply quotes,
chat list previews, push bodies and Spotlight use the display text; Copy keeps the raw text.
A masked link's target never becomes a link card.

Mention detection allows one '_' before the '@' and trims a closing '_' that it opened, so
_@jeff_ is an italic mention (spec rule 6).
@bmc08gt bmc08gt self-assigned this Oct 10, 2026
@bmc08gt
bmc08gt deleted the branch feat/shared-core-text-format-pin October 10, 2026 21:45
@bmc08gt bmc08gt closed this Oct 10, 2026
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