Add configurable TUI themes
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 19.9k
- Forks
- 2.3k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 30
Description
Hi, I updated the theme branch after syncing with current master.
Branch:
https://github.com/alecuba16/jcode/tree/feature/themes-light-dark-config
Latest branch head:
c58ef0db
Compare:
https://github.com/1jehuang/jcode/compare/master...alecuba16:feature/themes-light-dark-config
Current state on master
Master already has important theme work now:
- Terminal background detection (
dark/light/autobehavior) ThemeModesupport injcode-tui-style- Buffer-level color adaptation with
adapt_buffer_for_theme() - This covers the automatic readable mode for light terminal backgrounds
So the branch is no longer trying to replace that work.
Current state of my branch
The branch now keeps the master behavior and builds on top of it:
systemtheme uses the master native palette and keeps master terminal-background adaptation- Explicit
light,dark, and custom TOML themes are treated as final palettes - Explicit themes skip
adapt_buffer_for_theme()to avoid double color transformation /themecommand to show and switch themesdisplay.themeconfig persistence- Custom theme loading from
~/.jcode/themes/<name>.toml - Safe custom theme names (
A-Z,a-z,0-9,_,-) to avoid path traversal - Background/input/markdown/header colors can be controlled by the theme palette
- Tests for built-in themes, custom theme loading, unsafe name rejection, and adaptation policy
Requested follow-up
Would this split make sense for the project?
system= master behavior, terminal auto detection and buffer adaptationlight/dark/ custom = explicit user-selected palettes, no automatic buffer adaptation
I think this keeps the upstream automatic theme support, but still gives users a way to choose exact colors or add their own theme file.
Validation run
After rebasing on current master, I ran:
cargo test -p jcode-tui-style theme -- --test-threads=1cargo test -p jcode-tui-style theme_mode -- --test-threads=1cargo check -p jcode-tui-style -p jcode-tui
All passed.
If this direction sounds good, I can keep the branch focused on the explicit theme switcher and custom theme file support, without changing the master auto-detection behavior.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the feature/themes-light-dark-config branch and its master comparison, then run the listed jcode-tui-style theme tests and jcode-tui checks. Done means maintainers accept the system versus explicit-theme split and the validation commands continue to pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100