Skip to content

fix(cli): persist /theme selection to user config so it survives restart#3043

Merged
esengine merged 1 commit into
esengine:main-v2from
CnsMaple:fix/theme-persist
Jun 4, 2026
Merged

fix(cli): persist /theme selection to user config so it survives restart#3043
esengine merged 1 commit into
esengine:main-v2from
CnsMaple:fix/theme-persist

Conversation

@CnsMaple

@CnsMaple CnsMaple commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Problem

The /theme command (e.g. /theme light) only modified the runtime activeCLITheme variable and refreshed the UI, but never wrote the choice to ~/.config/reasonix/config.toml. On next startup the config loader read the old value and the theme was lost — the user's theme preference reverted to the default.

Fix

Added a persistTheme method called after every successful /theme switch, following the same pattern used by /effort and /language (which already persist to config).

User input Written to ~/.config/reasonix/config.toml
/theme light / /theme dark / /theme auto theme = "..." + current theme_style
/theme aurora (any style name) theme = "dark" / "light" + theme_style = "aurora"

Verification

  • go build ./... — passes
  • go test ./internal/cli/ -run Theme — all theme tests pass
  • go test ./internal/config/ -run TestRenderTOML — passes (config round-trip unaffected)

The /theme command (e.g. /theme light) only modified the runtime
activeCLITheme variable and refreshed the UI, but never wrote the
choice to ~/.config/reasonix/config.toml. On next startup the config
loader read the old value and the theme was lost.

Add a persistTheme helper that writes theme and theme_style to the
user config file, called after every successful /theme switch. Follow
the same pattern used by /effort and /language.

Fixes the issue where theme changes revert on restart.
@github-actions github-actions Bot added the v2 Go rewrite (1.x) — main-v2 branch, active development label Jun 4, 2026
@esengine esengine merged commit 9b71197 into esengine:main-v2 Jun 4, 2026
1 check passed
@CnsMaple CnsMaple deleted the fix/theme-persist branch June 9, 2026 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants