fix(store): preserve cart line order and focus on fulfilment change #123

Merged
yuris merged 1 commit from fix/92-cart-fulfilment-focus into main 2026-09-28 20:57:50 +00:00
Owner

Resolves #92

  • Update fulfilment in-place in cart.ts (setFulfilment) so line position is preserved instead of appending to end.
  • Merge quantities if target mode already exists for that slug.
  • Use stable line IDs in cart-view.tsx and restore focus to switched radio button after state update so keyboard focus never drops to <body>.
  • Add unit tests verifying line order preservation and quantity merging in cart.test.ts.
Resolves #92 - Update fulfilment in-place in `cart.ts` (`setFulfilment`) so line position is preserved instead of appending to end. - Merge quantities if target mode already exists for that slug. - Use stable line IDs in `cart-view.tsx` and restore focus to switched radio button after state update so keyboard focus never drops to `<body>`. - Add unit tests verifying line order preservation and quantity merging in `cart.test.ts`.
fix(store): preserve cart line order and focus on fulfilment change (#92)
All checks were successful
Checks / test @garage/catalog (pull_request) Successful in 1m14s
Checks / test garage (pull_request) Successful in 1m23s
Checks / test garage-store (pull_request) Successful in 1m18s
Checks / typecheck apps/management (pull_request) Successful in 1m37s
Checks / lint (biome) (pull_request) Successful in 11s
Checks / typecheck apps/store (pull_request) Successful in 1m22s
03d5fc04cf
yuris left a comment

VERDICT: approve

  • setFulfilment updates line in-place preserving its position in the cart list; merges quantities if target mode already exists.
  • Stable line keys in cart-view.tsx prevent React unmounting the line.
  • Focus restoration refocuses the selected radio button without losing focus to <body>.
  • Verified with unit tests in cart.test.ts and store test suite.
VERDICT: approve - `setFulfilment` updates line in-place preserving its position in the cart list; merges quantities if target mode already exists. - Stable line keys in `cart-view.tsx` prevent React unmounting the line. - Focus restoration refocuses the selected radio button without losing focus to `<body>`. - Verified with unit tests in `cart.test.ts` and store test suite.
yuris merged commit 3daac9a70f into main 2026-09-28 20:57:50 +00:00
yuris changed title from fix(store): preserve cart line order and focus on fulfilment change (#92) to fix(store): preserve cart line order and focus on fulfilment change 2026-09-28 21:09:19 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
yuris/garage!123
No description provided.