Extract report builder routes to Next.js#862
Extract report builder routes to Next.js#862SakshiKekre wants to merge 1 commit intonextjs-calculator-migrationfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Migrate ReportBuilderPage and ModifyReportPage from the React Router catch-all to dedicated Next.js file-based routes: - [countryId]/reports/create/page.tsx → ReportBuilderPage - [countryId]/reports/create/[userReportId]/page.tsx → ModifyReportPage Swap react-router-dom imports to router abstraction in page components and ReportBuilderShell. ModifyReportPage now accepts userReportId as a prop (bridged via wrapper in CalculatorRouter for Vite, via Next.js params for calculator-app). Convert location.state usage to query params for cross-router compatibility. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
480d58e to
ccc775a
Compare
Review findings — PR #862 (Extract report builder routes)Code reviewer found no issues at confidence >= 80 — clean PR overall. HIGH
MEDIUM
🤖 Generated with Claude Code |
Summary
[countryId]/reports/create/and[countryId]/reports/create/[userReportId]/)react-router-domimports (useNavigate,useLocation,useParams) to the router abstraction layer (useAppNavigate,useAppLocation, prop passing)location.stateusage in ModifyReportPage to query params (?from=report-output&reportPath=...) for cross-router compatibilitylocation.stateto use query params insteadModifyReportPageRoutebridge wrapper in CalculatorRouter so the Vite app continues to work viauseParamsDependent PR
#869 (report output extraction) is based on this branch. It will be merged into this branch before everything merges up to #851 → main. See #851 for the full merge strategy.
Route mapping
/:countryId/reports/createcalculator-app/src/app/[countryId]/reports/create/page.tsx/:countryId/reports/create/:userReportIdcalculator-app/src/app/[countryId]/reports/create/[userReportId]/page.tsxTest plan
cd calculator-app && bun run dev— navigate to/us/reports/create, create a report/us/reports/create/<id>— verify modify page loads with report data?from=report-output&reportPath=...) pass through and back navigation workscd app && VITE_APP_MODE=calculator npx vite— Vite dev server still works for both routesbun run test— all 2950 tests passbun run lint— no errorsbun run typecheck— passes (app + calculator-app)