Repository navigation
fix(ryoku-zed-theme): derive a real light variant when the palette renders dark - #237
Open
Matcraft94 wants to merge 2 commits into
Open
Matcraft94 wants to merge 2 commits into
Matcraft94 wants to merge 2 commits into
Conversation
…nders dark Ryoku's palette plane can render a single dark scheme into both matugen template variants, so 'Ryoku Dynamic Light' shipped with the same dark surfaces as Dark (background luminance ~0.01). Zed users who switch to light mode got a dark editor while the rest of the system went light. Sync now checks each variant's surface luminance against its declared appearance. When they disagree, it rebuilds the variant from the opposite one: hue and chroma are preserved, lightness is mirrored across the source theme's own background-to-text OKLCH range (clamped to the gamut), and the existing improve() pass re-enforces WCAG AA contrast. The dark variant output is byte-identical to before when the source is sane. Bump the bundle to 1.2.1 and refresh the manifest and registry hashes.
Member
🦊 mika's reviewNo 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. |
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.
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
Ryoku Dynamic Lightshipped with the same dark surfaces as Dark: Ryoku's palette plane renders a single dark scheme into both matugen template variants, so the light variant's background arrived at luminance ~0.01. A Zed user switching to light mode got a dark editor while the rest of the system went light.Fix
theme.ts --syncnow validates each variant's surface luminance against its declared appearance. When they disagree, the variant is rebuilt from the opposite one:improve()pass re-runs afterwards, so WCAG AA contrast (≥ 4.5:1) is re-enforced on the derived variantWhen the source palette is sane, the output is byte-identical to before — the derivation only fires on the mismatch.
Second commit:
syntaxHueOffsetsgainsenum(240, thetypeoffset) andvariant(280, theconstructoroffset), so the new template scopes from Ryoku-dev/ryoku#1063 follow their siblings' hue rotation instead of staying gray under a grayscale wallpaper (found by Greptile on that PR).Verification
Ryoku Dynamic Lightbackground#131317(luminance 0.007)#fbfbff(luminance 0.967), editor#f4f4ff, text#1f1f1f; syntax 4.50:1 and UI text 4.50:1 floors holdenumrenders the same hue astype,variantasconstructor, in both variants--verify-monochromepasses;tests/ryoku-zed-theme-installer.test.shpasses;tests/validate-catalogue.shpassesBundle bumped to 1.2.1 with refreshed manifest and registry hashes.