fix(shell): scope dark default to terminal#366
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis PR decouples shell UI theming from terminal theming by restoring the light
Confidence Score: 5/5Safe to merge — the change is narrowly scoped to default values and does not alter any persisted state, API contract, or auth path. Both theme paths (shell fallback and terminal initial state) are covered by updated tests that directly import the exported constants. Existing users with persisted terminal settings are shielded by Zustand's persist middleware. The refactored style-fallback logic in normalizeTheme is behaviorally identical to the old spread approach for every current Theme field. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[App starts] --> B{Fetch theme\nfrom API}
B -- success --> C[normalizeTheme\nvalue, DEFAULT_THEME]
B -- failure / first-run --> D[DEFAULT_THEME\nlight fallback]
C --> E[Apply shell theme\nlight or dark]
D --> E
A --> F[useTerminalSettings\nZustand persist]
F -- persisted value exists --> G[Use stored themeId\ne.g. system, one-dark]
F -- no persisted value --> H[DEFAULT_TERMINAL_THEME_ID\none-dark]
G --> I[Terminal renders\nwith chosen theme]
H --> I
Reviews (2): Last reviewed commit: "test(shell): import terminal default dir..." | Re-trigger Greptile |
Summary
DEFAULT_THEMEso Settings, Billing, and other shell UI no longer inherit the dark preset by default.themeId: "system"tothemeId: "one-dark".Match OSavailable and preserves existing persisted terminal settings, including explicitsystempreferences.Tests
/home/nima/matrix-os/node_modules/.bin/vitest run tests/shell/useTheme.test.ts tests/shell/terminal-settings.test.ts --config /home/nima/matrix-os/vitest.config.tspassed: 15 tests../scripts/review/check-patterns.sh --diff origin/mainpassed: no violations or warnings.check.Review/Monitoring
6070ba387ee10ec5aa82ccad072c730c5f3059bc.Invariants
system/theme.json; terminal appearance defaults come from terminal-specific settings.DEFAULT_THEME; terminal still defaults toone-darkunless a terminal preference is already persisted./api/settings/theme.