Unified residual theming (two-mode per-app) #3
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
residual/.agent#3
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Plan: Unified residual theming + color-set unification
Goal (from user)
All residual UIs support theming via two modes, chosen per app:
unified_theme = falseby default per app). When on, the app reads the shared~/.config/residual/theme.tomlpalette.res-console). App uses the terminal's own fg/bg; no OSC palette remap, no hardcoded amber.All apps may use the amber unified theme, but by default they don't — except
res-console, which keeps its current amber-by-default behavior.res-themeis the editor for the unified theme config. The 4 non-palette overlay shade colors are unified into the 5 approved palette colors.res-demoandres-themeare added to the docs.Decisions (confirmed with user)
<app>.toml(unified_theme = false).res-consoleis the exception: amber-by-default (keeps current behavior), opt-OUT viaunified_theme = false→ pure inherit.Current state (verified)
theme.Config= 5 colors +TransparentBg; loaded from sharedtheme.tomlviatheme.LoadConfig().res-console:theme.InitTheme(theme.LoadConfig())+ApplyConsolePalette(OSC 10/11).res-calc,res-sheets:theme.InitTheme(theme.DefaultConfig())— amber, but ignores usertheme.toml.res-edit,res-code: intentionally neutral (ANSI indices only, noInitTheme) — already inherit-by-default.res-theme: saves to~/.config/residual/theme.toml(doc comment wrongly says/tmp/res-theme.toml).core/lib/tui/theme/theme.go(#080600,#120f00,#aa8800,#3a2a00).Implementation notes (as built)
theme.InitInherit()andtheme.InitUnified()(replacing oldInitTheme2-arg call sites).InitUnified()reads sharedtheme.toml;InitInherit()sets neutral terminal-inherit styles.theme.UnifiedEnabled(fileName string) boolhelper (usesconfig.LoadOne) for apps without their own config struct. Used byres-calc/res-sheets.res-edit/res-codegotUnifiedTheme boolkey in their config structs and callInitUnify/InitInherit.edit.LoadConfig/code.LoadConfigexported.res-consoleflipped to amber-by-default:unified_theme = true→InitInherit(); default →InitTheme+ palette.Steps
core/lib/tui/theme/theme.go+config.go).unified_themekey (defaultfalse) in each app config struct.res-theme— fix stale doc comment (/tmp/res-theme.toml→~/.config/residual/theme.toml).cd core && go build ./... && CGO_ENABLED=1 go test ./...PASS;cd extra && go build ./... && go test ./...PASS; grep no non-palette hex incore/lib/tui/theme.Status: all code + doc steps complete; builds/tests green. Plan ready to close after commit/push.
Behavior changes to flag
res-calc/res-sheetsbecome neutral-by-default (inherited terminal theme) instead of always-amber. Users who want amber setunified_theme = true.res-consolekeeps amber-by-default (exception); setunified_theme = trueto get pure inherit.Risks
res-calc/res-sheetscurrently have no config file — adding one is new surface; keep minimal (justunified_theme).InitInherit()must not breakres-edit/res-codeneutral rendering — mirror their ANSI-index approach.