fix(app): allow static segments as siblings of dynamic route segments - #6953
fix(app): allow static segments as siblings of dynamic route segments#6953benedikt-bartscher wants to merge 1 commit into
Conversation
_find_route_conflict flagged a conflict whenever an existing route's dynamic segment lined up with a different static segment of a new bracket-containing route (e.g. /posts/[id] vs /posts/all/[x]), and only in that registration order. React Router resolves such siblings fine (static wins), so only two dynamic segments with different names at the same position are a real conflict.
Greptile SummaryThe PR makes route-conflict detection symmetric and permits static route segments alongside dynamic segments while continuing to reject differently named dynamic segments in the same position.
Confidence Score: 5/5The PR appears safe to merge, with the updated conflict detection matching the router’s static-over-dynamic specificity behavior. The changed logic retains rejection of competing dynamic segment names while allowing route shapes that the router resolves deterministically, and the tests cover both registration orders.
|
| Filename | Overview |
|---|---|
| reflex/app.py | Updates route-conflict comparison so only differently named dynamic segments at the same position conflict; the behavior aligns with route specificity rules. |
| tests/units/test_route.py | Adds bidirectional coverage showing that static siblings of dynamic route segments are valid. |
Reviews (1): Last reviewed commit: "fix(app): allow static segments as sibli..." | Re-trigger Greptile
Merging this PR will not alter performance
Comparing Footnotes
|
_find_route_conflict flagged a conflict whenever an existing route's dynamic segment lined up with a different static segment of a new bracket-containing route (e.g. /posts/[id] vs /posts/all/[x]), and only in that registration order. React Router resolves such siblings fine (static wins), so only two dynamic segments with different names at the same position are a real conflict.