feat(tui): implement model and provider theme auto-selection#24753
Open
zxmpg41 wants to merge 3 commits intoanomalyco:devfrom
Open
feat(tui): implement model and provider theme auto-selection#24753zxmpg41 wants to merge 3 commits intoanomalyco:devfrom
zxmpg41 wants to merge 3 commits intoanomalyco:devfrom
Conversation
This commit introduces test coverage for the provider and model theme configurations added in anomalyco#6631. - Adds config parsing validations to ensure that `model.theme` takes precedence and falls back to `undefined` rather than inheriting `provider.theme` at the model level. - Refactors the theme resolution logic in `cli/cmd/tui/context/local.tsx` into a pure function `resolveThemeFallback`. - Adds unit tests in `test/cli/tui/local.test.ts` to verify the UI fallback logic chain: `model.theme ?? provider.theme ?? tui.theme ?? 'opencode'`.
This adds documentation to the website to explain the new theme fallback mechanism introduced in anomalyco#6631. - Adds a section in `themes.mdx` detailing how to auto-select a theme based on the active model or provider. - Includes an example configuration for `opencode.json` showing `theme` applied to a provider and a specific model. - Updates `config.mdx` to mention the fallback mechanism: `model theme -> provider theme -> tui theme -> default opencode theme`.
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 #6631
Type of change
What does this PR do?
This PR adds the ability to automatically switch the TUI theme based on the currently active model or provider.
Sample configuration:
How did you verify your code works?
bun test test/cli/tui/local.test.tsandbun test test/provider/provider.test.ts) that specifically test the fallback priorities.Screenshots / recordings
Checklist