Skip to content

feat(theme): DeepSeek blue themes and a Grok-style /theme picker - #222

Merged
Blackman99 merged 2 commits into
mainfrom
feat/deepseek-blue-theme
Sep 29, 2026
Merged

Blackman99 merged 2 commits into
mainfrom
feat/deepseek-blue-theme

Conversation

@Blackman99

Copy link
Copy Markdown
Owner

What

This is the first batch of the Grok CLI UX alignment. ADR-0002 makes Grok CLI the primary reference for the TUI: Grok wins ties, and Claude Code decides only where Grok has no equivalent. This batch paints the TUI in DeepSeek's brand blue #4D6BFE and adds a Grok-style /theme picker.

  • Themes (packages/bundle/src/palette.ts):
    • Each theme is a set of Grok-style RGB slots, with explicit 256- and 16-colour overrides. For example, the navy band keeps its hue at index 17, where quantization alone would turn it gray.
    • The catalog is auto (the default, follows OSC 11), deepseek, deepseek-light and terminal. terminal uses ANSI colours only and paints no bands; the person's message is bold instead.
  • Colours:
    • #4D6BFE: input frame, the person's rule, selection markers, ✻, the whale's water, the cursor.
    • Its tint #7E96F5: thinking rule, $skill, headings, links, paths.
    • The person's band is navy instead of plum.
    • Red, green, amber and the syntax colours are unchanged.
  • Theme switching: the Theme record switches in place, so every role a renderer already holds paints the new palette.
  • /theme:
    • With no argument it opens a picker: arrows preview live, Enter saves, Esc reverts.
    • /theme <name> sets a theme directly, and aliases like dark, light, system and native work.
    • The choice is kept under theme in code-cli-ui.json. That file now merges instead of being overwritten, so the /ui density survives.
    • CODSH_THEME overrides the saved choice for one launch.
  • Screen:
    • Hover, sticky and divider fills come from the shared theme, and NO_COLOR now paints no fills.
    • OSC 12 sets the cursor colour, and OSC 112 restores it on exit.
  • Repaint:
    • After a theme change, the session is replayed into a fresh transcript to recolour the history.
    • The repaint waits while a turn runs or a Child view is open.
    • Prompt.select gained a settled hook, so Esc reverts before the closing frame is drawn.

Known trade-offs

These are documented in CONTEXT.md and the alignment matrix.

  • At 16 colours the brand and the tint both become 94; the terminal theme covers that case.
  • Like --resume, a repaint does not re-show rows that never reached the session log: command reports, ! output and notices.
  • Old tmux and Terminal.app ignore OSC 12.

Docs

  • New ADR-0002, and ADR-0001 is marked superseded for the TUI.
  • docs/alignment.md: the /theme row is now aligned with its test anchors, and a new "Grok CLI alignment" section lists the later batches.
  • CONTEXT.md defines Theme and Repaint.
  • README.md and README.zh.md are updated in parity.
  • The logo, favicon and README banner use #4D6BFE, and the site frames were recaptured from the real build.
  • The changeset bumps both packages as minor.

Tests

  • pnpm run typecheck passes.
  • pnpm test: 1988 pass. New specs cover the theme catalog, theme-setting, prefs, theme-picker and the select settle order, plus screen theme-driven fills and OSC 12/112, banner depth, light and terminal variants, and the terminal-theme prompt.
  • pnpm run test:e2e: 179 pass, 1 skipped (the site capture, which runs only when asked).
    • The new e2e/pty-theme.e2e.ts switches to /theme deepseek-light: the history repaints and no dark band is left. The theme persists across a restart and the density survives. /theme terminal paints a 34 frame and sends OSC 112. The picker previews a theme and Esc reverts it without saving.
    • The harness now strips the runner's COLORTERM and CODSH_THEME, because the accent now depends on colour depth.

First batch of the Grok CLI UX alignment (ADR-0002: Grok CLI wins TUI
ties; Claude Code decides where Grok has no equivalent).

- palette.ts holds the themes as Grok-style RGB slots with explicit 256-
  and 16-colour overrides: deepseek, deepseek-light, and terminal (ANSI
  only, no bands). The brand is #4D6BFE (frame, the person's rule, markers,
  mark, cursor) and its tint #7E96F5 (thinking, links, headings, paths).
  The person's band is navy instead of plum; semantic colours unchanged.
- The Theme record switches in place, so every role a renderer already
  holds paints the new palette. auto (default) follows OSC 11.
- /theme opens a picker: arrows preview live, Enter saves, Esc reverts;
  /theme <name> sets directly. Kept under `theme` in code-cli-ui.json,
  which now merges instead of overwriting (density survives); CODSH_THEME
  overrides for one launch.
- Screen paints its hover, sticky and divider fills from the shared theme
  (NO_COLOR now paints no fills) and sets the cursor colour with OSC 12,
  restoring it with OSC 112 on exit.
- A theme change repaints the history by replaying the session into a
  fresh transcript, deferred while a turn runs or a Child view is open.
- The e2e harness strips the runner's COLORTERM and CODSH_THEME, since the
  accent now forks by depth.

Docs: ADR-0002, alignment matrix (/theme aligned, Grok CLI section with
the later batches), CONTEXT.md Theme and Repaint, README en/zh. Logo,
favicon and README banner move to #4D6BFE; site frames regenerated.
@changeset-bot

changeset-bot Bot commented Sep 29, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 11d95ee

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
codsh-cli Minor
codsh-bundle Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Blackman99
Blackman99 merged commit 11d95ee into main Sep 29, 2026
2 checks passed
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