Skip to content

Add configurable TUI themes #437

Description

@alecuba16

Hi, I prepared a theme feature branch in my fork, because the contributions are closed.

Branch:
https://github.com/alecuba16/jcode/tree/feature/themes-light-dark-config

Compare:
master...alecuba16:feature/themes-light-dark-config

Reason:

  • The TUI only had the existing/default color behavior.
  • The readable/light theme had contrast issues in practice: white was too bright, pink was too light, and light mode could inherit a dark terminal background when the frame was cleared.
  • There was no dark built-in theme.
  • There was no easy way to switch themes or add custom themes from config.

What the branch adds:

  • Built-in light, dark, and system themes. Light is the current default/builtin theme.
  • /theme command with status, light, dark, system, and custom theme names.
  • 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 / drive-prefix issues.
  • Frame background handling so light mode clears with an explicit light background instead of inheriting a dark terminal background.
  • Docs for custom themes in docs/themes.md.
  • Tests for built-in/custom theme loading, path rejection, and light frame background behavior.

Validation run:

  • cargo fmt --package jcode-tui-style --package jcode-tui-render --package jcode-tui
  • cargo test -p jcode-tui-style
  • cargo test -p jcode-tui-render clear_area_uses_active_theme_frame_background
  • cargo check -p jcode-tui-style -p jcode-tui
  • cargo build -p jcode-tui

If pull requests from forks are not enabled, could you please take a look at the branch and integrate it if it fits the project?

Metadata

Metadata

Assignees

No one assigned

    Labels

    autonomous: noNeeds your brain: a product/design decision is required before anyone acts.enhancementNew feature or requestpriority: mediumP2 - normal prioritytriage: needs-decisionNeeds maintainer decision/design thought

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions