-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Open
Labels
opentuiThis relates to changes in v1.0, now that opencode uses opentuiThis relates to changes in v1.0, now that opencode uses opentui
Description
Problem
XML/HTML tags are styled using hardcoded color mappings in getSyntaxRules():
{ scope: ["tag"], style: { foreground: theme.error } },
{ scope: ["tag.attribute"], style: { foreground: theme.syntaxKeyword } },
{ scope: ["tag.delimiter"], style: { foreground: theme.syntaxOperator } },This means custom themes cannot independently control tag colors—they inherit from unrelated tokens (error, syntaxKeyword, syntaxOperator).
Proposed Solution
Add three new optional theme tokens:
syntaxTag- for tag names (<div>,<span>)syntaxAttribute- for attributes (class=,href=)syntaxTagDelimiter- for delimiters (<,>,/>)
These would be optional with backward-compatible fallbacks to the current hardcoded values.
Files to Modify
packages/opencode/src/cli/cmd/tui/context/theme.tsxpackages/opencode/src/cli/cmd/tui/context/theme-resolver.tspackages/opencode/test/cli/tui/theme.test.tspackages/web/public/theme.json(schema)packages/opencode/src/cli/cmd/tui/context/theme/opencode.json
Implementation Notes
- Moved theme resolution logic into
theme-resolver.tsfor testability. - Added unit tests for fallback behavior and explicit overrides.
Status
PR open: #6130
Notes
- AI Assistance: OpenCode + openai/gpt-5.2-codex (high)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
opentuiThis relates to changes in v1.0, now that opencode uses opentuiThis relates to changes in v1.0, now that opencode uses opentui