Repository navigation
Fix card-issued link resolving against the active route - #98406
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
4affc1c to
0d92b1f
Compare
getCardIssuedMessage built the admin card-details link with createDynamicRoute and no base path, so it prepended Navigation.getActiveRoute(). The href is rebuilt on every render, so an Onyx-driven re-render while an RHP is open over the chat rebuilt it against the RHP's route and it fell through to Not Here. Base the link on the component's own screen via React Navigation's useRoutePath, wrapped in a new useDynamicRoute hook that returns a createDynamicRoute bound to that path. The href is now identical on every render regardless of the active route, and Spend > Chat is covered by the same change.
# Conflicts: # src/components/ReportActionItem/IssueCardMessage.tsx # src/pages/inbox/report/ContextMenu/ContextMenuActions.tsx # tests/unit/ReportActionsUtilsTest.ts
|
@mukhrr The solution looks good. However, I think we should verify all usages of |
@mukhrr I'm not sure. I did a quick search and found a few places that still need to be updated: App/src/components/BookTravelButton.tsx Line 153 in 3cdeab4 App/src/components/ReportWelcomeText.tsx Line 102 in 3cdeab4 I think there are still many other usages that we need to check. |
|
@dmkt9 actually we have 477 Fixed only 6 with exact reason:
The first four use |
The four component/page sites built an href during render with no base path, so a re-render while another route was on top rebuilt the link against that route. They now take the base from useDynamicRoute. getExportMenuItem is not a hook context; its NetSuite and QuickBooks Desktop branches simply never read the backTo the function already accepts, unlike the QuickBooks Online and Sage Intacct branches beside them. ReportWelcomeText's getReportRHPActiveRoute workaround was a no-op: it returns getActiveRoute() when a report is in the RHP and an empty string otherwise, so both branches resolved to the same base as passing none.
|
@mukhrr I agree that we don't need to change the cases where Couldn't that potentially trigger when the screen isn't focused? |
|
@dmkt9 I believe |
App/src/components/BookTravelButton.tsx Lines 209 to 217 in 76cdf9d |
|
@mukhrr sounds reasonable to address in a follow-up. Feel free to report the issue separately |
@roryabraham hmm can you pls have melvin to open a new issue and assign me and @dmkt9 ?! leaving Reproduction steps here:
Expected: Background should stay on as-is Actual: Background navigates to user REC-20260903105740.mp4 |
|
@MelvinBot create an issue per the last comments. Assign @mukhrr @dmkt9 @roryabraham |
|
Created #100260 — "Contact methods RHP swaps the background tab to Account > Profile". It carries Assignees: only |
|
@dmkt9 let's continue pls |
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safarichrome.mp4 |
|
@dmkt9 anything else here? |
|
🚧 roryabraham 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/roryabraham in version: 9.4.73-0 🚀
|
|
No help site changes are required for this PR, so I did not create a draft PR. This is an internal navigation fix with no user-facing surface change. The card-issued hyperlink was always meant to open the card details; it was just resolving against the wrong route and landing on "Not here". After the fix it does what the product already promised, so there is no documented behavior to correct or add. Why I concluded no docs are neededWhat actually changed — all 24 files are code and tests. No
Help articles I checked. The articles that mention replacement cards all document how to request one, which this PR does not change:
None of them describe the in-chat "replacement card" hyperlink, the card details view, or the "Not here" page. There is no stale statement to fix and no new step to document — a reader following any of these articles gets the same instructions before and after this PR. Why I did not write a new article. Per I skipped the label and assignment steps as well, since they only apply to a docs PR. @mukhrr, there is no help site PR to review. If you expected a specific article to change — for example if this fix also changed where the link lands compared to its original intended destination — tell me which article and I will draft the update. |
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.4.73-3 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
The admin "replacement card" link (and the Spend > Chat card link) could open "Not Here" after a few clicks.
getCardIssuedMessagebuilt the link withcreateDynamicRouteand no base path, so it usedNavigation.getActiveRoute(); when the chat message re-rendered while the card-details RHP was open, the href was rebuilt against the RHP's route and stopped resolving. The fix binds the link to the component's own screen via a newuseDynamicRoutehook (built on React Navigation'suseRoutePath()), so the href stays correct regardless of the active route.Fixed Issues
$ #95364
PROPOSAL: #95364 (comment)
Tests
Offline tests
Same as Tests. The link is built client-side, so the behavior is identical offline.
QA Steps
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
Android: Native
android_app.mp4
Android: mWeb Chrome
android_web.mp4
iOS: Native
IOS-app.mp4
iOS: mWeb Safari
IOS-web.mp4
MacOS: Chrome / Safari
web.mp4