[PR #6130] feat(tui): add configurable syntax tokens for XML/HTML tags (#6128) #11745

Open
opened 2026-02-16 18:16:41 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/6130

State: open
Merged: No


Problem

XML/HTML tags use hardcoded color mappings tied to unrelated tokens (error, syntaxKeyword, syntaxOperator), preventing custom themes from controlling tag colours independently.

Solution

  • Add three optional theme tokens: syntaxTag, syntaxAttribute, syntaxTagDelimiter
  • Extract resolution logic into theme-resolver.ts for testability
  • Provide backward-compatible fallbacks to existing tokens
  • Cover fallback paths with unit tests

Related Items

Notes

  • Tests run locally via bun test test/cli/tui/theme.test.ts — all pass
  • Schema updated in packages/web/public/theme.json
  • Default theme updated in packages/opencode/src/cli/cmd/tui/context/theme/opencode.json
  • AI Assistance: OpenCode + openai/gpt-5.2-codex (high)
  • Testing: Unit tests + manual verification
  • Review: Human operator reviewed
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/6130 **State:** open **Merged:** No --- ## Problem XML/HTML tags use hardcoded color mappings tied to unrelated tokens (`error`, `syntaxKeyword`, `syntaxOperator`), preventing custom themes from controlling tag colours independently. ## Solution - Add three optional theme tokens: `syntaxTag`, `syntaxAttribute`, `syntaxTagDelimiter` - Extract resolution logic into `theme-resolver.ts` for testability - Provide backward-compatible fallbacks to existing tokens - Cover fallback paths with unit tests ## Related Items - Closes #6128 ## Notes - Tests run locally via `bun test test/cli/tui/theme.test.ts` — all pass - Schema updated in `packages/web/public/theme.json` - Default theme updated in `packages/opencode/src/cli/cmd/tui/context/theme/opencode.json` - AI Assistance: OpenCode + openai/gpt-5.2-codex (high) - Testing: Unit tests + manual verification - Review: Human operator reviewed
yindo added the pull-request label 2026-02-16 18:16:41 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#11745