Repository navigation
feat: add Light/Dark/System theme support with title-bar synchronization (#513) - #563
Merged
Merged
Conversation
7 of 8 tasks
carvalab
force-pushed
the
feat/513-dark-theme-e2e
branch
from
August 31, 2026 13:01
940570b to
5e09db1
Compare
…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
force-pushed
the
feat/513-dark-theme-e2e
branch
from
August 31, 2026 13:09
5e09db1 to
f2adf5d
Compare
7 tasks
itsbkm
added a commit
that referenced
this pull request
Aug 31, 2026
Both this branch and the just-merged theme-support PR (#563) appended new entries to the same npm test script chain; combined both sets.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Same change as #547, reopened from an in-repo branch so CI runs without the fork-approval gate.
Summary
Implements #513 — end-to-end Light/Dark/System theme support across the renderer and Electron main process, with no new dependencies.
theme_mode(light|dark|system, defaultsystem) registered in both settings allowlists and value-validated in both write paths. No migration, no seeding; absent/invalid resolves tosystem.useThemeModestore +ThemeSynccomponent — resolvessystemviamatchMedia, toggles.darkon<html>, ownership-gated localStorage mirror, token-gated DB seed for follower windows (DB > param > mirror > OS), fire-and-forget push of the effective theme to main.prefers-color-scheme), precedence matrix covered by a vm-based test suite.set-theme-effectiveIPC (sender-validated) → live overlay re-color on Windows/macOS; correct initial colors everywhere (Linux: next launch, documented);?theme=on the KDS window;effectiveThemeonget-status.Test Plan
npm run lint(0 errors),npm run build,npm run i18n:checktest:titlebar-window-options— theme-mode helperstest:electron-api-contract—setThemeEffectivetyped on both sidestest:theme-mode-settings(new) — write-path validation, negative + persistencetest:theme-fouc-script(new) — FOUC precedence matrix vs the production scripttest:reports-insights— fixtures made date-independent (they aged out of the 90-day window on Aug 31; this was breaking everyone's CI, not just this PR)test:e2e:electron(new) — dark toggle,nativeTheme.themeSourcesystem sync, relaunch persistence