feat(tui): theme switcher with preview#264
Merged
adamdotdevin merged 2 commits intoanomalyco:devfrom Jun 20, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces live theme previews in the TUI theme selector and ensures modal close commands are propagated for cleanup or animations.
- Propagate
modal.Close()commands inappModel.Updateto enable proper modal teardown. - Implement live theme preview on list navigation and restore the original theme if the dialog is closed without applying.
- Track and restore the original theme state in the theme dialog.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/tui/internal/tui/tui.go | Return modal.Close() command on ESC and CloseModalMsg cases |
| packages/tui/internal/components/dialog/theme.go | Add originalTheme/themeApplied, preview on navigation, and restore on close |
Comments suppressed due to low confidence (2)
packages/tui/internal/components/dialog/theme.go:84
- Live preview and restore behavior aren't currently covered by tests. Add unit tests to verify theme preview on navigation and theme restoration when cancelling.
_, prevIdx := t.list.GetSelectedItem()
packages/tui/internal/components/dialog/theme.go:90
- [nitpick] Calling
theme.SetThemeon every selection change may cause UI flicker or slowdowns. Consider debouncing updates or applying them only after a brief pause in navigation.
if item, newIdx := t.list.GetSelectedItem(); newIdx >= 0 && newIdx != prevIdx {
Contributor
Author
|
^ Sorry for the AI brainfart above, I accidentally left it enabled. 👀 |
Member
|
nice! thanks! |
achembarpu
pushed a commit
to achembarpu/opencode
that referenced
this pull request
Aug 4, 2025
andreipromarketing-dev
pushed a commit
to andreipromarketing-dev/opencode
that referenced
this pull request
Apr 7, 2026
…ppability, and expanded whitelist. Addressing anomalyco#264, anomalyco#267, anomalyco#275, and anomalyco#248.
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.
Previously, to see a theme in action, you had to do this:
/themesEnterAfter this PR, the new behavior is this:
/themesEnterif you like a theme to save it orEscto discard the selection and close the modal