Repository navigation
fix(tui): revert to default theme when theme is removed from config - #65925
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
The fix works and looks sound. With the PR, removing theme or only theme.name from cli.json switches the TS TUI back to the default opencode theme. On the pre-merge code, the same drive script left gruvbox on screen after both removals. The new theme.test.tsx case fails before the change and passes after it, and tsc -b is clean. I couldn't run the Rust TUI changes here (no Rust toolchain), but the code reads correctly: like the TS TUI, it treats an empty or missing name as opencode, which matches the initial load.
Public API is unchanged: the theme.name config key is the same, and leaving it out now behaves the same way at runtime as it does at startup.
No concerns.
beyondChang
pushed a commit
to beyondChang/opencode
that referenced
this pull request
Nov 24, 2026
1 task
This was referenced Nov 26, 2026
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.


Issue for this PR
Closes #64420
Type of change
What does this PR do?
When
themeortheme.nameis removed fromcli.json, both the TypeScript TUI and Rust TUI previously returned early / skipped applying the change, leaving the previously configured theme active instead of reverting to the defaultopencodetheme.packages/tui/src/context/theme.tsx: falls back to"opencode"whenconfig.theme?.namebecomes unset, matching initial load.packages/cli-rs/crates/tui/src/dialogs/settings.rs&packages/cli-rs/crates/ui/src/theme/state.rs: applies the default"opencode"theme whennew.namebecomesNone, matching howmodealready falls back to"system".How did you verify your code works?
theme.nameand removing the entirethemeblock inpackages/tui/test/context/theme.test.tsxandpackages/cli-rs/crates/tui/tests/all/config_live.rs.bun test test/context/theme.test.tsx,bun typecheck,oxlint, andprettier --checkinpackages/tui.cargo fmt --checkandcargo test -p opencode-tui --test all config_liveinpackages/cli-rs.Screenshots / recordings
Checklist