Repository navigation
fix(zed-theme): stop the installer from reloading the window manager - #137
Merged
neur0map merged 1 commit intoOct 25, 2026
Conversation
The installer finished by running `ryoku materialize`, which reloads the
compositor. On hybrid NVIDIA multi-monitor setups that re-initialises DRM/KMS,
blanks the monitors and can change the resolution just because someone
installed a Zed theme.
The initial `theme.ts --sync` already writes ryoku-dynamic.json, and the
Matugen post_hook registered right before it applies the theme on the next
palette change, so materialize was never needed. Drop it.
The settings editor was a line regex that only understood
`"theme": "..."`. Zed's current settings use
`"theme": { "mode": ..., "light": ..., "dark": ... }`, so the installer
aborted instead of selecting the theme. Replace the regex with a small
JSONC-aware editor: it masks comments and string bodies (UTF-16 safe, so
emojis do not shift offsets), reads the top-level theme value, and writes
either form while preserving comments, indentation and trailing commas.
Unparseable input is reported and left untouched rather than failing the
install.
Also create the sync command before install-sync.ts registers the hook, so
the hook can never point at a missing executable, and add a regression test
covering every shape, wired into the catalogue workflow.
Bump the bundle to 1.2.0.
Member
|
Thanks for the fix, it's live in the store now. |
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.
Why
Installing Ryoku for Zed ended with
ryoku materialize. That reloads the compositor, which on a hybrid NVIDIA multi-monitor setup re-initialises DRM/KMS: the screens go black and the resolution can change. That is a heavy price for picking a theme.The same run also aborted on current Zed settings. The installer used a line regex that only matched
"theme": "Name", but Zed now writes an object:What changed
No more
ryoku materialize. The initialtheme.ts --syncalready writesryoku-dynamic.json, and thepost_hookregistered moments earlier rebuilds it on the next palette change. Nothing is lost; the screens are left alone.A JSONC-aware settings editor replaces the regex. It masks comments and string bodies (UTF-16 offsets, so emoji cannot shift positions), reads the top-level
themevalue only, and writes:"theme": "..."),dark/lightand filling in whichever key is missing.Comments, indentation and trailing commas are preserved. If the file is not valid JSONC, or its shape is unexpected, the installer prints a warning and continues instead of aborting the install.
Ordering fix: the sync command is now created before
install-sync.tsregisters the Matugen hook, so the hook can never point at a missing executable.install-sync.tsalso refuses a relative path or a command that is not executable.Regression test
tests/ryoku-zed-theme-installer.test.shcovers object form, string form, comments (including an emoji), trailing comments, empty/nested theme objects, root insertion, root arrays, missing settings.json, and the missing-command abort. It also asserts the installer never callsryokuand that both installer copies stay byte-identical. Wired into.github/workflows/validate.yml.Bundle bumped to 1.2.0;
bundle.jsonhashes andbundles/registry.jsonrefreshed.Testing
bash tests/ryoku-zed-theme-installer.test.sh— PASS (Node 26 locally; bundle requires ≥ 22.18)bash tests/validate-catalogue.sh— PASSpython3 tests/validate-store.py— PASSHOMEagainst a copy of a real Zedsettings.json: only thelight/darkvalues changed, comments survived, noryokucall was made.shellcheckis not installed locally; the workflow runs it on merge.Submission checks
This is a fix to an existing bundle, not a new item, so the item checklist applies only where it can.
bundles/ryoku-zed-theme/, manifest and preview images unchanged.version1.2.0 and the regeneratedmanifestSha256.settings.jsonin a throwawayHOME(object theme, comments, trailing commas); the real desktop was not touched.tests/validate-catalogue.shprintscatalogue OK.python3 tests/validate-store.pypasses.python3 tools/security-screen.py --root . --revision HEADreports 0 blocking findings (147 advisory warnings, none in the changed files).post_hookit already owned.