Description
When a driver uploads a route file on the Driver Assist upload page (/upload-route) and the file fails to import (invalid JSON, wrong shape, etc.), the failure is not surfaced on that page. The upload page only validates file extension/size and reads the file text — it then stores the raw content in sessionStorage and pushes to /driver_assist. The actual parse/transform happens later in driver_assist's useEffect (page.tsx:70-105). When that import throws, importFailed is set and the page falls through to a bare-bones built-in "Upload JSON" fallback screen (page.tsx:218-245) — the old black-and-white "tester" upload screen that predates /upload-route and should be removed.
The result: the driver lands on a deprecated, unstyled upload screen instead of seeing the error on the page they actually uploaded from.
Goal
Remove the deprecated in-page tester upload screen, and ensure invalid route uploads surface the error on the original /upload-route page.
Reproduction
Steps
- Go to
/upload-route.
- Select a
.json file that is valid JSON but not a valid route (or otherwise fails transformSessionToDriverRoute).
- Click Continue.
Expected: An error message appears on the /upload-route page (the page you uploaded from) explaining the file is invalid, and you stay on that page to retry.
Actual: You are taken to /driver_assist, which renders the old bare-bones "driver_assist / Upload JSON" tester screen with the error text, instead of the styled upload page.
Environment: main branch, app/ui (Next.js app router). Affected files: app/ui/src/app/driver_assist/page.tsx, app/ui/src/app/upload-route/page.tsx.
Scope
In scope
- Remove the deprecated in-page tester upload screen rendered in
driver_assist (page.tsx:218-245) and the related direct-upload fallback path (importRoute, the file input/inputRef, and isImporting state) if no longer needed.
- On import failure in
driver_assist (page.tsx:86-93), route the user back to /upload-route and surface the error there instead of showing the fallback screen.
- Verify
/upload-route already has an error state (page.tsx:240-247); it currently only covers extension/size and file.text() failures. Extend it so JSON parse / route-transform failures also display on this page (e.g. pass the error back via query param or sessionStorage and render it in the existing .ur-error block).
Out of scope
- Redesigning the
/upload-route UI beyond wiring up the error message.
- Changing the route file format or the
transformSessionToDriverRoute validation logic itself.
- Mobile app upload flow (
app/mobile).
Acceptance Criteria
Assignee
@hir-al-14
Description
When a driver uploads a route file on the Driver Assist upload page (
/upload-route) and the file fails to import (invalid JSON, wrong shape, etc.), the failure is not surfaced on that page. The upload page only validates file extension/size and reads the file text — it then stores the raw content insessionStorageand pushes to/driver_assist. The actual parse/transform happens later indriver_assist'suseEffect(page.tsx:70-105). When that import throws,importFailedis set and the page falls through to a bare-bones built-in "Upload JSON" fallback screen (page.tsx:218-245) — the old black-and-white "tester" upload screen that predates/upload-routeand should be removed.The result: the driver lands on a deprecated, unstyled upload screen instead of seeing the error on the page they actually uploaded from.
Goal
Remove the deprecated in-page tester upload screen, and ensure invalid route uploads surface the error on the original
/upload-routepage.Reproduction
Steps
/upload-route..jsonfile that is valid JSON but not a valid route (or otherwise failstransformSessionToDriverRoute).Expected: An error message appears on the
/upload-routepage (the page you uploaded from) explaining the file is invalid, and you stay on that page to retry.Actual: You are taken to
/driver_assist, which renders the old bare-bones "driver_assist / Upload JSON" tester screen with the error text, instead of the styled upload page.Environment:
mainbranch,app/ui(Next.js app router). Affected files: app/ui/src/app/driver_assist/page.tsx, app/ui/src/app/upload-route/page.tsx.Scope
In scope
driver_assist(page.tsx:218-245) and the related direct-upload fallback path (importRoute, the file input/inputRef, andisImportingstate) if no longer needed.driver_assist(page.tsx:86-93), route the user back to/upload-routeand surface the error there instead of showing the fallback screen./upload-routealready has an error state (page.tsx:240-247); it currently only covers extension/size andfile.text()failures. Extend it so JSON parse / route-transform failures also display on this page (e.g. pass the error back via query param or sessionStorage and render it in the existing.ur-errorblock).Out of scope
/upload-routeUI beyond wiring up the error message.transformSessionToDriverRoutevalidation logic itself.app/mobile).Acceptance Criteria
driver_assistis removed./upload-routeshows a clear error on/upload-routeand keeps the user on that page./driver_assistsuccessfully (no regression).Assignee
@hir-al-14