feat(tui): add configurable syntax tokens for XML/HTML tags (#6128)#6130
Open
CasualDeveloper wants to merge 3 commits intoanomalyco:devfrom
Open
feat(tui): add configurable syntax tokens for XML/HTML tags (#6128)#6130CasualDeveloper wants to merge 3 commits intoanomalyco:devfrom
CasualDeveloper wants to merge 3 commits intoanomalyco:devfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds three optional theme tokens for XML/HTML syntax highlighting, allowing custom themes to independently control tag colors instead of inheriting from unrelated tokens. The implementation maintains backward compatibility by providing fallbacks to the original hardcoded color mappings.
- Added
syntaxTag,syntaxAttribute, andsyntaxTagDelimiteras optional theme tokens - Updated type definitions to support the new tokens with proper fallback handling
- Modified the opencode default theme to explicitly define colors for the new tokens
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/web/public/theme.json | Added JSON schema definitions for the three new optional syntax token properties |
| packages/opencode/src/cli/cmd/tui/context/theme/opencode.json | Defined explicit color values for the new tokens in the default opencode theme |
| packages/opencode/src/cli/cmd/tui/context/theme.tsx | Updated TypeScript types, resolution logic, and syntax rules to support the new tokens with backward-compatible fallbacks |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
f8fed7d to
3bfd97e
Compare
Contributor
Author
|
Re-committed with valid GPG signature. Closes #6128 |
925bc72 to
ab80488
Compare
bfa7157 to
fd61e1b
Compare
Contributor
Author
|
Will continue rebasing on top of release tags as they're set. |
79c0686 to
3183087
Compare
6173c3a to
7c36aef
Compare
c954561 to
7fea6e5
Compare
08a4d5a to
34189b4
Compare
bd214cc to
a7d1cc1
Compare
00637c0 to
71e0ba2
Compare
f1ae801 to
08fa7f7
Compare
832c884 to
e968064
Compare
007348a to
e31e7a4
Compare
e31e7a4 to
f0b2c47
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
XML/HTML tags use hardcoded color mappings tied to unrelated tokens (
error,syntaxKeyword,syntaxOperator), preventing custom themes from controlling tag colours independently.Solution
syntaxTag,syntaxAttribute,syntaxTagDelimitertheme-resolver.tsfor testabilityRelated Items
Notes
bun test test/cli/tui/theme.test.ts— all passpackages/web/public/theme.jsonpackages/opencode/src/cli/cmd/tui/context/theme/opencode.json