Fix suggested followup: preserve HTML formatting and fix response ordering#85592
Conversation
…nse ordering Bug A: Use dom-serializer render() instead of DomUtils.textContent() to preserve HTML formatting in followup responses. Add isHTML parameter to buildOptimisticAddCommentReportAction to skip getParsedComment() when input is already HTML. Bug B: Add createdOffset: 1 to the Concierge response so its timestamp is 1ms after the question, ensuring correct ordering. The visual typing delay is handled separately by displayAfter in addOptimisticConciergeActionWithDelay. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@dukenv0307 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Use stripFollowupListFromHtml in setClipboardMessage so that <followup-list> Q&A content is removed before copying to clipboard. This re-applies the clipboard stripping from PR 84452 which was reverted. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
trjExpensify
left a comment
There was a problem hiding this comment.
Bug fixes for the conversional onboarding project! 👍
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-03-19.at.09.57.35.movAndroid: mWeb ChromeScreen.Recording.2026-03-19.at.09.47.34.moviOS: HybridAppScreen.Recording.2026-03-19.at.09.54.58.moviOS: mWeb SafariScreen.Recording.2026-03-19.at.09.37.53.movMacOS: Chrome / SafariScreen.Recording.2026-03-19.at.09.30.24.mov |
|
🎯 @dukenv0307, thanks for reviewing and testing this PR! 🎉 An E/App issue has been created to issue payment here: #85728. |
|
@marcochavezf We got the failed test, can you please take a look? |
|
🚧 @marcochavezf has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/marcochavezf in version: 9.3.42-0 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
Fixes three bugs with suggested followup button clicks:
Bug A — Collapsed formatting in optimistic Concierge response:
parseFollowupsFromHtml()usedDomUtils.textContent()to extract<followup-response>content, which strips all HTML tags. This caused the optimistic Concierge response to appear as plain text without formatting. Fixed by usingdom-serializer'srender()to preserve the inner HTML. Also added anisHTMLparameter tobuildOptimisticAddCommentReportActionso it skipsgetParsedComment()(markdown-to-HTML conversion) when the input is already HTML.Bug B — Response appears before question: The Concierge response had no
createdOffset, defaulting to 0 (same timestamp as the question). This caused a race where the response could render before the question. Fixed by addingcreatedOffset: 1(1ms after the question) to ensure correct chronological ordering. The 4-second visual delay is handled separately bydisplayAfterinaddOptimisticConciergeActionWithDelay.Bug C — Followup Q&A leaks into clipboard copy: When copying a Concierge message that contains
<followup-list>elements, the followup questions and answers were included in the clipboard text. Fixed by callingstripFollowupListFromHtml()insetClipboardMessage()(inContextMenuActions.tsx) to remove followup content before it reaches the clipboard. This re-applies the clipboard stripping from the reverted PR 84452.Fixed Issues
$ https://github.com/Expensify/Expensify/issues/612990
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
N/A - no UI changes, only logic fix for HTML preservation and timestamp ordering
Android: mWeb Chrome
N/A - no UI changes, only logic fix for HTML preservation and timestamp ordering
iOS: Native
N/A - no UI changes, only logic fix for HTML preservation and timestamp ordering
iOS: mWeb Safari
N/A - no UI changes, only logic fix for HTML preservation and timestamp ordering
MacOS: Chrome / Safari
N/A - no UI changes, only logic fix for HTML preservation and timestamp ordering