Repository navigation
[ryoku] zed: add the missing syntax scopes to the matugen template - #1063
Matcraft94 wants to merge 2 commits into
Conversation
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
🦊 mika's reviewIncremental 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.
🦊 Generated by Mika — the Ryoku org's self-hosted AI code reviewer. Machine findings: verify before merging. |
| "enum": { | ||
| "color": "{{colors.primary_fixed.dark.hex}}", | ||
| "font_style": null, | ||
| "font_weight": null |
There was a problem hiding this 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 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.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
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.
|
Thanks @greptile-apps. Both findings addressed:
|
|
Thanks—both findings are addressed in the current changes. I confirmed the changelog entry is in PR #1063, and ryostore#237 adds the |
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,variantEach new scope maps to an existing Material role already used by its nearest sibling (
attributeandtype.builtinshare thetyperole,enumfollowstype,variantfollowsconstructor, 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_editsoverlay, thenmatugen -c active-apps.toml json matugen-carrier.json, the same invocation the shell daemon uses):Notes
titleships withfont_weight: 700so markdown headings read as headings; everything else stays regular weight, matching the template's existing style.Confidence Score: 5/5

The PR appears safe to merge, with the previously reported sibling-color mismatch remaining non-blocking.Findings
Fix with agent prompt
Summary
Adds 11 syntax scopes to both Zed theme variants.
Reviews (2) · Last reviewed commit: "[ryoku] zed: changelog entry for the new..." · Reviewed by Greptile