Skip to content

feat(theme): expand Theme palette with named slots for richer UI states#275

Merged
emal-avala merged 1 commit into
mainfrom
feat/expanded-theme-palette
May 4, 2026
Merged

feat(theme): expand Theme palette with named slots for richer UI states#275
emal-avala merged 1 commit into
mainfrom
feat/expanded-theme-palette

Conversation

@emal-avala
Copy link
Copy Markdown
Member

Summary

  • Adds 35 new named slots to the Theme struct so upcoming UI features can bind to semantic colours rather than hard-coded hex codes.
  • Populates palette-consistent values for every existing theme (midnight, daybreak, midnight_muted, daybreak_muted, terminal, dark_colorblind, light_colorblind, dark_ansi, light_ansi) and threads the new slots through the theme_runtime facade so they get adapted by color_emit alongside the existing ones.
  • Documents the new slots in docs/configuration/themes.mdx and registers the page in the docs nav.

Slot list

  • Shimmer variants: success_shimmer, error_shimmer, warning_shimmer, accent_shimmer, muted_shimmer
  • Diff intensities: diff_added_dimmed, diff_removed_dimmed, diff_added_word, diff_removed_word
  • Subagent identification: subagent_red/blue/green/yellow/purple/orange/pink/cyan
  • Rate-limit / budget bar: rate_limit_fill, rate_limit_empty
  • Backgrounds: selection_bg, message_action_bg, user_message_bg, bash_message_bg, memory_message_bg
  • Rainbow bands: rainbow_red/orange/yellow/green/blue/indigo/violet
  • Mode tags: plan_mode, brief_mode, fast_mode, fast_mode_shimmer

Constraints honoured

  • Colourblind themes draw new slots only from the Okabe-Ito palette plus black and white. Some intentional repetition is required because the palette has fewer chromatic hues than the slot count; documented inline.
  • ANSI-only themes stay within the 16 standard ANSI codes. subagent_pink / subagent_orange overlap with their nearest neighbours in light_ansi for the same reason.
  • No render-code consumers added in this PR — slots land first, bindings come in follow-up PRs.

Test Plan

  • cargo check --all-targets
  • cargo test --all-targets (the only failures are pre-existing bwrap sandbox tests that need uid-mapping permissions on this machine; unrelated)
  • cargo clippy --all-targets -- -D warnings
  • cargo fmt --all -- --check
  • New unit tests:
    • every constructor returns successfully
    • every new slot is populated (non-Color::Reset) for every theme
    • colourblind themes restrict new slots to Okabe-Ito + black/white
    • ANSI-only themes restrict new slots to the 16 standard ANSI codes

…slots

Adds 35 new named slots to the Theme struct so upcoming UI features
can bind to semantic colours rather than hard-coded hex codes:

- shimmer variants (success/error/warning/accent/muted) for animated states
- dimmed and word-level diff intensities (added/removed)
- 8 stable subagent identification colours
- rate-limit fill/empty for the budget bar
- selection / message-action / per-message-kind backgrounds
- 7-band rainbow keyword highlighting
- plan / brief / fast mode tag colours plus a fast-mode shimmer

Every theme (midnight, daybreak, midnight_muted, daybreak_muted,
terminal, dark_colorblind, light_colorblind, dark_ansi, light_ansi)
gains palette-consistent values. Colourblind themes restrict new slots
to Okabe-Ito plus black/white; ANSI themes stay within the 16 standard
codes. The theme runtime facade adapts the new slots through
color_emit alongside the existing ones.

Render-code consumers will bind to these slots in follow-up PRs;
this change only adds the slots, populates them, and tests that
each theme defines every one.
@emal-avala emal-avala merged commit 8665315 into main May 4, 2026
14 checks passed
@emal-avala emal-avala deleted the feat/expanded-theme-palette branch May 4, 2026 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant