Files
kebab/tasks/p9/p9-fb-14-tui-color-theme.md
altair823 2d40d60af2 chore(tasks): mark p9-fb-14 completed
PR #70 머지 (e8f28c1). 머지 후 spec status 갱신.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 03:13:26 +00:00

1.9 KiB

phase, component, task_id, title, status, depends_on, unblocks, contract_source, contract_sections, source_feedback
phase component task_id title status depends_on unblocks contract_source contract_sections source_feedback
P9 kebab-tui p9-fb-14 TUI color theme module (role-based + dark/light toggle) completed
p9-fb-11
../../docs/superpowers/specs/2026-04-27-kebab-final-form-design.md
§10 UX
p9-dogfooding-feedback.md item 12

p9-fb-14 — Color theme

Goal

TUI 의 정보 종류별 color role 매핑. 모든 pane 이 single source 인 theme 모듈에서 Style 가져옴.

Allowed dependencies

  • 기존 kebab-tui deps.

Public surface

pub struct Theme { /* role -> Style 맵 */ }
impl Theme {
    pub fn dark() -> Self;
    pub fn light() -> Self;
    pub fn style(&self, role: Role) -> Style;
}

pub enum Role {
    Title, Path, ScoreHigh, ScoreMid, ScoreLow,
    ModeLexical, ModeVector, ModeHybrid,
    Warning, Error, StreamingNew,
    CitationLink, KeywordHighlight,
    ModeNormal, ModeInsert,
    BorderActive, BorderInactive,
    Bullet, CodeBg, BlockquoteBar,
}

Behavior contract

  • 기본 theme: dark.
  • theme = "dark" | "light" config field 신규. T 키 (NORMAL 모드) toggle.
  • color role 매핑 — 이전 항목 12 의 role 표 따름.
  • accessibility: color 단독 의미 전달 X. Score 는 숫자 + color, mode 는 텍스트 + color.

Test plan

kind description
unit Theme::dark().style(Role::Title) 가 정의된 fg/bg 반환
unit dark / light 의 모든 Role 변형 정의 누락 X (exhaustive match)

DoD

  • cargo test -p kebab-tui 통과
  • Library / Search / Ask / Inspect 의 직접 Style::default().fg(...) 호출 사라짐 (모두 theme 경유)
  • config.toml 코멘트에 theme = "dark" 명시
  • README — theme 토글 키 안내

Out of scope

  • 사용자 정의 color ([theme.custom] 절) — P+
  • terminal 의 truecolor 미지원 fallback (256-color assumed)