feat: Prepare the TUI to allow for custom themes#11
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the theme configuration system to prepare for custom themes, making color handling consistent across both the TUI and CLI help documentation by introducing a unified PaletteColor type that handles conversion between hex colors for Lipgloss and RGBA for Fang.
- Introduced
PaletteColortype to unify color representation with methods for both Lipgloss and RGBA conversions - Added
Configstruct and parsing functions (FromConfig,MustFromConfig,parsePaletteColor) to support configuration-based theme creation - Replaced hard-coded ANSI color references with theme-based color references throughout the TUI
- Renamed
tabCounttoTabCount(exported) for consistency with other exported Tab constants
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| main.go | Updated customColorScheme to use new theme API with RGBA conversion methods, moved function to bottom of file |
| internal/theme/theme.go | Complete rewrite introducing PaletteColor, Config types, hex color parsing, and new WorryStyle method |
| internal/theme/theme_test.go | New test file covering color parsing, shorthand hex, invalid input, and ANSI rejection |
| internal/tui/tui.go | Updated to use new theme API, renamed tabCount to TabCount, removed obsolete comment |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Makes consistent the theme configuration so that this can in the future be configured via a config file.