Migrate Travel workspace confirmation to dynamic route#93722
Conversation
Migrate TRAVEL_WORKSPACE_CONFIRMATION from a static backTo-based route to a dynamic route using createDynamicRoute/useDynamicBackPath, per the migrate-to-dynamic-route skill. Co-authored-by: huult <huult@users.noreply.github.com>
|
I created this PR from an upstream branch since I don't have push access to your fork. To take ownership of this branch and be able to push updates, run: Then you can close this PR and open a new one from your fork. |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
I analyzed the checks on this PR — there's no failing check that requires a code fix. The only red check is
Every real code-quality gate is green: typecheck (tsc), all 8 test jobs, Storybook, ESLint, Prettier, build, React Compiler, knip, and unused-styles all pass. Note on local
|
This comment was marked as outdated.
This comment was marked as outdated.
|
@MelvinBot Please cherry-pick all commits from the |
Co-authored-by: huult <huult@users.noreply.github.com>
Co-authored-by: huult <huult@users.noreply.github.com>
…EL_VERIFY_ACCOUNT routes Decrement ROUTES.ts getUrlWithBackToParam count (removed two static routes) and grandfather the no-unsafe-type-assertion in DynamicWorkspaceAddressForTravelPage. Co-authored-by: huult <huult@users.noreply.github.com>
|
🤖 Cherry-picked both commits from
Together with the existing Conflicts resolvedBoth commits were based on an older One follow-up commit I added (
|
|
@MelvinBot I just pushed a new commit (aa0c8fa). Please cherry-pick it into this PR. |
Co-authored-by: huult <huult@users.noreply.github.com>
…_DETAILS routes Co-authored-by: huult <huult@users.noreply.github.com>
|
🤖 Cherry-picked This migrates What I did:
Checks:
|
|
@MelvinBot Please analyze this PR and generate test steps to verify the changes. |
🧪 Test steps to verify the changesThis PR migrates the remaining Travel routes from legacy static
1. Trip Summary & Trip Details (read-only trip screens)
2. Workspace Confirmation
3. Verify Account & Workspace Address (provisioning flow)
4. Deep links (route paths changed)Paste each URL directly into the browser address bar (replace placeholders) and confirm the correct screen loads:
Confirm each resolves to the right screen and the back button behaves sensibly (does not crash / does not loop). 5. Regression sweep
🤖 Generated by MelvinBot. These are suggested verification steps — the human-owned Tests/QA sections of the PR body should still be completed by the author/reviewer. |
|
@MelvinBot Please create mock Onyx data that I can paste into the console to test the TRAVEL_TRIP_SUMMARY case. |
|
Here's console-pasteable mock Onyx data for testing the How the page reads data
const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${route.params.reportID}`);
const [transaction] = useOnyx(`${ONYXKEYS.COLLECTION.TRANSACTION}${getNonEmptyStringOnyxID(route.params.transactionID)}`);
const reservationsData = TripReservationUtils.getReservationsFromTripReport(report, transaction ? [transaction] : []);Because the mock Mock data — paste into the browser consoleconst reportID = '8201746391052837';
const transactionID = '4925108637451029';
Onyx.merge(`report_${reportID}`, {
reportID,
reportName: 'Trip to New York',
type: 'chat',
chatType: 'trip-room',
});
Onyx.merge(`transactions_${transactionID}`, {
transactionID,
reportID,
receipt: {
reservationList: [
{
reservationID: 'RES-FLIGHT-001',
type: 'flight',
start: {
date: '2026-07-01T08:30:00',
longName: 'San Francisco International Airport',
shortName: 'SFO',
cityName: 'San Francisco',
},
end: {
date: '2026-07-01T17:00:00',
longName: 'John F. Kennedy International Airport',
shortName: 'JFK',
cityName: 'New York',
},
company: {longName: 'Delta Air Lines', shortName: 'DL'},
confirmations: [{name: 'John Doe', value: 'ABC123'}],
route: {airlineCode: 'DL', number: '1234', class: 'Economy'},
numPassengers: 1,
duration: 18000,
},
{
reservationID: 'RES-HOTEL-001',
type: 'hotel',
start: {date: '2026-07-01T15:00:00', address: '123 Market St, New York, NY'},
end: {date: '2026-07-05T11:00:00', address: '123 Market St, New York, NY'},
confirmations: [{name: 'John Doe', value: 'HTL-998877'}],
numberOfRooms: 1,
roomClass: 'King Suite',
},
],
},
});Then navigate to: (
|
Explanation of Change
This migrates the Travel workspace confirmation route from the legacy static
backTo-based pattern to the new dynamic route pattern, following the migrate-to-dynamic-route skill.Why: dynamic routes derive their back destination from the active route at navigation time (via
createDynamicRoute/useDynamicBackPath) instead of threading abackToquery param through the route, which is the direction the navigation system is moving for these flows.What changed for
TRAVEL_WORKSPACE_CONFIRMATION:src/ROUTES.ts— removed the staticROUTES.TRAVEL_WORKSPACE_CONFIRMATION(with itsgetUrlWithBackToParambuilder) and added aDYNAMIC_ROUTES.TRAVEL_WORKSPACE_CONFIRMATIONentry withpath: 'workspace-confirmation'andentryScreens: [SCREENS.TRAVEL.DYNAMIC_UPGRADE].src/SCREENS.ts— renamedTRAVEL.WORKSPACE_CONFIRMATION→TRAVEL.DYNAMIC_WORKSPACE_CONFIRMATION(Dynamic_Travel_WorkspaceConfirmation).src/libs/Navigation/linkingConfig/config.ts— point the screen atDYNAMIC_ROUTES.TRAVEL_WORKSPACE_CONFIRMATION.path.src/libs/Navigation/types.ts— the screen param list entry is nowundefined(no morebackTo).src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx— bind the screen to the renamed page component.src/pages/Travel/WorkspaceConfirmationForTravelPage.tsx→ renamed toDynamicWorkspaceConfirmationForTravelPage.tsx; it now derivesbackPathwithuseDynamicBackPathinstead of reading abackToroute prop.src/pages/Travel/DynamicTravelUpgrade.tsx— navigates viacreateDynamicRoute(DYNAMIC_ROUTES.TRAVEL_WORKSPACE_CONFIRMATION.path).config/eslint/eslint.seatbelt.tsv— moved the grandfatheredno-unsafe-type-assertionentry to the renamed file path and decremented theROUTES.tsgetUrlWithBackToParamcount by 1.Scope note — remaining routes deferred
Issue #83867 lists 5 routes. Only
TRAVEL_WORKSPACE_CONFIRMATIONis migrated here because it is the only one that composes cleanly (no route params, single entry screen). The other 4 need follow-up work and are intentionally left out of this PR:TRAVEL_TRIP_SUMMARYandTRAVEL_TRIP_DETAILS(r/:reportID/trip/...): thereportID/transactionIDare trip-specific and are not the entry screen's report, so the path does not compose asentry + suffix. These do not fit the dynamic-route pattern without further design.TRAVEL_WORKSPACE_ADDRESSandTRAVEL_VERIFY_ACCOUNT: carry apolicyID/domainthat collides with theDYNAMIC_DOMAIN_SELECTORquery param, andVERIFY_ACCOUNTparticipates in the OTPsetTravelProvisioningNextStepstored-route chain — both require a path-param approach (like the TCS migration) and more careful handling.Fixed Issues
$ #83867
PROPOSAL:
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 validates your changed worked.
Offline tests
// TODO: The human co-author must fill out the offline tests.
QA Steps
// TODO: The human co-author must fill out the QA tests you ran before marking this PR as "ready for review".
PR Author Checklist
### Fixed Issuessection aboveScreenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari