Fix fragment.text literal and close search RHP after deleting last message - #92543
Conversation
|
@hungvu193 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] |
|
🚧 @mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppandroid.movAndroid: mWeb ChromeiOS: HybridAppios.moviOS: mWeb SafariMacOS: Chrome / Safariweb.movweb2.mov |
mkhutornyi
left a comment
There was a problem hiding this comment.
We already have the auto navigation logic here:
App/src/pages/inbox/ReportNavigateAwayHandler.tsx
Lines 158 to 167 in 82237b8
web2.mov
So this doesn't happen when the thread report is NOT RHP modal.
The root cause is that isInNarrowPaneModal is true so early return here insde navigateAwayFromReport function:
App/src/pages/inbox/ReportNavigateAwayHandler.tsx
Lines 107 to 109 in 82237b8
| !isDeletedParentAction && | ||
| !ReportActionsUtils.doesReportHaveVisibleActions(reportID, canUserPerformWriteAction, optimisticReportActions as ReportActions, visibleReportActionsDataParam) | ||
| ) { | ||
| Navigation.goBack(); |
There was a problem hiding this comment.
This causes regression:
Screen.Recording.2026-06-07.at.4.56.50.PM.mov
We should NOT auto close report when parent message is not deleted
There was a problem hiding this comment.
Another bad regression:
Screen.Recording.2026-06-07.at.4.59.54.PM.mov
|
I am not sure I am following the current approach. Can we fix this root cause instead but without reintroducing the bug what it fixed? |
5964491 to
8d66dfe
Compare
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
Screen.Recording.2026-06-08.at.14.05.40.movIt fixes the original issue and regressions don't occur :) @mkhutornyi Could you check if it's ok now? |
|
yes it fixes the original issue. I found another similar case where auto navigation doesn't happen. Repro step:
bug.movLet's fix this separately to avoid regressions. (Maybe adjust condition in your original approach. We should check with We already have auto navigation logic in App/src/libs/actions/Report/index.ts Lines 3149 to 3151 in 613f8f5 |
|
🚧 @mountiny 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! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.4.5-0 🚀
Bundle Size Analysis (Sentry): |
|
🤖 Help site review: no changes required I reviewed the changes in this PR against the help site articles under Why no docs changes are requiredThe PR makes two internal fixes that restore expected behavior rather than introducing or changing any user-facing functionality:
Deleting comments/threads and viewing reports via Spend > Reports are existing behaviors already covered (where relevant) by current articles, and their documented steps are unaffected by these fixes. @WojtekBoman, since no help site changes are required, there is no linked help site PR to review. If you believe a documented behavior was affected, let me know and I'll create a draft docs PR. |
|
🚀 Deployed to production by https://github.com/Julesssss in version: 9.4.5-6 🚀
|
Explanation of Change
Fixes the
"fragment.text"literal showing in chat after deleting a thread conversation: thedefaultcase inReportActionItemFragmentnow renders{fragment?.text ?? ''}instead of the literal string. Additionally, indeleteReportComment, when a report shown in the search RHP (/search/view/:reportID) has no visible actions left after deletion, we pop that RHP screen (keeping any wider RHP below open).Screen.Recording.2026-06-03.at.17.09.44.mov
Fixed Issues
$ #91603
PROPOSAL:
Tests
"fragment.text"does NOT appear anywhere after deleting the thread conversation./search/view/:reportIDis deleted, that RHP screen closes automatically (instead of showing an empty report).Offline tests
/search/view/:reportID) and delete its last visible message."fragment.text"never appears.QA Steps
Same as tests.
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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari