Skip to content

feat: add weighted products and refund workflows - #537

Merged
itsbkm merged 8 commits into
mainfrom
codex/weighted-products-refunds
Aug 30, 2026
Merged

itsbkm merged 8 commits into
mainfrom
codex/weighted-products-refunds

Conversation

@itsbkm

@itsbkm itsbkm commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add weighted product metadata, validation, and product-management controls for sale units, fractional quantities, and weight precision
  • add default scale-generated barcode parsing for issue Feature: Weighted products & scale-generated barcodes (electronic scale, stage 1) #365 and wire scans into POS/product-grid add-to-cart flows
  • allow held orders to round-trip fractional quantities
  • add refund persistence, idempotency, authorization, item/bill refund flows, and exclude refunded items from active KDS/order/bill math

Closes #365

Verification

  • npm run lint
  • npm run build
  • npm run build:frontend
  • npm run i18n:check
  • npm test
  • git diff --check
  • npx ts-node --transpile-only -P tests/tsconfig.json tests/issue-365-scale-barcode.test.ts
  • node tests/run-electron-node-test.cjs tests/issue-137-barcode.test.ts
  • node tests/run-electron-node-test.cjs tests/held-orders.test.ts
  • node tests/run-electron-node-test.cjs tests/schema-health.test.ts
  • node tests/run-electron-node-test.cjs tests/refunds.test.ts

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.

@greptile-apps

greptile-apps Bot commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR adds weighted-product and scale-barcode support alongside authorized, idempotent item and bill refund workflows.

  • Validates weighted and fractional quantities across products, orders, and held orders.
  • Parses scale-generated barcodes and adds resolved quantities to POS carts.
  • Persists refunds and excludes refunded items from active kitchen and billing calculations.
  • Adds refund-aware reporting, cloud aggregates, and an owner financial-summary dashboard.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

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
Loading

Reviews (8): Last reviewed commit: "fix: include sale_unit when validating h..." | Re-trigger Greptile

Comment thread main/services/refund.ts Resolved
Comment thread main/services/refund.ts Resolved
@itsbkm

itsbkm commented Aug 28, 2026

Copy link
Copy Markdown
Contributor Author

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.

Comment thread main/routes/reports.ts Resolved
Comment thread main/routes/orders-validation.ts Resolved
@itsbkm

itsbkm commented Aug 28, 2026

Copy link
Copy Markdown
Contributor Author

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.

itsbkm and others added 2 commits August 31, 2026 02:13
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]>
Comment thread main/routes/reports.ts Resolved
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]>
Comment thread main/routes/held-orders.ts Resolved
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]>
@itsbkm
itsbkm merged commit 76db842 into main Aug 30, 2026
15 checks passed
@itsbkm
itsbkm deleted the codex/weighted-products-refunds branch August 30, 2026 21:12
carvalab added a commit to carvalab/FloCafe that referenced this pull request Aug 31, 2026
…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).
carvalab pushed a commit to carvalab/FloCafe that referenced this pull request Aug 31, 2026
…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.
carvalab added a commit to carvalab/FloCafe that referenced this pull request Aug 31, 2026
…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.
carvalab added a commit to carvalab/FloCafe that referenced this pull request Aug 31, 2026
…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.
carvalab added a commit to carvalab/FloCafe that referenced this pull request Aug 31, 2026
…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.
carvalab added a commit to carvalab/FloCafe that referenced this pull request Aug 31, 2026
…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.
carvalab added a commit to carvalab/FloCafe that referenced this pull request Aug 31, 2026
…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.
carvalab added a commit to carvalab/FloCafe that referenced this pull request Aug 31, 2026
…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.
carvalab added a commit to carvalab/FloCafe that referenced this pull request Aug 31, 2026
…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.
carvalab added a commit that referenced this pull request Aug 31, 2026
…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.
carvalab added a commit that referenced this pull request Aug 31, 2026
…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.
carvalab added a commit that referenced this pull request Aug 31, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Weighted products & scale-generated barcodes (electronic scale, stage 1)

1 participant