Conversation
📝 WalkthroughWalkthroughTop-level migration from Changes
Sequence Diagram(s)sequenceDiagram
participant Browser as Browser
participant Router as RouterProvider (react-router)
participant AppLayout as AppLayout (Entrypoint/Layout)
participant Providers as Global Providers (UiConfig, Party, Form, etc.)
participant Features as Feature Routes (Entrypoint, Instance, PDF, Form)
Browser->>Router: request URL
Router->>AppLayout: resolve route -> AppLayout (layout route)
AppLayout->>Providers: wrap route outlet with providers
Providers->>Features: render matched feature via Outlet
Features->>Providers: request instance/party data (providers)
Providers-->>Features: provide data
Features-->>Browser: render UI / navigation actions
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/App/frontend/src/components/form/Form.tsx (1)
54-56:⚠️ Potential issue | 🟡 MinorPre-existing bug:
setSearchParamscallback returns the wrong reference.The callback deletes from
paramsbut returns the outersearchParamsobject. In React Router, the callback argument is a freshURLSearchParamsinstance, so the deletion onparamsis discarded andsearchParams(which still containsValidate) is returned instead.Proposed fix
setSearchParams((params) => { params.delete(SearchParams.Validate); - return searchParams; + return params; });
|
🔍 Lighthouse Report
Edited |
olemartinorg
left a comment
There was a problem hiding this comment.
Looks good! 🥳 Strange why that test fails, but seems like it goes to the first page of the subform then immediately jumps back to the previous route and just hangs there. Not sure why, but worth investigating.
…ing under a catch-all splat route, and replace Subform's nested Routes with param-based conditional rendering
4348c4b to
8675487
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (2)
src/App/frontend/src/setupTests.ts (1)
115-124: Request polyfill doesn't forwardheadersorbodyfrominit.The
headersfield is always initialised to{}, ignoring anyheaderspassed ininit. React Router v7 may constructRequestobjects with headers or a body (e.g. for form submissions or loader calls). If any test exercises those paths, failures will be opaque.Consider widening the
inittype and forwarding at leastheadersandbody:Suggested improvement
- url: string; - method: string; - headers: Record<string, string>; - signal?: AbortSignal; - constructor(url: string, init?: { method?: string; signal?: AbortSignal }) { - this.url = url; - this.method = init?.method ?? 'GET'; - this.headers = {}; - this.signal = init?.signal; + url: string; + method: string; + headers: Record<string, string>; + body: BodyInit | null; + signal?: AbortSignal; + constructor( + url: string, + init?: { method?: string; headers?: Record<string, string>; body?: BodyInit | null; signal?: AbortSignal }, + ) { + this.url = url; + this.method = init?.method ?? 'GET'; + this.headers = init?.headers ?? {}; + this.body = init?.body ?? null; + this.signal = init?.signal; }src/App/frontend/src/index.tsx (1)
137-159: Consider consolidating the legacy redirect into a single route with a splat.The two child routes (index +
*) both redirect to the same target. A single splat route would suffice.♻️ Suggested simplification
{ path: 'partyselection', - children: [ - { - index: true, - element: ( - <Navigate - to='/party-selection' - replace - /> - ), - }, - { - path: '*', - element: ( - <Navigate - to='/party-selection' - replace - /> - ), - }, - ], + element: ( + <Navigate + to='/party-selection' + replace + /> + ), },
Description
Verification
Summary by CodeRabbit