Skip to content

Add dark/light theme support to the TUI #415

Description

@ravshansbox

Summary

The TUI/CLI agent (jcode) has no dark/light theme support. All colors are hardcoded RGB values tuned for dark terminals. The desktop app already supports System/Dark/Light, so the TUI is the gap.

Current state

  • TUI: Fixed palette in crates/jcode-tui-style/src/theme.rs (e.g. user_color() -> rgb(138, 180, 248)). No theme config option, no terminal-background detection (no COLORFGBG/luminance probing), no light variant.
  • Desktop: crates/jcode-desktop/src/desktop_ui_engine.rs defines enum ThemeMode { System, Dark, Light } with DesktopTheme::for_preferences() resolving System against the OS setting, plus explicit light()/dark() palettes stored in UiPreferences (defaults to System).

Proposed work

  • Introduce a theme abstraction in jcode-tui-style instead of constant color functions (e.g. a Theme struct with named roles).
  • Provide built-in dark and light palettes.
  • Add a config option (e.g. theme = "system" | "dark" | "light" in the config file).
  • Optionally auto-detect terminal background via COLORFGBG / OSC 11 query for system mode.
  • Keep the existing dark palette as the default to avoid visual regressions.

Acceptance criteria

  • Users can select dark or light themes via config.
  • A readable light palette exists for light terminals.
  • Default behavior is unchanged for current users.

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