-
Notifications
You must be signed in to change notification settings - Fork 3.5k
[WIP] Dismiss the RHP when the backTo is undefined #79771
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
🚧 @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.
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@ZhenjaHorbach 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] |
…ore effectively. Added cleanup logic to perform deletion on component unmount and improved navigation handling after deletion. Updated imports for new navigation URL functions.
|
🚧 @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! 🧪🧪
|
Fix: Prevent "It's not here" page when deleting expenses from Super Wide RHP
Problem
When viewing an expense report in the Super Wide RHP and deleting an expense from the transaction thread, the user would see the "It's not here" page before navigation could complete. This happened because:
Solution
Applied the same pattern used in
ReportDetailsPage.tsx- defer the actual deletion until the component unmounts:isTransactionDeletedref - A flag to track if deletion was requesteddeleteExpensecallback - Encapsulates all deletion logicgetNavigationUrlOnMoneyRequestDeleteto compute the correct destinationKey Changes
1. Deferred Deletion Pattern
const isTransactionDeleted = useRef(false);
const deleteExpense = useCallback(() => {
// ... deletion logic
}, [dependencies]);
useEffect(() => {
return () => {
if (!isTransactionDeleted.current) {
return;
}
isTransactionDeleted.current = false;
deleteExpense();
};
}, [deleteExpense]);#### 2. Smart Navigation Based on Deletion Outcome
navigateBackOnDeleteTransaction()to navigate to the expense report (which still exists)Navigation.dismissModal()since the expense report is also being deletedconst isNavigatingToChatReport = urlToNavigateBack &&
iouReportChatReportID &&
urlToNavigateBack.includes(iouReportChatReportID);
if (!urlToNavigateBack || isNavigatingToChatReport) {
Navigation.dismissModal();
} else {
navigateBackOnDeleteTransaction(urlToNavigateBack);
}### Why This Works
isTransactionDeleted.current = trueRelated Issues
$ #79732
PROPOSAL:
Tests
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 stepssectioncanBeMissingparam foruseOnyxtoggleReportand 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
Screen.Recording.2026-01-16.at.17.24.10.mov
Screen.Recording.2026-01-16.at.18.26.14.mov
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari