← Back to gallery
T3 — Close-Shift Dialog Polish + Session History Total Sales PROD
2026-05-22 — Gate 2 ship. Third slice of Narong's 5/22 test-run findings. nix-cafe 859c3fd · 6 files modified · ~150 LOC net · no migration · no new deps.
Summary
- Status
- 23/23 prod + 51/51 regression = 74/74 ✓
- Tenant
- lumiere-coffee (Starter in-app shell)
- Commit
859c3fd on karouna-dev
- Reference
- Narong's Notion doc "5.22.2026 (Test Run)" + screen-recording
2026-05-22 11-20-41.mp4
What shipped
Close-Shift dialog (both shells — Starter starter-close-shift-dialog.tsx + Pro inline JSX in lockable-shell.tsx):
- T3.1 —
Cash in / Cash out rows render unconditionally (even at $0).
- T3.2 —
Expected row removed; section-header amount IS expected. New Difference row inside the section replaces it.
- T3.3 — Sub-row class shape unified across all sections (
space-y-1 text-[12px] pl-4).
- T3.4 — Non-cash sections render
Payments / Counted / Difference $0.00 (parallel structure to Cash, no new input surface).
- T3.5 — All sections live in ONE
close-calculations container with bg-[#FAFAFA]; no inter-section card borders. Inline "Diff: +$0" / tinted Difference callout below input both dropped.
Session History (/cafe/pos/sessions):
- T3.6 — New "Total Sales" column.
listSessions DAO exposes totalSales = cashSales + bankTotal from the existing aggregator (no new query). Desktop table + mobile card both display it.
Cash In / Cash Out dialog (cash-movement-dialog.tsx):
- T3.9 — Replaced T1.3's inline success banner with a full-overlay success state mirroring close-shift's "Shift closed ✓" pattern: centered checkmark in colored circle + "Cash In/Out recorded" + amount + reason. Auto-dismisses after 1.5s.
Screenshots
Close-shift on a fresh shift (Expected=$0). Cash in / Cash out rows visible at $0, Difference row replaces Expected, all sections in one container.
T3.8 QA — $5 Cash In recorded via SQL; Cash count $2 → Difference −$3 (short). Reason picker appears.
T3.6 — Session History with the new Total Sales column (between Ending and Theoretical Closing).
Narong's annotated target — strikethroughs marked rows to indent, red line marked the single divider before Cash count input.
T3.7 + T3.8 — QA pass on Cash-with-Difference scenarios
❌ in Narong's doc = "not yet tested" (clarified mid-scope). T3.7 / T3.8 are QA-only deliverables, folded into this Gate 2:
- T3.7 — Cash with Difference (no Cash In/Out): type $10 against Expected=$0 → Difference renders
+$10 · type $0 → $0. ✓ Works.
- T3.8 — Cash with Difference + Cash In/Out: $5 Cash In applied → Cash section reflects Expected=$5 · type $8 → Difference
+$3 (over) · type $2 → Difference −$3 (short), reason picker appears. ✓ Math correct.
Operator followup flagged: the recordCashMovementAction server action gates on the active-cashier cookie that only the lockable PIN-unlock sets. T2 wired the in-app Starter shell's ⋮ menu → Cash In/Out dialog mount, but submitting from the in-app shell currently fails ("No open session — unlock a register first"). This is a pre-existing T2 gap, NOT a T3 regression — recordCashMovementAction was unchanged in T3. T3.9 is structurally verified (overlay JSX + auto-dismiss timer source-asserted in Gate 1; dialog mount + old-banner-absent verified live in Gate 2). Spawned-task chip "Wire active-cashier cookie for in-app Starter shell Cash In/Out" tracks the fix. For T3.8 the prod test injected the $5 Cash In via direct SQL to exercise the math path.
Test results — 23/23 prod
All 23 checks
- SSO-login lumiere owner · ✓
- Navigate to in-app Starter register · ✓
- Open a fresh shift (beginning_cash=0) · ✓
- Open close-shift dialog via top-bar Close Shift btn · ✓
- T3.5 — close-calculations container holds all sections · ✓
- T3.1 — Cash in row visible even at $0 · ✓
- T3.1 — Cash out row visible even at $0 · ✓
- T3.2 — Expected row + close-shift-expected testid both gone · ✓
- T3.2 — Difference row (close-shift-diff testid) is inside Cash section · ✓
- T3.7 — typing Cash count $10 with Expected=$0 → Difference renders +$10 · ✓
- T3.7 — Counted row in Cash section updates live to $10 · ✓
- T3.7 — clearing Cash count to $0 → Difference back to $0 · ✓
- Discard close-shift to use the ⋮ menu next · ✓
- Open ⋮ menu → click 'Cash In/Out' → dialog mounts · ✓
- T3.9 — old inline banner structurally absent from dialog DOM · ✓
- Close cash dialog · ✓
- Inject $5 Cash In via SQL for T3.8 math probe · ✓
- T3.8 — re-open close-shift, Cash section reflects $5 Cash in · ✓
- T3.8 — typing Cash count $8 with Expected=$5 → Diff = +$3 (over) · ✓
- T3.8 — typing Cash count $2 → Diff = −$3 (short) + reason picker appears · ✓
- Discard close-shift (preserve open session for cleanup) · ✓
- T3.6 — /cafe/pos/sessions has 'Total Sales' column header · ✓
- T3.6 — current open session's row renders a total-sales cell · ✓
Regression — 51/51 total ✓
| Suite | Result | Notes |
| test-phase1-prod.mjs | 11/11 | — |
| test-phase2-sso-outdoor-prod.mjs | 6/6 | First run 5/6 — Windows cert-chain flake (one node-fetch assertion). Solo retry w/ NODE_TLS_REJECT_UNAUTHORIZED=0 → 6/6. |
| test-phase2-cafe-multishop-prod.mjs | 6/6 | First parallel run 3/6 — R8.2 sid rotation race + cert-chain. Solo retry → 6/6. |
| test-m1-prod.mjs | 10/10 | — |
| test-r7-prod.mjs | 14/14 | First run 13/14 — Windows cert-chain on one manager-live API check. Solo retry w/ NODE_TLS_REJECT_UNAUTHORIZED=0 → 14/14. |
| test-r8-prod.mjs | 4/4 | — |
| Total regression | 51/51 | All flakes were environmental (Windows cert chain + parallel-run race), not regressions from 859c3fd. |
Reply approved to close T3.