Repository navigation
Description
Background
We decided in this thread that the travel enablement flow should probably be turned into a dynamic stepper. This way it'll have a progress bar as the user moves through the steps to enable travel.
Problem
The "Book Travel" workspace-enablement flow walks a workspace admin through a series of separate full-screen steps before travel is enabled. Depending on the workspace, the user sees some subset of: enter your legal name, verify your account (magic code), choose a booking domain, enter the workspace address, enter a legal-entity tax ID, and accept the terms. These are disconnected screens that each decide the next screen on their own, and there is no progress indicator — so the user has no idea how many steps remain or where they are in the process, and the number of steps varies invisibly by workspace.
What we want
Turn the enablement flow into a single multi-step flow with a dynamic progress stepper ("step N of M") at the top, where M reflects only the steps that actually apply to that workspace. A workspace that needs 3 steps shows a 3-dot bar; one that needs 5 shows 5.
Requirements
Steps and when each applies
The flow presents these steps, in this order, each included only when its condition holds:
- Legal name — when the user's legal first/last name is missing.
- Verify account (magic code) — when the account is not yet validated.
- Domain selector — when the admin belongs to more than one private email domain.
- Workspace address — when the workspace has no address on file.
- Legal-entity tax ID — when the workspace currency is non-USD, the workspace is not already provisioned, and no tax ID is stored. (This step was recently added in App #94604.)
- Terms & conditions — always. This is the terminal step that accepts the Spotnana terms and opens TravelDot.
Stepper behavior
- The progress bar is shown on every step, and the number of dots equals the number of applicable steps for that workspace.
- If only one step applies (e.g. only terms remain), show the flow without the progress bar (a single-dot stepper is meaningless).
- The user can go back a step, and tapping a completed dot lets them edit that step and return to the end (standard stepper edit behavior).
- The current step must be reflected in the URL so a page refresh keeps the user in place.
- Entering the flow must be access-guarded to the workspace (admins only) — a direct deep link by a non-member must not render it.
Terminal step must preserve existing outcomes exactly
The terms step currently handles several backend responses; all must be preserved:
- Permission denied → navigate to the domain-permission-info screen.
- Additional verification required → show the verify-company modal and, on confirm, create the concierge enablement issue.
- Success → close the flow and open TravelDot.
- Errors surfaced inline on the terms step.
Out of scope / constraints (do not change)
- The legacy request-access path (used when the
IS_TRAVEL_VERIFIEDbeta is off) must be preserved unchanged. - The Travel-Invoicing toggle (
WorkspaceTravelInvoicingSection) must be untouched — it independently reuses the legal-name and public-domain-error screens and is not part of this flow. - The
AcceptSpotnanaTermsAPI command and its parameters must be unchanged. - The pre-checks in
BookTravelButton(blocked-feature beta, phone/SMS login error, public-domain error, no-admin-domains, upgrade, non-paid-workspace error, already-enabled) must be preserved.
How to see the current behavior (staging)
On staging.new.expensify.com, as an admin of a paid group workspace that has not enabled travel: open the workspace → More features → enable Travel (or use a Book Travel button), and step through. Observe that each step is its own screen with no progress indicator, and that the set of screens shown differs by workspace state (currency, account validation, address on file, number of admin domains).
Extra context — implementation guidance (recommended, not mandatory)
We investigated this and built a working reference implementation; notes for whoever picks it up.
Template & mechanism
- Use the
useSubPagehook (src/hooks/useSubPage/index.tsx) +InteractiveStepSubPageHeader. This is the current, non-deprecated multi-step pattern (useSubStepis deprecated per App #79039); it's documented incontributingGuides/NAVIGATION.mdunder "Multi-step flows with URL synchronization". src/pages/MissingPersonalDetails/MissingPersonalDetailsContent.tsxis the closest existing template — it builds its pages conditionally with a matching step-name list and passespageIndexstraight to the stepper header.
Build the pages array conditionally — do NOT use skipPages
- No flow in the codebase combines
skipPageswithInteractiveStepSubPageHeader.useSubPage'spageIndexis an index into the fullpagesarray;skipPagesonly affects next/prev traversal, so feedingpageIndexto the stepper while skipping earlier pages misreports "N of M", and there is no helper to remap it. Buildingpagesconditionally makespages=== visible steps, so the stepper index is correct for free.
Rendering model
- The orchestrator owns the
ScreenWrapper+ header + stepper; each step is a chrome-less subpage (noScreenWrapper/header of its own), like theMissingPersonalDetailssubpages. BookTravelButtonshould, after its existing pre-checks, navigate to the new flow route instead of doing per-screen navigation. The old cross-screennextStepRoutehand-off in OnyxTRAVEL_PROVISIONING(src/libs/actions/Travel.ts) can be deleted onceuseSubPageowns ordering. The selected domain / tax ID should ride inTRAVEL_PROVISIONING(Onyx) so they survive a refresh.
Current flow files (logic to port)
- Entry:
src/components/BookTravelButton.tsx(thebookATripcascade). - Screens:
src/pages/Travel/TravelLegalNamePage.tsx,VerifyAccountPage.tsx,DynamicDomainSelectorPage.tsx,WorkspaceAddressForTravelPage.tsx,TravelLegalEntityTaxIDPage.tsx,DynamicTravelTerms.tsx.
The verify (magic-code) step is the tricky one
VerifyAccountPageBaseandValidateCodeActionContentrender their ownScreenWrapper, so they can't be dropped in as chrome-less subpages. Their inner primitiveValidateCodeFormis chrome-less: compose that + replicate the validation wiring, and call the subpage'sonNext()whenaccount.validatedflips. That keeps the stepper visible on the OTP step without forking the shared magic-code component.
Caveat if you also remove the old routes/pages
- The old routes are entangled: the legacy beta-off path still routes through the old verify page →
getTravelAcceptTermsRoute→ the tax-ID/TCS routes, and the sharedentryScreensarrays on the permission-info / TCS dynamic routes reference screens you'd be deleting. Untangle carefully (simplify the legacy verify page's now-dead forward-navigation first, then delete), or leave the dead pages and remove them in a focused follow-up. AfterBookTravelButtonis rewired, the old pages are unreachable through the UI.
Reference implementation
- A complete, validated implementation of everything above (the new flow +
BookTravelButtonwiring) is on branchblimpich-travelDynamicStepper, stacked on App #94604. It passes prettier,tsgotypecheck, eslint, and React Compiler compliance. Use it as a starting point or reference. Note it does not yet remove the old routes/pages (see caveat above) and has not had manual/jest verification.
– written by Claude on Ben's behalf
Issue Owner
Current Issue Owner: @mallenexpensifyUpwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022075003944730212127
- Upwork Job ID: 2075003944730212127
- Last Price Increase: 2026-07-08
Metadata
Metadata
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
blimpich commentedon Jul 8, 2026
FYI I started working on this but don't have the time to see it through. My WIP PR is here. Feel free to re-use it / modify it.
blimpich commentedon Jul 8, 2026
Asked for volunteers here
samranahm commentedon Jul 8, 2026
melvin-bot commentedon Jul 8, 2026
Current assignee @huult is eligible for the External assigner, not assigning anyone new.
[-]Book Travel enablement flow has no progress stepper[/-][+][$250] Book Travel enablement flow has no progress stepper[/+]melvin-bot commentedon Jul 8, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022075003944730212127
wildan-m commentedon Jul 8, 2026
17 remaining items
melvin-bot commentedon Aug 6, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Aug 6, 2026
Payment Summary
Resolving PRs:
Book Travel enablement flow has no progress stepper #95692
Reviewer: @huult owed $250 via NewDot
Reviewer: @linhvovan29546 owed $250 via NewDot
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon Aug 10, 2026
Payment Summary
Contributor: @linhvovan29546 due $250 via NewDot
Contributor+: @huult due $250 via NewDot
twisterdotcom commentedon Aug 11, 2026
$250 approved for @linhvovan29546 in Report ID: R00JCIUSXAuJ.
Zapier Logs
Run ID: 00040eee-9151-a5e3-9769-9eee09f27ca4SO: https://stackoverflowteams.com/c/expensify/questions/7582
JmillsExpensify commentedon Sep 6, 2026
$250 approved for @huult