Skip to content

feat(chat): render chat text formatting - #1748

Open
bmc08gt wants to merge 1 commit into
code/cashfrom
feat/chat-text-format-render
Open

bmc08gt wants to merge 1 commit into
code/cashfrom
feat/chat-text-format-render

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Renders the chat text formatting from docs/superpowers/specs/2026-10-07-chat-text-formatting-design.md (orchestrator repo) in the transcript, and shows the plain display text elsewhere.

Link detection (the first PR in the brief) already landed in #1732, so this does not stack on anything.

  • parseChatText / formattedDisplayText / cardLinks in :apps:flipcash:shared:chat feed detectUrls and detectMentions into parseTextFormat as protected ranges, so every surface derives the same ranges.
  • Bubble: bold, italic, strike, code, quote bars, bullet and numbered indents, masked links shown as their label. Display offsets are mapped past mention placeholders for every span and link, so a style can straddle or wrap a mention.
  • Reply quotes, chat list preview and push text use the display string. Copy and edit keep the raw text.
  • Masked-link URLs are excluded from link cards and from MessageLinkPrefetcher (spec decision 4).
  • Mention pattern: one _ may precede the @, and the handle's closing _ is given back (spec rule 6). This was not in the brief's four PRs; it is needed for _@jeff_ to render as an italic mention.
  • ChatSummaryPreviewTest and MessagingPushDecryptionTest now run under Robolectric because previews call detectUrls.

Tests: FormattedBubbleTextTest (new), MentionDetectionTest.

Run message text through :libs:text-format with the detected links and mentions as protected ranges. The bubble styles bold, italic, strike, code, quotes and lists and shows a masked link as its label; reply quotes, chat list previews and push text show the display string with markers removed. Copy and edit keep the raw text.

A masked link's URL no longer produces a link card or prefetch (spec decision 4).

Mention detection accepts one underscore before the @ and gives the handle's closing underscore back (spec rule 6), so _@jeff_ is an italic mention. Previously it matched neither.

ChatSummaryPreviewTest and MessagingPushDecryptionTest now run under Robolectric because previews call detectUrls.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feature New functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant