Repository navigation
fix(chat): render item comments in chat like the person's own messages - #51546
Conversation
An item comment shown in chat printed its text raw, so picked mentions, bold, code and links showed as Markdown source. Pull the user message bubble's body into NativeChatUserMessageBody and render both through it.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
ELI5
When you comment on an item, the comment also shows up in the chat as your message with the item's name on top. That message showed exactly what you typed, symbols and all: a mention you picked from the
@menu showed as[Name](…:id), and**bold**or`code`stayed as raw characters. Now it looks like any other message you send in chat: mentions are chips, and bold, code and links are formatted.What Changed
@Names), Markdown, the long-message fold ("Show full message"), and long-link wrapping.NativeChatUserMessageRowinto one component,NativeChatUserMessageBody.<div>goes away, along with the one-off wrapping and kerning patch from fix(native-chat): wrap long URLs in item comment bubbles instead of widening the chat #47998. The shared fold already applies both rules.Why
The comment row had its own text renderer, separate from the user message bubble, so it never picked up chat's mention renderer or Markdown. Mentions became reachable there once the item comment box got the composer's
@picker (#46570). Sharing the real bubble body fixes it at the source, and it removes the second copy rather than teaching that copy about mentions.Linked Issue
N/A (internal report)
Visual Proof
After, on a dev build: a comment with a picked mention, bold,
codeand a file path, plus a very long link that wraps inside the bubble with no sideways scroll. Before, the first bubble showed the mention as its raw link token and the bold and code as raw characters.Testing
The new test renders a real item comment note with a picked mention token, a room member
@Mayaand**bold**, and checks for two mention chips and a<strong>. With the old plain-text<div>restored it fails (expected [] to deeply equal ['@Layout owner', '@Maya']).Performance
None worth measuring, because an item comment in chat now renders with the same memoized Markdown pipeline every user message in the chat already uses. It runs once per comment row, not on any hot path.
Risk
The riskiest part is how the item comment bubble looks. Comments are now Markdown, so a single newline joins lines the way it does in a chat message, and very long comments fold behind "Show full message". Chat's user messages render the same component they did before, so they don't change. Back out with a plain revert.
Level: Low
Notes
Rendering only, in the desktop renderer. Mobile already renders this comment as Markdown, and SSH, saved data and platforms are unaffected.