Repository navigation
feat(theme): set S2Code Dark as default theme - #525
Merged
Merged
Conversation
Add S2Code Dark (s2-dark) as a native V2 TUI theme and a bundled web/app theme, and make it the default in both. Calm steel-blue accents replace the amber chrome (Build badge, composer border, scrollbar, bold text, effort label); amber stays reserved for warnings. Both modes are provided and no purple or indigo colors resolve in either. - tui: fork-only theme/default.ts owns DEFAULT_THEME_NAME and getDefaultTheme(); v1.ts returns to upstream. mini falls back to the default document instead of a V1 entry. - tui: the prompt effort label uses text.formfield.selected instead of the warning feedback token. - ui/app: s2-dark.json keeps the v1 bridge active (canvas pinned via grey primitives) so the bundled-theme contrast contract covers it. The app passes defaultTheme="s2-dark"; oc-2 stays the built-in fallback. The preload paints S2 backgrounds for the default and keeps oc-2's for oc-2. - e2e pins oc-2 through storageState so OpenCode color assertions hold. nightowl, opencode, oc-2 and every other theme remain selectable.
- tui: an invalid custom file named like the default theme recovers to the built-in S2Code Dark and reports the error; only the built-in default itself is unrecoverable. A valid same-name file still overrides it. - tui: the prompt effort label keeps text.formfield.selected only where it reaches 4.5:1 on the composer fill, else uses text.base (Cobalt2, Vercel and Dracula dark fell below). - ui: ThemeProvider bundles S2Code Dark eagerly when it is the default, so a fresh window applies and caches it on the first transition. The theme machine gains optional initialThemes and fallbackId; failed or missing themes fall back to S2Code Dark there, and oc-2 stays the built-in default without them. - app: the preload tolerates blocked storage, paints S2's deep background only for s2-dark, and injects it on a first start with no cached colors. - Light mode: darken TUI diff gutter, context and sign colors, and web comment, type, weak and faint text so every rendered pair reaches 4.5:1. - Tests cover the recovery, fallback, preload paths, the variant label in every built-in theme and the light contrast pairs.
…ster - tui: promptVariantColor measures the selection color composited over the composer fill, so translucent or transparent custom colors fall back to body text. - ui: the theme machine remembers the fallback's own theme. Withdrawing a theme registered over the fallback's id restores the original instead of keeping the replacement; withdrawing the original stays a no-op, and oc-2 handling is unchanged.
Owner
Author
CI Disposition (
|
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.
Summary
Sets S2Code Dark (
s2-dark) as the default theme for both theshuvcodeTerminal UI (packages/tui) and Web/App UI (packages/ui+packages/app), unifying the palette around deep obsidian-slate surfaces (#0c1119/#121923/#161d28/#1b232f/#1f2835), crisp cool-white/slate typography, and calm steel-blue accents (#60a5fa/#93c5fd/#2f6fb8) with zero purple/indigo tints and no amber/yellow primary chrome.All existing built-in themes (
nightowl,opencode,opencode-classic,oc-2, etc.) and custom user themes remain selectable and unchanged.Key Changes
packages/tui):packages/tui/src/theme/assets/v2/s2-dark.json(base+dark+light) with steel-bluecategorical[0](Buildbadge & composer left border), quiet slate scrollbars, crisp white bold markdown (#f8fafc), exact semantic diff/status colors, and full WCAG AA contrast in both modes.packages/tui/src/theme/default.ts(DEFAULT_THEME_NAME = "s2-dark",getS2DarkTheme(),getDefaultTheme()), re-exported fromtheme/index.ts, registered"s2-dark"inlistThemes(), and restoredtheme/v1.tsto upstream.packages/tui/src/mini/theme.tsto usegetDefaultTheme()instead ofDEFAULT_THEMES[DEFAULT_THEME_NAME].packages/tui/src/component/prompt/metadata.tsxeffort/variant badge fromtheme.text.feedback.warning.basetotheme.text.formfield.selected(semantic token fix perAGENTS.md).packages/tui/test/theme/s2-dark.test.ts(registration, contrast >= 4.5, no-purple OKLCH guard, surface hierarchy) and updated TUI theme tests; restoreddiff-viewer.test.tsxto upstream.packages/ui+packages/app):packages/ui/src/theme/themes/s2-dark.json(id: "s2-dark",name: "S2Code Dark") mapped viav2-grey-*primitives (preservingv1CodeAndDiffBridgeand passingv2/resolve.test.tsacross both modes) with zero purple/indigo tints."s2-dark": "S2Code Dark"inpackages/ui/src/theme/context.tsxand addedpackages/ui/src/theme/s2-dark.test.ts(no-purple guard across legacy & v2 resolve paths).defaultTheme="s2-dark"to<ThemeProvider>inpackages/app/src/app.tsx(keepingDEFAULT_THEME_ID = "oc-2"inmachine.tssos2-darkcaches cleanly inlocalStoragewith zero FOUC and minimal upstream diff).packages/app/public/oc-theme-preload.jsandpackages/app/src/theme-preload.test.ts(default"s2-dark", dark#121923/ light S2 bg-deep, preserving"oc-2"fast path + drift guard).packages/app/playwright.config.tsdefault storage theme to"oc-2"so existingoc-2-specific e2e color assertions remain green while per-test theme selections still override it.Feature Flag
No feature flag: this is a default theme update for
shuvcodewith all prior themes (nightowl,opencode,oc-2, etc.) preserved and immediately selectable.Visual
Verification
packages/tui:bun run test(1878 pass, 2 skip, 0 fail),typecheck,typecheck:tscpackages/ui:bun run test(692 pass, 0 fail),typecheck,typecheck:tscpackages/app: unit (2911 pass, 0 fail), browser (389 pass, 0 fail),typecheck,typecheck:tscbun run check(40/40 green),git diff --checkclean