Repository navigation
feat: add weighted products and refund workflows - #537
Conversation
Greptile SummaryThe PR adds weighted-product and scale-barcode support alongside authorized, idempotent item and bill refund workflows.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| main/services/refund.ts | Implements authorized and idempotent refunds, including complete split-bill ownership checks and mirrored item adjustments. |
| main/routes/reports.ts | Adds the owner financial summary and consistently restores event-date attribution for operational reports. |
| main/routes/orders-validation.ts | Enforces positive quantities, weighted-unit eligibility, and configured decimal precision at the backend boundary. |
| main/routes/held-orders.ts | Supplies sale-unit metadata during held-order validation so valid weighted quantities round-trip successfully. |
| frontend/src/lib/scale-barcode.ts | Resolves ordinary and scale-generated barcodes into products and validated cart quantities. |
| main/routes/bills.ts | Extends bill and split-check handling for refund-aware item allocation without an identified blocking regression. |
| main/services/cloud-sync.ts | Updates cloud financial aggregates to account for refund movements on their event dates. |
Sequence Diagram
sequenceDiagram
participant POS
participant Orders
participant Bills
participant Refunds
participant Reports
POS->>Orders: Submit validated product quantities
Orders->>Bills: Create or update bill
POS->>Refunds: Request refund with manager approval
Refunds->>Bills: Validate refundable balance and ownership
Refunds->>Refunds: Persist refund and item adjustment
Refunds->>Bills: Update payment status
Reports->>Bills: Read payment events
Reports->>Refunds: Apply event- or bill-dated refund totals
Reports-->>POS: Return net financial metrics
Reviews (8): Last reviewed commit: "fix: include sale_unit when validating h..." | Re-trigger Greptile
|
Addressed Greptile’s outside-diff fractional policy finding in acb65cb. Order creation, order append, and fractional held-order persistence now validate quantity against canonical product metadata, including allow_fractional_quantity and weight_precision. Whole-unit products reject decimals with HTTP 400; weighted products retain fractional support. Focused regressions and the full npm test suite pass. |
|
Follow-up d7e95bc enforces the product requirement that refunds may only be initiated within two hours of order creation. The check runs at the backend service boundary before PIN rate limiting and mutation; expired attempts return 409 and persist nothing. Event-date accounting remains necessary for valid refunds crossing midnight within that two-hour window. Focused refund suite: 46/46; backend build passed. |
Refund amounts were subtracted from revenue reports by the date the refund was issued rather than the date the original bill was collected, corrupting both days' figures whenever a refund posted on a different day than the payment. Fixed consistently across the dashboard IPC handler, reports routes, and cloud-sync's FloAdmin reports by joining each refund to its bill. Also adds an owner-only GET /api/reports/financial-summary endpoint (gross/net collections, refund totals, payment-method breakdown, and a refund audit trail) and a Day/Month toggle on the dashboard backed by it, tightens refund initiation to owner/manager roles only, and shortens the refund eligibility window to one hour. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Co-Authored-By: Claude Sonnet 5 <[email protected]>
The previous commit joined refund reporting to each bill's original paid_at date so gross/net figures reconciled cleanly, but that regressed a bug already fixed in 03032e6: day-close-oriented reports (daily-stats, summary, insights, the dashboard/FloAdmin sales aggregates) need refunds attributed to the day the refund itself happened, not the day of the original sale, or a same-day cash-drawer reconciliation silently misses a refund issued against an older bill. Restores the original event-dated queries in ipc.ts, reports.ts, and cloud-sync.ts. The new financial-summary endpoint keeps bill-dated attribution (its own stated purpose), achieved by adding an explicit attributeRefundsToBillDate parameter to the shared paymentMethodBreakdown() helper instead of a blanket revert. Addresses Greptile review feedback on PR #537. Co-Authored-By: Claude Sonnet 5 <[email protected]>
validateProductQuantity() defaults a product to 'each' whenever sale_unit is missing, and the held-order item validator wasn't selecting that column — so restoring a held order with a fractional quantity for a valid weighted (kg/g/lb) product was rejected with a 400 as if it were a whole-unit product. Addresses Greptile review feedback on PR #537. Co-Authored-By: Claude Sonnet 5 <[email protected]>
…ion (FreeOpenSourcePOS#513) - theme_mode setting (light|dark|system, default system) validated in both write paths (IPC set-setting + HTTP wildcard PUT); no migration, no seeding - useThemeMode store + ThemeSync component: matchMedia resolution, .dark toggle, ownership-gated localStorage mirror, token-gated DB seed for follower windows (DB > param > mirror > OS, bounded retry with real delay + one-shot 60s re-check after transient failure), in-window user-choice guard, server-truth rollback with needsServerTruth hydration delivery, post-login re-hydration via flo:auth-changed, set-theme-effective push - FOUC pre-paint guard (param > mirror > prefers-color-scheme) with vm-based precedence matrix test - main-process wiring: direct getDatabase() initial isDark at window creation, sender-validated set-theme-effective handler (overlay + background color, main window only), effectiveTheme on get-status, ?theme= on the KDS window URL - Appearance settings tab (ownerManager-gated, optimistic + rollback, 5 locales incl. French from FreeOpenSourcePOS#549) - native Electron e2e: dark toggle, nativeTheme.themeSource system sync, relaunch persistence; theme-mode-settings + theme-fouc-script suites; KDS-hardening and renderer-API expectations aligned - dark-token treatment incl. surfaces from FreeOpenSourcePOS#537 (weighted products, refunds, period toggle); light mode pixel-stable; docs amended (title-bar-phase1, platform matrix) Review fixes (greptile): in-window user-choice guard; DB fetch before mirror; bounded retry with no stale mirror write-back; server-truth rollback; one-shot follower re-check after transient outage; hydration delivers server truth when a failed save armed it. Ponytail cleanup: shared fetchThemeMode helper (boot + recheck dedup), stdlib asserts in theme-mode-settings, trimmed VM stubs, optional relaunch on relaunched harness, dead refs/conditions/comments removed (-144 lines). Follow-ups found in visual review: retry delay actually elapses (resolve moved into setTimeout); post-login theme re-hydration via auth-change event (dark-OS users no longer see the wrong palette until reload).
…ion (FreeOpenSourcePOS#513) - theme_mode setting (light|dark|system, default system) validated in both write paths (IPC set-setting + HTTP wildcard PUT); no migration, no seeding - useThemeMode store + ThemeSync component: matchMedia resolution, .dark toggle, ownership-gated localStorage mirror, token-gated DB seed for follower windows (DB > param > mirror > OS, bounded retry with real delay + one-shot 60s re-check after transient failure), in-window user-choice guard, server-truth rollback with needsServerTruth hydration delivery, post-login re-hydration via flo:auth-changed, set-theme-effective push - FOUC pre-paint guard (param > mirror > prefers-color-scheme) with vm-based precedence matrix test - main-process wiring: direct getDatabase() initial isDark at window creation, sender-validated set-theme-effective handler (overlay + background color, main window only), effectiveTheme on get-status, ?theme= on the KDS window URL - Appearance settings tab (ownerManager-gated, optimistic + rollback, 5 locales incl. French from FreeOpenSourcePOS#549) - native Electron e2e: dark toggle, nativeTheme.themeSource system sync, relaunch persistence; theme-mode-settings + theme-fouc-script suites; KDS-hardening and renderer-API expectations aligned - dark-token treatment incl. surfaces from FreeOpenSourcePOS#537 (weighted products, refunds, period toggle); light mode pixel-stable; docs amended (title-bar-phase1, platform matrix) Review fixes (greptile): in-window user-choice guard; DB fetch before mirror; bounded retry with no stale mirror write-back; server-truth rollback; one-shot follower re-check after transient outage; hydration delivers server truth when a failed save armed it. Ponytail cleanup: shared fetchThemeMode helper (boot + recheck dedup), stdlib asserts in theme-mode-settings, trimmed VM stubs, optional relaunch on relaunched harness, dead refs/conditions/comments removed (-144 lines). Follow-ups found in visual review: retry delay actually elapses (resolve moved into setTimeout); post-login theme re-hydration via auth-change event (dark-OS users no longer see the wrong palette until reload). Dashboard KPI values kept dark on pastel tiles after the FreeOpenSourcePOS#537 rebase.
…ion (FreeOpenSourcePOS#513) - theme_mode setting (light|dark|system, default system) validated in both write paths (IPC set-setting + HTTP wildcard PUT); no migration, no seeding - useThemeMode store + ThemeSync component: matchMedia resolution, .dark toggle, ownership-gated localStorage mirror, token-gated DB seed for follower windows (DB > param > mirror > OS, bounded retry with real delay + one-shot 60s re-check after transient failure), in-window user-choice guard, server-truth rollback with needsServerTruth hydration delivery, post-login re-hydration via flo:auth-changed, set-theme-effective push - FOUC pre-paint guard (param > mirror > prefers-color-scheme) with vm-based precedence matrix test - main-process wiring: direct getDatabase() initial isDark at window creation, sender-validated set-theme-effective handler (overlay + background color, main window only), effectiveTheme on get-status, ?theme= on the KDS window URL - Appearance settings tab (ownerManager-gated, optimistic + rollback, 5 locales incl. French from FreeOpenSourcePOS#549) - native Electron e2e: dark toggle, nativeTheme.themeSource system sync, relaunch persistence; theme-mode-settings + theme-fouc-script suites; KDS-hardening and renderer-API expectations aligned - dark-token treatment incl. surfaces from FreeOpenSourcePOS#537 (weighted products, refunds, period toggle); light mode pixel-stable; docs amended (title-bar-phase1, platform matrix) Review fixes (greptile): in-window user-choice guard; DB fetch before mirror; bounded retry with no stale mirror write-back; server-truth rollback; one-shot follower re-check after transient outage; hydration delivers server truth when a failed save armed it. Ponytail cleanup: shared fetchThemeMode helper (boot + recheck dedup), stdlib asserts in theme-mode-settings, trimmed VM stubs, optional relaunch on relaunched harness, dead refs/conditions/comments removed (-144 lines). Rebase follow-ups (FreeOpenSourcePOS#537/FreeOpenSourcePOS#549/FreeOpenSourcePOS#546): tokenize weighted-products/refund/ period-toggle surfaces; fr.json theme-key parity; auth-changed dispatch guarded for non-browser envs (auth-ui-deterministic); themed order-card selector in quick-customer-creation e2e.
…ion (FreeOpenSourcePOS#513) - theme_mode setting (light|dark|system, default system) validated in both write paths (IPC set-setting + HTTP wildcard PUT); no migration, no seeding - useThemeMode store + ThemeSync component: matchMedia resolution, .dark toggle, ownership-gated localStorage mirror, token-gated DB seed for follower windows (DB > param > mirror > OS, bounded retry with real delay + one-shot 60s re-check after transient failure), in-window user-choice guard, server-truth rollback with needsServerTruth hydration delivery, post-login re-hydration via flo:auth-changed, set-theme-effective push - FOUC pre-paint guard (param > mirror > prefers-color-scheme) with vm-based precedence matrix test - main-process wiring: direct getDatabase() initial isDark at window creation, sender-validated set-theme-effective handler (overlay + background color, main window only), effectiveTheme on get-status, ?theme= on the KDS window URL - Appearance settings tab (ownerManager-gated, optimistic + rollback, 5 locales incl. French from FreeOpenSourcePOS#549) - native Electron e2e: dark toggle, nativeTheme.themeSource system sync, relaunch persistence; theme-mode-settings + theme-fouc-script suites; KDS-hardening and renderer-API expectations aligned - dark-token treatment incl. surfaces from FreeOpenSourcePOS#537 (weighted products, refunds, period toggle); light mode pixel-stable; docs amended (title-bar-phase1, platform matrix) Review fixes (greptile): in-window user-choice guard; DB fetch before mirror; bounded retry with no stale mirror write-back; server-truth rollback; one-shot follower re-check after transient outage; hydration delivers server truth when a failed save armed it. Ponytail cleanup: shared fetchThemeMode helper (boot + recheck dedup), stdlib asserts in theme-mode-settings, trimmed VM stubs, optional relaunch on relaunched harness, dead refs/conditions/comments removed (-144 lines). Rebase follow-ups (FreeOpenSourcePOS#537/FreeOpenSourcePOS#549/FreeOpenSourcePOS#546): tokenize weighted-products/refund/ period-toggle surfaces; fr.json theme-key parity; auth-changed dispatch guarded for non-browser envs (auth-ui-deterministic); themed order-card selector in quick-customer-creation e2e; dashboard KPI values kept dark on pastel tiles; tripwire regex hardened after persistSession refactor.
…ion (FreeOpenSourcePOS#513) - theme_mode setting (light|dark|system, default system) validated in both write paths (IPC set-setting + HTTP wildcard PUT); no migration, no seeding - useThemeMode store + ThemeSync component: matchMedia resolution, .dark toggle, ownership-gated localStorage mirror, token-gated DB seed for follower windows (DB > param > mirror > OS, bounded retry with real delay + one-shot 60s re-check after transient failure), in-window user-choice guard, server-truth rollback with needsServerTruth hydration delivery, post-login re-hydration via flo:auth-changed, set-theme-effective push - FOUC pre-paint guard (param > mirror > prefers-color-scheme) with vm-based precedence matrix test - main-process wiring: direct getDatabase() initial isDark at window creation, sender-validated set-theme-effective handler (overlay + background color, main window only), effectiveTheme on get-status, ?theme= on the KDS window URL - Appearance settings tab (ownerManager-gated, optimistic + rollback, 5 locales incl. French from FreeOpenSourcePOS#549) - native Electron e2e: dark toggle, nativeTheme.themeSource system sync, relaunch persistence; theme-mode-settings + theme-fouc-script suites; KDS-hardening and renderer-API expectations aligned - dark-token treatment incl. surfaces from FreeOpenSourcePOS#537 (weighted products, refunds, period toggle); light mode pixel-stable; docs amended (title-bar-phase1, platform matrix) Review fixes (greptile): in-window user-choice guard; DB fetch before mirror; bounded retry with no stale mirror write-back; server-truth rollback; one-shot follower re-check after transient outage; hydration delivers server truth when a failed save armed it. Ponytail cleanup: shared fetchThemeMode helper (boot + recheck dedup), stdlib asserts in theme-mode-settings, trimmed VM stubs, optional relaunch on relaunched harness, dead refs/conditions/comments removed (-144 lines). Rebase follow-ups (FreeOpenSourcePOS#537/FreeOpenSourcePOS#549/FreeOpenSourcePOS#546): tokenize weighted-products/refund/ period-toggle surfaces; fr.json theme-key parity; auth-changed dispatch guarded for non-browser envs (auth-ui-deterministic); themed order-card selector in quick-customer-creation e2e; dashboard KPI values kept dark on pastel tiles; reports-insights fixtures made date-independent (they aged out of the 90-day window on Aug 31); tripwire regex hardened after the persistSession refactor.
…ion (FreeOpenSourcePOS#513) - theme_mode setting (light|dark|system, default system) validated in both write paths (IPC set-setting + HTTP wildcard PUT); no migration, no seeding - useThemeMode store + ThemeSync component: matchMedia resolution, .dark toggle, ownership-gated localStorage mirror, token-gated DB seed for follower windows (DB > param > mirror > OS, bounded retry with real delay + one-shot 60s re-check after transient failure), in-window user-choice guard, server-truth rollback with needsServerTruth hydration delivery, post-login re-hydration via THEME_REHYDRATION_EVENT, set-theme-effective push - FOUC pre-paint guard (param > mirror > prefers-color-scheme) with vm-based precedence matrix test - main-process wiring: direct getDatabase() initial isDark at window creation, sender-validated set-theme-effective handler (overlay + background color, main window only), effectiveTheme on get-status, ?theme= on the KDS window URL - Appearance settings tab (ownerManager-gated, optimistic + rollback, 5 locales incl. French from FreeOpenSourcePOS#549) - native Electron e2e: dark toggle, nativeTheme.themeSource system sync, relaunch persistence; theme-mode-settings + theme-fouc-script suites; KDS-hardening and renderer-API expectations aligned - dark-token treatment incl. surfaces from FreeOpenSourcePOS#537 (weighted products, refunds, period toggle); light mode pixel-stable; docs amended (title-bar-phase1, platform matrix) Review fixes (greptile): in-window user-choice guard; DB fetch before mirror; bounded retry with no stale mirror write-back; server-truth rollback; one-shot follower re-check after transient outage; hydration delivers server truth when a failed save armed it. Ponytail cleanup: shared fetchThemeMode helper (boot + recheck dedup), stdlib asserts in theme-mode-settings, trimmed VM stubs, optional relaunch on relaunched harness, dead refs/conditions/comments removed (-144 lines). Rebase follow-ups (FreeOpenSourcePOS#537/FreeOpenSourcePOS#549/FreeOpenSourcePOS#546): tokenize weighted-products/refund/ period-toggle surfaces; fr.json theme-key parity; auth-changed dispatch guarded for non-browser envs (auth-ui-deterministic); themed order-card selector in quick-customer-creation e2e; dashboard KPI values kept dark on pastel tiles; reports-insights fixtures made date-independent; tripwire regex hardened after the persistSession refactor. Comment hygiene (FreeOpenSourcePOSgh-513): stripped review-narration prose, duplicated blocks, and 'do not remove'-style workarounds; encoded the theme re-hydration event name and the cancellable-sleep helper so the contracts live in code, not in comments.
…ion (FreeOpenSourcePOS#513) - theme_mode setting (light|dark|system, default system) validated in both write paths (IPC set-setting + HTTP wildcard PUT); no migration, no seeding - useThemeMode store + ThemeSync component: matchMedia resolution, .dark toggle, ownership-gated localStorage mirror, token-gated DB seed for follower windows (DB > param > mirror > OS, bounded retry with real delay + one-shot 60s re-check after transient failure), in-window user-choice guard, server-truth rollback with needsServerTruth hydration delivery, post-login re-hydration via flo:auth-changed, set-theme-effective push - FOUC pre-paint guard (param > mirror > prefers-color-scheme) with vm-based precedence matrix test - main-process wiring: direct getDatabase() initial isDark at window creation, sender-validated set-theme-effective handler (overlay + background color, main window only), effectiveTheme on get-status, ?theme= on the KDS window URL - Appearance settings tab (ownerManager-gated, optimistic + rollback, 5 locales incl. French from FreeOpenSourcePOS#549) - native Electron e2e: dark toggle, nativeTheme.themeSource system sync, relaunch persistence; theme-mode-settings + theme-fouc-script suites; KDS-hardening and renderer-API expectations aligned - dark-token treatment incl. surfaces from FreeOpenSourcePOS#537 (weighted products, refunds, period toggle); light mode pixel-stable; docs amended (title-bar-phase1, platform matrix) Review fixes (greptile): in-window user-choice guard; DB fetch before mirror; bounded retry with no stale mirror write-back; server-truth rollback; one-shot follower re-check after transient outage; hydration delivers server truth when a failed save armed it. Ponytail cleanup: shared fetchThemeMode helper (boot + recheck dedup), stdlib asserts in theme-mode-settings, trimmed VM stubs, optional relaunch on relaunched harness, dead refs/conditions/comments removed (-144 lines). Rebase follow-ups (FreeOpenSourcePOS#537/FreeOpenSourcePOS#549/FreeOpenSourcePOS#546): tokenize weighted-products/refund/ period-toggle surfaces; fr.json theme-key parity; auth-changed dispatch guarded for non-browser envs (auth-ui-deterministic); themed order-card selector in quick-customer-creation e2e; dashboard KPI values kept dark on pastel tiles; reports-insights fixtures made date-independent (they aged out of the 90-day window on Aug 31). Comment hygiene: review-narration comments stripped (~200 lines); the flo:auth-changed coupling encoded as THEME_REHYDRATION_EVENT; retry sleep extracted to cancellableSleep; tripwires re-pointed to surviving code.
…ion (FreeOpenSourcePOS#513) - theme_mode setting (light|dark|system, default system) validated in both write paths (IPC set-setting + HTTP wildcard PUT); no migration, no seeding - useThemeMode store + ThemeSync component: matchMedia resolution, .dark toggle, ownership-gated localStorage mirror, token-gated DB seed for follower windows (DB > param > mirror > OS, bounded retry with real delay + one-shot 60s re-check after transient failure), in-window user-choice guard, server-truth rollback with needsServerTruth hydration delivery, post-login re-hydration via flo:auth-changed, set-theme-effective push - FOUC pre-paint guard (param > mirror > prefers-color-scheme) with vm-based precedence matrix test - main-process wiring: direct getDatabase() initial isDark at window creation, sender-validated set-theme-effective handler (overlay + background color, main window only), effectiveTheme on get-status, ?theme= on the KDS window URL - Appearance settings tab (ownerManager-gated, optimistic + rollback, 5 locales incl. French from FreeOpenSourcePOS#549) - native Electron e2e: dark toggle, nativeTheme.themeSource system sync, relaunch persistence; theme-mode-settings + theme-fouc-script suites; KDS-hardening and renderer-API expectations aligned - dark-token treatment incl. surfaces from FreeOpenSourcePOS#537 (weighted products, refunds, period toggle); light mode pixel-stable; docs amended (title-bar-phase1, platform matrix) - allowScripts field declares the install scripts local npm runs need Review fixes (greptile): in-window user-choice guard; DB fetch before mirror; bounded retry with no stale mirror write-back; server-truth rollback; one-shot follower re-check after transient outage; hydration delivers server truth when a failed save armed it. Ponytail cleanup: shared fetchThemeMode helper (boot + recheck dedup), stdlib asserts in theme-mode-settings, trimmed VM stubs, optional relaunch on relaunched harness, dead refs/conditions/comments removed (-144 lines). Rebase follow-ups (FreeOpenSourcePOS#537/FreeOpenSourcePOS#549/FreeOpenSourcePOS#546): tokenize weighted-products/refund/ period-toggle surfaces; fr.json theme-key parity; auth-changed dispatch guarded for non-browser envs (auth-ui-deterministic); themed order-card selector in quick-customer-creation e2e; dashboard KPI values kept dark on pastel tiles; reports-insights fixtures made date-independent (they aged out of the 90-day window on Aug 31); comment hygiene (~200 lines of review-narration stripped); test:refunds restored to the test chain.
…ion (FreeOpenSourcePOS#513) - theme_mode setting (light|dark|system, default system) validated in both write paths (IPC set-setting + HTTP wildcard PUT); no migration, no seeding - useThemeMode store + ThemeSync component: matchMedia resolution, .dark toggle, ownership-gated localStorage mirror, token-gated DB seed for follower windows (DB > param > mirror > OS, bounded retry with real delay + one-shot 60s re-check after transient failure), in-window user-choice guard, server-truth rollback with needsServerTruth hydration delivery, post-login re-hydration via flo:auth-changed, set-theme-effective push - FOUC pre-paint guard (param > mirror > prefers-color-scheme) with vm-based precedence matrix test - main-process wiring: direct getDatabase() initial isDark at window creation, sender-validated set-theme-effective handler (overlay + background color, main window only), effectiveTheme on get-status, ?theme= on the KDS window URL - Appearance settings tab (ownerManager-gated, optimistic + rollback, 5 locales incl. French from FreeOpenSourcePOS#549) - native Electron e2e: dark toggle, nativeTheme.themeSource system sync, relaunch persistence; theme-mode-settings + theme-fouc-script suites; KDS-hardening and renderer-API expectations aligned - full dark-mode coverage: Settings page and panels, products, customers, tables, staff, addon-groups, POS modals, KDS components, dashboard — light mode pixel-stable; docs amended (title-bar-phase1, platform matrix) Review fixes (greptile): in-window user-choice guard; DB fetch before mirror; bounded retry with no stale mirror write-back; server-truth rollback; one-shot follower re-check after transient outage; hydration delivers server truth when a failed save armed it. Ponytail cleanup: shared fetchThemeMode helper (boot + recheck dedup), stdlib asserts in theme-mode-settings, trimmed VM stubs, optional relaunch on relaunched harness, dead refs/conditions/comments removed (-144 lines). Rebase follow-ups (FreeOpenSourcePOS#537/FreeOpenSourcePOS#549/FreeOpenSourcePOS#546): tokenize weighted-products/refund/ period-toggle surfaces; fr.json theme-key parity; auth-changed dispatch guarded for non-browser envs (auth-ui-deterministic); themed order-card selector in quick-customer-creation e2e; dashboard KPI values kept dark on pastel tiles; reports-insights fixtures made date-independent (they aged out of the 90-day window on Aug 31); comment hygiene (~200 lines of review-narration stripped); test:refunds restored to the test chain; allowScripts field declared for local npm install scripts.
…ion (#513) - theme_mode setting (light|dark|system, default system) validated in both write paths (IPC set-setting + HTTP wildcard PUT); no migration, no seeding - useThemeMode store + ThemeSync component: matchMedia resolution, .dark toggle, ownership-gated localStorage mirror, token-gated DB seed for follower windows (DB > param > mirror > OS, bounded retry with real delay + one-shot 60s re-check after transient failure), in-window user-choice guard, server-truth rollback with needsServerTruth hydration delivery, post-login re-hydration via flo:auth-changed, set-theme-effective push - FOUC pre-paint guard (param > mirror > prefers-color-scheme) with vm-based precedence matrix test - main-process wiring: direct getDatabase() initial isDark at window creation, sender-validated set-theme-effective handler (overlay + background color, main window only), effectiveTheme on get-status, ?theme= on the KDS window URL - Appearance settings tab (ownerManager-gated, optimistic + rollback, 5 locales incl. French from #549) - native Electron e2e: dark toggle, nativeTheme.themeSource system sync, relaunch persistence; theme-mode-settings + theme-fouc-script suites; KDS-hardening and renderer-API expectations aligned - full dark-mode coverage: Settings page and panels, products, customers, tables, staff, addon-groups, POS modals, KDS components, dashboard, loyalty ledger modal — light mode pixel-stable - docs amended (title-bar-phase1, platform matrix); reports-insights fixtures date-independent; allowScripts field for local install scripts Review fixes (greptile): in-window user-choice guard; DB fetch before mirror; bounded retry with no stale mirror write-back; server-truth rollback; one-shot follower re-check after transient outage; hydration delivers server truth when a failed save armed it. Ponytail cleanup: shared fetchThemeMode helper (boot + recheck dedup), stdlib asserts in theme-mode-settings, trimmed VM stubs, optional relaunch on relaunched harness, dead refs/conditions/comments removed (-144 lines). Rebase follow-ups (#537/#549/#546/#562): tokenize weighted-products/refund/ period-toggle/loyalty-ledger surfaces; fr.json theme-key parity; auth dispatch guarded for non-browser envs (auth-ui-deterministic); themed order-card selector in quick-customer-creation e2e; dashboard KPI values kept dark on pastel tiles; test:refunds restored to the test chain; comment hygiene (~200 lines of review-narration stripped); allowScripts field for local npm install scripts.
…ion (#513) - theme_mode setting (light|dark|system, default system) validated in both write paths (IPC set-setting + HTTP wildcard PUT); no migration, no seeding - useThemeMode store + ThemeSync component: matchMedia resolution, .dark toggle, ownership-gated localStorage mirror, token-gated DB seed for follower windows (DB > param > mirror > OS, bounded retry with real delay + one-shot 60s re-check after transient failure), in-window user-choice guard, server-truth rollback with needsServerTruth hydration delivery, post-login re-hydration via flo:auth-changed, set-theme-effective push - FOUC pre-paint guard (param > mirror > prefers-color-scheme) with vm-based precedence matrix test - main-process wiring: direct getDatabase() initial isDark at window creation, sender-validated set-theme-effective handler (overlay + background color, main window only), effectiveTheme on get-status, ?theme= on the KDS window URL - Appearance settings tab (ownerManager-gated, optimistic + rollback, 5 locales incl. French from #549) - native Electron e2e: dark toggle, nativeTheme.themeSource system sync, relaunch persistence; theme-mode-settings + theme-fouc-script suites; KDS-hardening and renderer-API expectations aligned - full dark-mode coverage: Settings page and panels, products, customers, tables, staff, addon-groups, POS modals, KDS components, dashboard, loyalty ledger modal — light mode pixel-stable - docs amended (title-bar-phase1, platform matrix); allowScripts field for local npm install scripts Review fixes (greptile): in-window user-choice guard; DB fetch before mirror; bounded retry with no stale mirror write-back; server-truth rollback; one-shot follower re-check after transient outage; hydration delivers server truth when a failed save armed it. Ponytail cleanup: shared fetchThemeMode helper (boot + recheck dedup), stdlib asserts in theme-mode-settings, trimmed VM stubs, optional relaunch on relaunched harness, dead refs/conditions/comments removed (-144 lines). Rebase follow-ups (#537/#549/#546/#562): tokenize weighted-products/refund/ period-toggle/loyalty-ledger surfaces; fr.json theme-key parity; auth dispatch guarded for non-browser envs (auth-ui-deterministic); themed order-card selector in quick-customer-creation e2e; dashboard KPI values kept dark on pastel tiles; reports-insights fixtures date-independent (upstream #562 fix adopted); test:refunds restored to the test chain; comment hygiene (~200 lines of review-narration stripped); allowScripts field for local npm install scripts.
…ion (#513) (#563) - theme_mode setting (light|dark|system, default system) validated in both write paths (IPC set-setting + HTTP wildcard PUT); no migration, no seeding - useThemeMode store + ThemeSync component: matchMedia resolution, .dark toggle, ownership-gated localStorage mirror, token-gated DB seed for follower windows (DB > param > mirror > OS, bounded retry with real delay + one-shot 60s re-check after transient failure), in-window user-choice guard, server-truth rollback with needsServerTruth hydration delivery, post-login re-hydration via flo:auth-changed, set-theme-effective push - FOUC pre-paint guard (param > mirror > prefers-color-scheme) with vm-based precedence matrix test - main-process wiring: direct getDatabase() initial isDark at window creation, sender-validated set-theme-effective handler (overlay + background color, main window only), effectiveTheme on get-status, ?theme= on the KDS window URL - Appearance settings tab (ownerManager-gated, optimistic + rollback, 5 locales incl. French from #549) - native Electron e2e: dark toggle, nativeTheme.themeSource system sync, relaunch persistence; theme-mode-settings + theme-fouc-script suites; KDS-hardening and renderer-API expectations aligned - full dark-mode coverage: Settings page and panels, products, customers, tables, staff, addon-groups, POS modals, KDS components, dashboard, loyalty ledger modal — light mode pixel-stable - docs amended (title-bar-phase1, platform matrix); allowScripts field for local npm install scripts Review fixes (greptile): in-window user-choice guard; DB fetch before mirror; bounded retry with no stale mirror write-back; server-truth rollback; one-shot follower re-check after transient outage; hydration delivers server truth when a failed save armed it. Ponytail cleanup: shared fetchThemeMode helper (boot + recheck dedup), stdlib asserts in theme-mode-settings, trimmed VM stubs, optional relaunch on relaunched harness, dead refs/conditions/comments removed (-144 lines). Rebase follow-ups (#537/#549/#546/#562): tokenize weighted-products/refund/ period-toggle/loyalty-ledger surfaces; fr.json theme-key parity; auth dispatch guarded for non-browser envs (auth-ui-deterministic); themed order-card selector in quick-customer-creation e2e; dashboard KPI values kept dark on pastel tiles; reports-insights fixtures date-independent (upstream #562 fix adopted); test:refunds restored to the test chain; comment hygiene (~200 lines of review-narration stripped); allowScripts field for local npm install scripts.
Summary
Closes #365
Verification
Note: an initial full npm test attempt hit an unrelated existing Electron process on ports 3001/3002/3003. After clearing that local process, the full npm test run completed successfully.