Skip to content

[ryoku] zed: add the missing syntax scopes to the matugen template - #1063

Open
Matcraft94 wants to merge 2 commits into
Ryoku-dev:unstable-devfrom
Matcraft94:zed-syntax-scopes
Open

Matcraft94 wants to merge 2 commits into
Ryoku-dev:unstable-devfrom
Matcraft94:zed-syntax-scopes

Conversation

@Matcraft94

@Matcraft94 Matcraft94 commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

What changed

The Zed matugen template styled 27 tree-sitter captures. Zed themes support more, and the dynamic theme pipeline (ryoku-zed-theme) already carried a hue rule for one of them (attribute) that never rendered because the template did not define it.

This adds the 11 captures that carry real weight in everyday code and markup:

attribute, constant.builtin, embedded, enum, label, link_text, link_uri, preproc, title, type.builtin, variant

Each new scope maps to an existing Material role already used by its nearest sibling (attribute and type.builtin share the type role, enum follows type, variant follows constructor, and so on), so the theme generator's hue distribution and WCAG AA contrast floor apply to them unchanged. Both the dark and light template blocks gain the same scopes.

How it was tested

Rendered through the live pipeline on a running system (template forked into the user_edits overlay, then matugen -c active-apps.toml json matugen-carrier.json, the same invocation the shell daemon uses):

  • both variants render 38 scopes, all 11 additions present
  • the generator's own gates pass: syntax contrast floor 9.88:1 (dark) and 4.50:1 (light), UI text 4.50:1 in both
  • no change to any existing scope's color

Notes

title ships with font_weight: 700 so markdown headings read as headings; everything else stays regular weight, matching the template's existing style.

Confidence Score: 5/5RetriggerView in Greptile

The PR appears safe to merge, with the previously reported sibling-color mismatch remaining non-blocking.

FindingsFix All in Claude Code

  1. P2 New scopes miss sibling colors ▶
Fix with agent prompt
### Issue 1
ryoku/shell/matugen/templates/zed.json:210-213
The new `enum` and `variant` entries do not keep their sibling colors in the dynamic theme. The [theme generator](https://github.com/ryoku-dev/ryostore/blob/HEAD/installers/ryoku-zed-theme.sh#L119-L158) changes the hues of `type` and `constructor`, but `enum` and `variant` match no rule and keep the original palette hues. With a grayscale wallpaper, the new scopes stay gray while their siblings become colored. Add matching hue rules alongside these scopes.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Adds 11 syntax scopes to both Zed theme variants.

  • Zed themes now color more code and markup captures.

Reviews (2) · Last reviewed commit: "[ryoku] zed: changelog entry for the new..." · Reviewed by Greptile

The Zed template styled 27 tree-sitter captures; Zed themes support
more, and the dynamic pipeline already carried a hue rule for one of
them (attribute) that never rendered because the template did not
define it. Add the 11 captures that carry real weight in everyday
code and markup: attribute, constant.builtin, embedded, enum, label,
link_text, link_uri, preproc, title, type.builtin, and variant.

Each new scope maps to an existing Material role already used by its
nearest sibling (attribute and type.builtin share the type role, enum
follows type, variant follows constructor, and so on), so the theme
generator's hue distribution and WCAG AA contrast floor apply to them
unchanged. Rendered with a live palette, both variants pass the
generator's checks: dark at a 9.88:1 syntax floor, light at 4.50:1.

Note: New: Zed syntax highlighting now covers enums, attributes, labels, preprocessor directives, and markdown titles and links
@neur0map

neur0map commented Dec 5, 2026 •

Copy link
Copy Markdown
Member

🦊 mika's review

Incremental review: new commits since the last checkpoint.

No actionable findings. Mika looked for bugs, security issues, and risks in the diff and came up empty on clear defects.

⚠️ Partial run: describe: after 3 attempts: llm: hermes rate_limited; review: after 3 attempts: llm: hermes rate_limited


🦊 Generated by Mika — the Ryoku org's self-hosted AI code reviewer. Machine findings: verify before merging.

@neur0map neur0map added area:ryoku Ryoku project area type:feature A feature request labels Dec 5, 2026
Comment on lines +210 to +213
"enum": {
"color": "{{colors.primary_fixed.dark.hex}}",
"font_style": null,
"font_weight": null

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 New scopes miss sibling colors

The new enum and variant entries do not keep their sibling colors in the dynamic theme. The theme generator changes the hues of type and constructor, but enum and variant match no rule and keep the original palette hues. With a grayscale wallpaper, the new scopes stay gray while their siblings become colored. Add matching hue rules alongside these scopes.

Prompt To Fix With AI
This is a comment left during a code review.
Path: ryoku/shell/matugen/templates/zed.json
Line: 210-213

Comment:
**New scopes miss sibling colors**

The new `enum` and `variant` entries do not keep their sibling colors in the dynamic theme. The [theme generator](https://github.com/ryoku-dev/ryostore/blob/HEAD/installers/ryoku-zed-theme.sh#L119-L158) changes the hues of `type` and `constructor`, but `enum` and `variant` match no rule and keep the original palette hues. With a grayscale wallpaper, the new scopes stay gray while their siblings become colored. Add matching hue rules alongside these scopes.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Claude Code Fix in Codex

Comment thread ryoku/shell/matugen/templates/zed.json Resolved
The template change is user-visible, so it gets its ryoku/shell
CHANGELOG.md entry per CONTRIBUTING.

Note: New: Zed syntax highlighting now covers enums, attributes, labels, preprocessor directives, and markdown titles and links
Matcraft94 pushed a commit to Matcraft94/ryostore that referenced this pull request Dec 5, 2026
The template's new enum and variant scopes matched no rule in
syntaxHueOffsets, so the generator re-hued type and constructor while
enum and variant kept the raw palette hues. With a grayscale wallpaper
the siblings turned colored and the new scopes stayed gray. Give enum
the type offset (240) and variant the constructor offset (280) so each
follows its sibling under every palette. Verified: enum renders the
same hue as type and variant as constructor in both variants, and the
monochrome validation still passes.

Found by Greptile on Ryoku-dev/ryoku#1063.
@Matcraft94

Copy link
Copy Markdown
Contributor Author

Thanks @greptile-apps. Both findings addressed:

  1. enum/variant hues: valid — those scopes matched no rule in the generator's syntaxHueOffsets, so they would keep raw palette hues under a grayscale wallpaper while type/constructor rotate. Fixed in fix(ryoku-zed-theme): derive a real light variant when the palette renders dark ryostore#237 (second commit): enum takes the type offset (240) and variant the constructor offset (280). Verified enum renders the same hue as type and variant as constructor in both variants; monochrome validation passes.
  2. CHANGELOG: added the ryoku/shell/CHANGELOG.md Unreleased entry in the latest commit on this branch.

@greptile-apps

greptile-apps Bot commented Dec 5, 2026

Copy link
Copy Markdown

Thanks—both findings are addressed in the current changes. I confirmed the changelog entry is in PR #1063, and ryostore#237 adds the enum and variant hue offsets with the reported verification. One caveat: ryostore#237 is still open, so those offsets depend on that change being merged and shipped.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ryoku Ryoku project area type:feature A feature request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants