Skip to content

fix(tui): preserve system palette colors - #37537

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

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

Conversation

@opencode-agent

@opencode-agentopencode-agentBot 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
ContributorAuthor

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.

@github-actions

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

Sign up for freeto 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

@kitlangton