Skip to content

fix(tui): preserve system palette colors#37537

Open
opencode-agent[bot] wants to merge 1 commit into
v2from
system-theme-v2
Open

fix(tui): preserve system palette colors#37537
opencode-agent[bot] wants to merge 1 commit into
v2from
system-theme-v2

Conversation

@opencode-agent

@opencode-agent opencode-agent Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • generate a native V2 system theme directly from the detected terminal palette in system.ts
  • preserve literal ANSI hues across V2 hue steps instead of synthesizing darker colors
  • share palette resolution with the temporary V1 output used by remaining legacy surfaces; no system-theme migration path
  • inherit the normal V2 semantic token defaults from the generated hue scales

Before / after

The generic V1 migration synthesized darker shades that do not exist in the terminal palette. With a Tokyo Night terminal palette:

  • Agent purple: #a485db#bb9af7
  • Accent cyan: #306a8a#7dcfff

OpenCode Drive before/after/pixel-diff comparison

The visual comparison uses the real TUI at 100×30 with a generated Tokyo Night system palette seeded through the normal custom-theme loader. OpenCode Drive's simulated terminal does not answer OSC palette queries, so direct native-system generation is additionally covered by test/theme/system.test.ts.

Checks

  • bun test test/theme/system.test.ts test/theme/v2/v1-migrate.test.ts
  • bun typecheck (from packages/tui)
  • git diff --check

Requested by: @kitlangton (Kit Langton via Slack)

@opencode-agent

Copy link
Copy Markdown
Contributor Author

Reworked this around the native seam: system.ts now generates the V2 theme directly from terminal colors and inherits V2 semantic defaults. migrateSystem is gone; V1 output remains only for legacy surfaces.

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