From a1630bdcd867df6c9eee9adf369db3034305531d Mon Sep 17 00:00:00 2001 From: Dmitry Sharabin Date: Wed, 10 Jun 2026 21:38:51 +0200 Subject: [PATCH 1/2] Fix the visible-keys keyup handler (undefined label and element ref) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 element so the fade-out and removal target it. Co-Authored-By: Claude Opus 4.8 (1M context) --- visible-keys/plugin.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/visible-keys/plugin.js b/visible-keys/plugin.js index d3b8f32..b1061f0 100644 --- a/visible-keys/plugin.js +++ b/visible-keys/plugin.js @@ -30,7 +30,7 @@ Inspire.hooks.add("slidechange", env => { "keyup", (listener = async evt => { if (keys.has(evt.key) && evt.target.nodeName != "TEXTAREA") { - label = evt.key; + let label = evt.key; for (let key in symbols) { label = label.replace(key, symbols[key]); @@ -47,9 +47,10 @@ Inspire.hooks.add("slidechange", env => { "beforeend", `${label}`, ); + let kbd = env.slide.lastElementChild; - await key.animate([{ opacity: 0 }], { duration: 400, delay }).finished; - key.remove(); + await kbd.animate([{ opacity: 0 }], { duration: 400, delay }).finished; + kbd.remove(); } }), ); From 019bb32fb85853e8fcd2621c06a86661850435b5 Mon Sep 17 00:00:00 2001 From: Dmitry Sharabin Date: Wed, 10 Jun 2026 21:48:27 +0200 Subject: [PATCH 2/2] Load the visible-keys plugin's stylesheet (hasCSS was missing) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- visible-keys/plugin.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/visible-keys/plugin.js b/visible-keys/plugin.js index b1061f0..5944d74 100644 --- a/visible-keys/plugin.js +++ b/visible-keys/plugin.js @@ -1,6 +1,8 @@ // Display certain keys pressed import Inspire from "@inspirejs/core"; +export const hasCSS = true; + export const symbols = { Tab: "⇥", Enter: "⏎",