Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: rapid reader spacebar no longer triggers voice mic; hotkey unhides widget

Adam Eivy769af26b373a
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 2ccb90023c..28dee94040 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -8,6 +8,8 @@
- **Image Gen status badge stuck on "SD API unreachable" when Local mode is selected.** The page mounts before settings load, so the first `refreshStatus` call goes out with `mode=external` (the fallback in `effectiveMode = selectedMode || status?.mode || 'external'`). The local-mode probe that fires moments later (after settings populate `selectedMode='local'`) returns instantly because it just checks if the Python path is set — but the original external-mode probe is still in flight, blocking on a TCP timeout against the unconfigured SD API URL. When that slow response finally arrived, it overwrote the green "mflux/local" badge with the red "SD API unreachable — Settings" message, even though the Local chip was clearly selected. Token-guarded `refreshStatus` so each call records a monotonically incrementing token and only applies its `setStatus` if its token still matches the latest one — stale responses get silently dropped. File: `client/src/pages/ImageGen.jsx`.
+- **Rapid Reader spacebar prompted for microphone access; global spacebar started the mic without showing the FAB.** The Rapid Reader's keydown listener and the Voice Widget's hotkey listener were both bound to `window` in the bubble phase, so pressing space to play/pause the reader also fired the voice agent's mic toggle (which then prompted for mic permission). And when the user pressed the global voice hotkey while the widget was hidden, capture started but the FAB and sidebar mic icon stayed in their "off" state because nothing flipped `voice.hidden` back to `0`. Fixes: (1) Rapid Reader now registers its keydown in the capture phase and calls `e.stopImmediatePropagation()` for handled keys, so the voice widget's bubble-phase listener never sees the event. (2) When the voice hotkey fires while the widget is hidden, the handler now calls `writeVoiceHidden(false)` which dispatches `VISIBILITY_EVENT` — the existing sync listener picks it up, the FAB renders, and the sidebar `VoiceToggleButton` flips to the engaged Mic icon. Files: `client/src/components/RapidReader.jsx`, `client/src/components/voice/VoiceWidget.jsx`.
+
## Changed
- **Pin all `package.json` dependencies and overrides to exact versions.** Removed `^` ranges from every dep/override across root, `server/`, and `client/` `package.json` files (e.g. `kokoro-js: ^1.2.1` → `1.2.1`; overrides like `path-to-regexp`, `lodash`, `basic-ftp`, `follow-redirects`, `brace-expansion`, `socket.io-parser`, and the nested `minimatch@3 → brace-expansion`). Lockfiles refreshed with no resolved-version drift — a defensive pin so future installs can't pick up a freshly-published patch in the override graph without an explicit bump.
diff --git a/client/src/components/RapidReader.jsx b/client/src/components/RapidReader.jsx
index 77c754e54d..3258312df7 100644
--- a/client/src/components/RapidReader.jsx
+++ b/client/src/components/RapidReader.jsx
@@ -98,19 +98,27 @@ export default function RapidReader({
}, [playing, idx, total, current, delayFor, onComplete]);
// Keyboard controls — only active when this component is mounted.
+ // Registered in the capture phase so we run before bubble-phase window
+ // listeners (notably VoiceWidget's hotkey, which also claims Space). When
+ // we handle a key we call stopImmediatePropagation so the voice agent
+ // doesn't toggle its mic on the same press.
useEffect(() => {
const onKey = (e) => {
- if (e.target?.tagName === 'INPUT' || e.target?.tagName === 'TEXTAREA') return;
- if (e.key === ' ') { e.preventDefault(); setPlaying((p) => !p); }
+ const tag = e.target?.tagName;
+ if (tag === 'INPUT' || tag === 'TEXTAREA' || e.target?.isContentEditable) return;
+ if (e.key === ' ') setPlaying((p) => !p);
else if (e.key === 'ArrowLeft') setIdx((i) => Math.max(0, i - 1));
else if (e.key === 'ArrowRight') setIdx((i) => Math.min(total - 1, i + 1));
else if (e.key === 'r' || e.key === 'R') { setIdx(0); setPlaying(true); }
else if (e.key === '+' || e.key === '=') setWpm((w) => Math.min(1200, w + 25));
else if (e.key === '-' || e.key === '_') setWpm((w) => Math.max(100, w - 25));
else if (e.key === 'Escape' && onClose) onClose();
+ else return;
+ e.preventDefault();
+ e.stopImmediatePropagation();
};
- window.addEventListener('keydown', onKey);
- return () => window.removeEventListener('keydown', onKey);
+ window.addEventListener('keydown', onKey, true);
+ return () => window.removeEventListener('keydown', onKey, true);
}, [total, onClose]);
const restart = () => { setIdx(0); setPlaying(true); };
diff --git a/client/src/components/voice/VoiceWidget.jsx b/client/src/components/voice/VoiceWidget.jsx
index 1f6ce6ef4b..def4683010 100644
--- a/client/src/components/voice/VoiceWidget.jsx
+++ b/client/src/components/voice/VoiceWidget.jsx
@@ -381,6 +381,9 @@ export default function VoiceWidget() {
// Hotkey toggles listening (press once to start, press again to send).
// Ignored while focus is on an input/textarea so typing isn't hijacked.
+ // If the widget is currently hidden, the hotkey also un-hides it so the
+ // FAB/sidebar mic icon reflect the live mic state — otherwise the user
+ // hears no audio cue and has no UI to confirm the mic is open.
useEffect(() => {
if (!enabled) return;
const isTypingTarget = (el) => {
@@ -392,11 +395,14 @@ export default function VoiceWidget() {
if (e.code !== hotkey || e.repeat) return;
if (isTypingTarget(document.activeElement)) return;
e.preventDefault();
+ // writeVoiceHidden dispatches VISIBILITY_EVENT, which the listener
+ // below syncs into local `hidden` — no explicit setHidden needed.
+ if (hidden) writeVoiceHidden(false);
toggleCapture();
};
window.addEventListener('keydown', onKey);
return () => window.removeEventListener('keydown', onKey);
- }, [enabled, hotkey, toggleCapture]);
+ }, [enabled, hotkey, hidden, toggleCapture]);
// Settings → Voice can toggle widget visibility without a reload. Listen for
// the custom event and the storage event (covers other tabs).