1jehuang / 1jehuang/jcode

Add configurable TUI themes

Open
#437 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

autonomous: no enhancement priority: medium triage: needs-decision
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 / auto behavior)
  • ThemeMode support in jcode-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:

  • system theme 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
  • /theme command to show and switch themes
  • display.theme config 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 adaptation
  • light / 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=1
  • cargo test -p jcode-tui-style theme_mode -- --test-threads=1
  • cargo 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.