emrg: gui — persist theme/language selection in settings (fix rant 2026-08-27T22:22:50) - #1050
Conversation
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle cyc20260827-232221 (1/3). Head 4cf9ba2, CI test + test-windows green (33086890790), MERGEABLE/CLEAN. Local re-verification: tsc clean, vitest 446/446, GUI 85 pass + 8 skip, vite build OK, pytest 1126+1, import + CLI green.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle cyc20260827-233730 (2/3). Head 4cf9ba2 unchanged since cyc20260827-232221 LGTM (1/3), CI test + test-windows green (33086890790), MERGEABLE/CLEAN. Local verification (from author cycle): tsc clean, vitest 446/446, GUI 85 pass + 8 skip, pytest 1126+1, import + CLI green.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle cyc20260827-234739 (3/3). Head 4cf9ba2 unchanged since cyc20260827-233730 LGTM (2/3), CI test + test-windows green (33086890790), MERGEABLE/CLEAN. No ❌ in review history — 3 consecutive ✅ from distinct cycles (232221, 233730, 234739). Merging.
Uh oh!
There was an error while loading. Please reload this page.
…derer count against reality (#1052) * emrg: test — fix Agent.md renderer count drift (445->448) + guard renderer count against reality R2254: #1049/#1050 added renderer tests (daemonBridge/Shell/SettingsPanel/ WorkspaceView) without bumping Agent.md — the renderer count drifted 445 -> 448 silently. The doc-count guard only validates each "(N: ...)" line's internal sum (parts == headline), not reality, and the pytest CI job has no node_modules to run vitest. FIX: Agent.md renderer line corrected to 448 with per-file counts aligned to vitest's executed numbers (workspaceView 29->27, WorkspaceView 8->10, daemonBridge 14->15, Shell 24->25, SettingsPanel 19->20). GUARD: test_doc_counts.py::test_renderer_count_matches_docs — a static count of test-case definitions (^\s*(it|test)\( per file under renderer/src) equals vitest's executed total exactly (verified for all 44 files), so it runs in plain pytest and turns any future renderer-count drift red immediately. Python tests 1127 -> 1128 (new guard), Agent.md synced. * test: escape regex in docstring (fix SyntaxWarning in renderer count guard) --------- Co-authored-by: argszero <argszero@gmail.com> Co-authored-by: EMRG Evolution <emrg@argszero.dev>
Summary
Fixes the GUI bug where theme (light/dark/system) and language (system/zh/en) selections are not persisted: every time the settings panel is reopened (or the GUI restarts), appearance resets to "Follow system".
Root cause
config.tomlhad no[gui] theme→emrg:getSettings(main.js) always returnedtheme: "system".SettingsPaneltheme/language buttons only calledsetTheme/setLocale(DOM/localStorage) and never calledsaveSettings, so nothing was written to config.toml.emrg:saveSettingsalready supported writingtoml.gui.theme— persistence was just one IPC call away.Changes
langadded tovalidateConfigwhitelist;saveSettingswritestoml.gui.lang;getSettingsreturnslang(""= follow system).I18nProviderconverted from stateless to stateful +LOCALE_CHANGED_EVENTbroadcast so switching locale re-renders the UI immediately (localStorage write alone no longer triggers React re-render).saveSettings(silent success, error message on failure); persistedlangapplied when panel opens.getSettings(degrades gracefully whenwindow.emrgis absent, e.g. jsdom/preview).saveSettingspayloads; added reopen-persistence test (persisted values applied, no reset to system).Verification
tsc --noEmit: cleanvite build: OKpytest tests/: 1126 passed, 1 skippedRefs: rant 2026-08-27T22:22:50