ui: add theme support with dark and light modes#105
Merged
agavra merged 3 commits intoagavra:mainfrom Jan 16, 2026
Merged
Conversation
Mic92
commented
Jan 16, 2026
Mic92
commented
Jan 16, 2026
Users with light terminal backgrounds cannot read the current color scheme. The hardcoded dark theme colors have poor contrast on light backgrounds. Add a --theme flag to select between dark (default) and light themes: tuicr --theme dark # default, original colors tuicr --theme light # optimized for light terminal backgrounds Introduce a Theme struct that holds all color definitions and thread it through the rendering code. All style functions in src/ui/styles.rs now take a &Theme parameter instead of using hardcoded constants. The light theme uses subtle backgrounds (very light green/pink) with dark text for good contrast on light terminal backgrounds. Closes: agavra#7 Closes: agavra#44
Users running tuicr without knowing the available options had no way to discover them. The --theme flag added in the previous commit is not discoverable without documentation. Add --help and -h flags that print a brief usage message showing all available command-line options and a hint about the in-app help. Document why we use a handrolled argument parser instead of clap: to keep binary size small and build times fast.
Owner
|
Really happy to see this change come in! I don't think this fixes #44 quite yet since users can't define their own without modifying source, but it opens the door to that. I think we need to also change Lines 110 to 125 in 10802b8
I also think we should change the syntect theme as well to respect this as well (e.g. use Would be good to share screenshots of your final preview with it before we merge. |
Contributor
Author
agavra
approved these changes
Jan 16, 2026
Owner
agavra
left a comment
There was a problem hiding this comment.
LGTM! I'll merge after you fix clippy
The syntax highlighter was using hardcoded dark theme colors for diff backgrounds and syntect theme selection. Users with light terminal backgrounds got unreadable syntax highlighting. Pass the SyntaxHighlighter through VcsBackend trait methods instead of using global state. The Theme now owns a cached highlighter instance (via OnceLock) configured with the appropriate colors and syntect theme. For light theme, use 'base16-ocean.light' syntect theme and light background colors for additions/deletions.
Contributor
Author
|
ci is green. |
Owner
|
Thanks for the contribution @Mic92! |
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.


Users with light terminal backgrounds cannot read the current color scheme. The hardcoded dark theme colors have poor contrast on light backgrounds.
Add a --theme flag to select between dark (default) and light themes:
tuicr --theme dark # default, original colors
tuicr --theme light # optimized for light terminal backgrounds
Introduce a Theme struct that holds all color definitions and thread it through the rendering code. All style functions in src/ui/styles.rs now take a &Theme parameter instead of using hardcoded constants.
The light theme uses subtle backgrounds (very light green/pink) with dark text for good contrast on light terminal backgrounds.
Closes: #7