Three follow-on polish items from 68A: (1) fix the cashier-deactivate UI
race that's been persistent 8/9 on r1-1 all session, (2) codify the
stale-dev-server + Hyperdrive-cache + allowedOrigins gotchas in
AGENTS.md, and (3) bring stale R1 tests up to the current
R1.3.1+ flow so the regression suite turns fully green.
cashier-tab.tsx now uses an optimistic-active state machine —
the Active/Inactive chip flips on click synchronously, with rollback on
server-action failure and a useEffect reconciliation when the
server prop catches up. AGENTS.md gains a
## Local dev gotchas section with 5 anchors covering all the
traps we hit this session. r1-2 now expects the new-tab popup
(not the pre-R1.3 in-shell navigation); r1-3 now clicks a
cashier tile before expecting the PIN keypad (R1.3.1 added the picker).
/cafe/team + /cafe/pos both still 307 — no
regression from the cashier-tab edit.
app/(authed)/team/cashier-tab.tsx CashierRowItem
now keeps an optimisticActive state, flipped on click and
rolled back on action failure. The Active/Inactive Chip
and the Deactivate/Reactivate button variant both read from
optimisticActive instead of the server prop. A
useEffect reconciles back to the server's value after
router.refresh() lands. Fixes the 8/9 r1-1 flake where
the chip hadn't flipped within the test's 2s wait.allowedOrigins requirement, router.refresh()
fire-and-forget race (with pointer to the optimistic-UI pattern just
shipped), and prodSql() escape limits (with pointer to
the prodExec helper).test-r1-2-landing-prod.mjs rewritten to expect
context.waitForEvent("page") (new-tab popup) instead of
in-shell waitForURL.
test-r1-3-lockable-prod.mjs adds the
pos-cashier-grid + cashier-tile-<name>
click before each PIN-keypad interaction (both initial unlock and
the Lock-then-resume path).Loading…