Skip to content

refactor(theme): align hue direction with mode - #49820

Merged
jlongster merged 2 commits into
v2from
mode-hue-direction
Sep 18, 2026
Merged

jlongster merged 2 commits into
v2from
mode-hue-direction

Conversation

@jlongster

Copy link
Copy Markdown
Contributor

What

Give hue steps a mode-relative contrast direction:

light mode: 100 dark  → 900 light
dark mode:  100 light → 900 dark

This makes 100 the foreground end and 900 the background end in both modes.

Changes

  • Reverse the light-mode default hue scales and all corresponding light token references.
  • Update V1 migration to emit the new light direction while preserving resolved legacy colors.
  • Make hue inference choose its lightness anchor according to the mode's direction.
  • Simplify matching fixed-step consumers: syntax, categorical colors, dialogs, terminal ANSI colors, and most accent selections now use the same step in both modes.
  • Preserve the two intentionally different session accent levels (light: 300, dark: 200).
  • Remove raise(): with both mode scales sharing the foreground direction, it is exactly decrease(); callers now use decrease() directly.
  • Remove the now-unneeded mode argument from resolveTheme() and generateSyntax().
  • Document the direction and test every base hue's endpoints in both modes.

Verification before PR

  • packages/theme: typecheck and 6 tests pass
  • packages/tui: typecheck and focused theme/TUI suites pass (85 tests before the final restore; targeted hue/migration suite passes after)

The first full snapshot run captured all 20 dark/light baseline states but hit a git-index conflict while restoring the stash before the after capture. The change was restored manually and committed safely. I will rerun the visual comparison against this committed PR branch.

Order light-mode hue scales from dark at 100 to light at 900 while keeping
dark-mode scales ordered from light at 100 to dark at 900. Reverse light
references and V1 migration anchors so resolved colors remain unchanged.

With 100 now the foreground end in both modes, remove the mode-aware raise()
helper and use decrease() directly. Fixed-step syntax, categorical, terminal,
and accent consumers now share the same indices across modes where their
colors match.
@jlongster

Copy link
Copy Markdown
Contributor Author

Visual verification complete: 40/40 states identical across opencode-light, catppuccin-light, opencode-dark, and dracula-dark (10 states each). Normalized text and PNGs match. The per-cell comparison found zero visible glyph/background/attribute differences; 44 blank cells differed only in unused foreground metadata.

@jlongster
jlongster merged commit 810e79a into v2 Sep 18, 2026
9 of 10 checks passed
@jlongster
jlongster deleted the mode-hue-direction branch September 18, 2026 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant