Fix: keep invoice room visible after deleting an invoice instead of showing Not here - #97502
Fix: keep invoice room visible after deleting an invoice instead of showing Not here#97502MelvinBot wants to merge 5 commits into
Conversation
Co-authored-by: Nyoman Jyotisa <nyomanjyotisa@users.noreply.github.com>
Co-authored-by: Nyoman Jyotisa <nyomanjyotisa@users.noreply.github.com>
|
Fixed the failing spellcheck check. Root cause: cspell flagged the word "unfocusing" (an unknown word) in two code comments — Fix: Reworded both comments to "removing focus from", which preserves the meaning. The only other failing check is PR Author Checklist / checklist, which is expected to fail until the human co-author fills out the checkboxes and Tests/QA sections — nothing for me to fix there. |
|
All fixable checks are now passing. spellcheck (the real failure) went green after the earlier fix reworded "unfocusing" → "removing focus from". The only remaining red check is PR Author Checklist / checklist, which fails by design until the human co-author checks every box and fills out the |
|
@MelvinBot I rechecked this and my earlier assumption was incomplete. Invoice reports are excluded from Please keep this guard, add the invoice fallback from #97495, and cover the real invoice path creating the URL. |
…oice path Co-authored-by: Nyoman Jyotisa <nyomanjyotisa@users.noreply.github.com>
|
Done — pushed What changed
Verification
|
|
✅ The spellcheck check is now passing after my earlier fix (reworded "unfocusing" → "removing focus from"). The only remaining red check is PR Author Checklist / checklist, which is expected to stay failing until the human co-author fills out the checkboxes and the Tests/QA sections — there's nothing for me to fix there. All other checks are passing or still running. |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@MelvinBot The fallback looks correct, but the test bypasses it by passing |
…ercised Co-authored-by: Nyoman Jyotisa <nyomanjyotisa@users.noreply.github.com>
|
Good catch — fixed in Verified it guards the fallback: with the How the test drives the real path
The suppression test keeps setting the URL directly, since it only exercises the Checks: 5/5 tests pass, |
|
@MelvinBot I tested the current head and the original flow still reproduces. Opening an invoice from the invoice room and selecting More → Delete leaves the The regression test renders |
… (useExpenseActions) Co-authored-by: Nyoman Jyotisa <nyomanjyotisa@users.noreply.github.com>
|
Good catch — you're right that the Root cause of the still-reproducing flow: the (One clarification: the actual delete handler for this page is The fix applies the same invoice fallback there — iouReport ?? (isInvoiceReport(moneyRequestReport) ? moneyRequestReport : undefined)Now Test covering the real flow — Verification
I kept the earlier |
|
MelvinBot has made 5 consecutive commits trying to fix CI failures. Automatic CI fix dispatches are now paused for this PR. Next steps: A human should review the recent commits and resolve the conflicting CI errors manually. |
Explanation of Change
Deleting an invoice (via More > Delete) removes the whole IOU report, so
getNavigationUrlOnMoneyRequestDeletenavigates back to the invoice room — a central-pane report two levels below the report-details RHP. ThatgoBackdoesn't synchronously unfocus the details RHP, so when the deferred optimistic delete nulls the report, the RHP is still focused.withReportOrNotFound's NotFound gate was suppressed only while the screen was unfocused, so it rendered the "Not here" page on the RHP.This mirrors the escape hatch that
ReportNotFoundGuardalready has for the report screen underneath: subscribe toNVP_DELETE_TRANSACTION_NAVIGATE_BACK_URLand keep the NotFound page suppressed while a delete-transaction navigation is in flight. It's self-terminating —DeleteTransactionNavigateBackHandlerclears the URL once the transition settles, so a genuinely-deleted report still falls through to NotFound.Added a regression test in
tests/ui/DynamicReportDetailsPageTest.tsxthat seeds an invoice report + room, marks report data as loaded, then sets the delete-back URL and nulls the invoice report while the RHP is focused, asserting the NotFound page stays suppressed.Fixed Issues
$ #97399
PROPOSAL: #97399 (comment)
Tests
// TODO: The human co-author must fill out the tests you ran before marking this PR as "ready for review". Please describe what tests you performed that validate your change worked.
Suggested steps:
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, 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.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
Screenshots/Videosundefined