Skip to content

Fix the visible-keys plugin (keyup crash + missing stylesheet)#7

Merged
DmitrySharabin merged 2 commits into
mainfrom
fix-bundled-plugins
Jun 11, 2026
Merged

Fix the visible-keys plugin (keyup crash + missing stylesheet)#7
DmitrySharabin merged 2 commits into
mainfrom
fix-bundled-plugins

Conversation

@DmitrySharabin

@DmitrySharabin DmitrySharabin commented Jun 10, 2026

Copy link
Copy Markdown
Member

Two bugs in the visible-keys plugin, both meaning the indicator never actually appeared.

Crash on keypress

The keyup handler did label = … (undeclared → ReferenceError: label is not defined) and then referenced key — the out-of-scope for…in loop variable — to animate/remove the indicator. So pressing a watched key threw, and no <kbd> was shown. Declare label, and capture the inserted <kbd> element for the fade-out and removal.

Stylesheet never loaded

visible-keys/plugin.css styles the kbd.visible-key indicator, but the plugin didn't export const hasCSS = true, so the core loader skipped it. Added the export.

Verified (Playwright)

Pressing a watched key now creates the styled <kbd> indicator (was a ReferenceError with no element); core injects <link id="plugin-css-visible-keys">.

Related

Same missing-hasCSS bug, fixed per-plugin: timer (#5), resolution (#6).

🤖 Generated with Claude Code

DmitrySharabin and others added 2 commits June 10, 2026 21:48
Pressing a watched key threw `ReferenceError: label is not defined`
(label was never declared), and even past that it referenced `key` — the
out-of-scope `for…in` loop variable — to animate and remove the
indicator. Declare `label`, and capture the inserted <kbd> element so the
fade-out and removal target it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
visible-keys/plugin.css styles the `kbd.visible-key` indicator, but the
plugin didn't export `hasCSS`, so the core loader — which injects
plugin.css only when `module.hasCSS` is truthy — skipped it and the
indicator was unstyled. Export hasCSS = true.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@DmitrySharabin DmitrySharabin changed the title Fix the bundled plugins (timer, resolution, visible-keys) Fix the visible-keys plugin (keyup crash + missing stylesheet) Jun 10, 2026
@DmitrySharabin DmitrySharabin merged commit c2c1bd3 into main Jun 11, 2026
@DmitrySharabin DmitrySharabin deleted the fix-bundled-plugins branch June 11, 2026 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants