Skip to content

feat(tui): ink is the truecolor default theme with terminal as the ANSI fallback (U5) - #110

Merged
lg2m merged 1 commit into
mainfrom
feat/eng-851-u5-ink-default
Sep 22, 2026
Merged

lg2m merged 1 commit into
mainfrom
feat/eng-851-u5-ink-default

Conversation

@lg2m

@lg2m lg2m commented Sep 21, 2026

Copy link
Copy Markdown
Collaborator

U5: ink is the truecolor default theme; terminal is the ANSI fallback

Spec: docs/plans/tui-redesign.md#s6-default-theme (decision D1) ADR: docs/adr/0036-truecolor-default-theme.md Linear: ENG-851 (parent ENG-843)

Targets main.

What changed

  • The compiled ANSI palette is renamed terminal (qq-config TERMINAL_THEME, qq-tui Theme::terminal() / Palette::TERMINAL; Theme::default().name == "terminal"). It stays selectable.
  • Default rule (qq-config::theme::load): when the theme is unset or "qq", pick ink if truecolor is advertised, else terminal. Truecolor = COLORTERM equals truecolor or 24bit (case-insensitive). Detection runs once in the composition root (src/main.rs truecolor_support(Option<&OsStr>)) at TUI startup and in config check; qq-tui/qq-config never read env.
  • Explicit choice always wins: theme: "terminal" on a truecolor terminal → terminal; theme: "ink" without truecolor → ink.
  • "qq" remains valid as an alias for the default rule, so existing configs behave the same or better. There is no third palette named qq; discovery skips a user file named qq.ron/terminal.ron.
  • Picker lists ink and terminal (never qq); the active marker works when the theme came from the default rule. Gallery sorts ink first.
  • ADR 0036 accepted; docs/adr/README.md indexed; root.md reservation row updated.

How verified

  • cargo test --workspace 1680 passed: root 170 → 172, qq-config 89 → 90, qq-tui 289 → 290. fmt, clippy -D warnings.
  • New tests: default rule table (unset/qq × truecolor/24bit/none → ink/terminal; explicit terminal and ink win regardless), terminal resolves to the compiled palette, every shipped theme loads, Theme::default() name, picker contents and active marker.
  • Goldens unchanged (plain text).

Measurements

Bench-neutral: steady_state_frame 22.0 µs, golden_path 39.4, keystroke 26.8, run_on_32kb 417.6 (core 2). The harness still runs on Theme::default(), the same ANSI palette under its new name, so it measures the same layout on the same colors.

Design notes

  • ink.ron keeps no syntax block: its derived roles already use only its own palette.
  • README.md example changed from theme: "qq" to "ink" with one sentence on the default; it was the last user-facing text implying qq was a palette.

Docs

  • docs/design/theme.md §§ Defaults, Selection rule, Shipped Themes, Theme Picker, runtime model. ADR 0036. Ledger receipt.

Compatibility

  • theme: "qq" keeps working (alias). Users on non-truecolor terminals see terminal, which is what they had. PROTOCOL / DESCRIPTOR / schema: unchanged.

…SI fallback (U5)

Slice U5 of docs/plans/tui-redesign.md (ENG-851). ADR 0036.

The compiled ANSI palette is renamed `terminal` and stays selectable. When
no theme is set, or `theme: "qq"` is, the composition root's one-time
COLORTERM read (`truecolor`/`24bit`, case-insensitive) picks `ink` or
`terminal`; `qq` is an alias for that rule, not a third palette. Explicit
names always win: `terminal` on a truecolor terminal and `ink` without one
are honored as written. The picker lists `ink` and `terminal`, never `qq`,
and marks the resolved default active. Goldens and bench unchanged.
@lg2m

lg2m commented Sep 21, 2026

Copy link
Copy Markdown
Collaborator Author

Linear: ENG-851. Stacked: #111 (U6) targets this branch; retarget to main after merge.

@lg2m
lg2m added this pull request to stack #112 September 21, 2026 22:24
@lg2m
lg2m merged commit 7938bed into main Sep 22, 2026
4 checks passed
@lg2m
lg2m deleted the feat/eng-851-u5-ink-default branch September 22, 2026 02:28
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