Repository navigation
fix(chat): preserve text before links in reply message preview - #25274
Conversation
The reply intention preview and the quote inside sent replies extract the first visible line of the original message with getFirstVisibleLineHtml. The function treated the inline tags <a> and <code> as block-level, walked the root children in reverse order and removed every node that precedes the last "block" found - so a message like "Hello https://example.com" was previewed as just the link. Rewrite the extraction to walk the DOM in document order and truncate at the first visual line break (newline in a non-whitespace-only text node, <br>, or the end of the first nested block element), keeping inline content of the first line intact. Lists now preview their first item instead of the last one. Add an e2e scenario covering both previews when replying to a message with text followed by a link. Co-authored-by: Tainan Felipe <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
WalkthroughA new Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsStopped waiting for pipeline failures after 30000ms. One of your pipelines takes longer than our 30000ms fetch window to run, so review may not consider pipeline-failure results for inline comments if any failures occurred after the fetch window. Increase the timeout if you want to wait longer or run a Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅ Automated tests have passed! |
9751279
into
bigbluebutton:v3.0.x-develop
|



What does this PR do?
ports #25268 changes to BBB 3.0:
Fixes the chat reply preview dropping text that comes before a link.)
When you reply to a message like
Hello https://example.com, both previews — the "replying to" banner above the input and the quote inside the sent reply — showed onlyhttps://example.com, silently dropping theHello.The culprit is
getFirstVisibleLineHtml(bigbluebutton-html5/.../chat/chat-graphql/service.ts), which extracts the first line of the original message. It walked the message's nodes in reverse and treated the inline tags<a>and<code>as block-level, so it kept the last block (the link) and removed everything before it. This also affected text before inline code, text on both sides of a link, and lists (showed the last item instead of the first).The fix rewrites the extraction to walk the DOM in document order and truncate at the first real line break (a
\nin a text node, a<br>, or the end of the first block element), keeping all inline content of the first line intact.