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: let Space open a <select> instead of the voice mic (#4731)

[._.]/ Adam Eivy940c672f0e95
diff --git a/client/src/components/voice/VoiceWidget.jsx b/client/src/components/voice/VoiceWidget.jsx
index ac208d5704..ae486465a7 100644
--- a/client/src/components/voice/VoiceWidget.jsx
+++ b/client/src/components/voice/VoiceWidget.jsx
@@ -26,6 +26,7 @@ import {
} from '../../services/voiceVisibility';
import { MicroGlyph } from '../micrographics';
import { isButtonActivation } from '../../lib/a11yKeyboard';
+import { isEditableTarget } from '../../hooks/useKeyboardShortcuts';
import { safeReadStorage, safeWriteStorage } from '../../lib/safeStorage';
// Peak below this (0..1) is usually whisper's [BLANK_AUDIO] territory.
@@ -582,14 +583,11 @@ export default function VoiceWidget() {
// hears no audio cue and has no UI to confirm the mic is open.
useEffect(() => {
if (!enabled) return;
- const isTypingTarget = (el) => {
- if (!el) return false;
- const tag = el.tagName;
- return tag === 'INPUT' || tag === 'TEXTAREA' || el.isContentEditable;
- };
const onKey = (e) => {
if (e.code !== hotkey || e.repeat) return;
- if (isTypingTarget(document.activeElement)) return;
+ // The shared guard, not a local copy: it also covers SELECT, where the default
+ // Space hotkey would open the mic instead of the element's own dropdown.
+ if (isEditableTarget(e.target)) return;
// Space on a focused button must ACTIVATE it (standard browser behavior).
// With the default Space hotkey, preventDefault-ing here would swallow
// every keyboard button press in the app and open the mic instead — e.g.
diff --git a/client/src/hooks/README.md b/client/src/hooks/README.md
index af63ab4863..aa51281d2a 100644
--- a/client/src/hooks/README.md
+++ b/client/src/hooks/README.md
@@ -107,7 +107,7 @@ grep -i "what you want to do" client/src/hooks/README.md
| `useStoryImportIntake` | Story Builder "Import a finished work" intake: the form fields plus the analyze → commit → create-session workflow, in one `{ ...state, patch, analyze, retryIssues, importAndBuild }` bag. | Call from the always-mounted Story Builder index and pass down as `intake` — holding this in the panel loses the manuscript and analysis on an intake tab flip (#3904). |
| `useRowDraft` | Multi-column row draft (analogue of `useFieldDraft`). | Multi-column row that commits as a unit. |
| `usePendingListRows` | List-of-rows where a new row is held client-side until a required column fills, then promoted to `onChange`. | Editable list whose nameless rows would otherwise be dropped by the server sanitizer (WardrobeSection, CharacterDetailEditor list sections). |
-| `useKeyboardControls` | Keyboard binding for OpenWorld mode toggle. | OpenWorld-specific. |
+| `useKeyboardControls` | Held-key Set for the OpenWorld rig plus the Tab mode toggle. Keydowns aimed at an editable field, or fired while an `aria-modal` dialog is open, are ignored — movement is for the world behind the UI. Keyup and the window `blur` reset are deliberately ungated, so a key held when a dialog opens still clears. | OpenWorld-specific. A surface that must CLAIM a key an app-global handler binds wants `useKeyCapture` instead. |
| `useFirstTouchHint` | `{ visible, showOnFirstTouch }` — reveals a brief one-time touch gesture hint, then auto-hides it. | 3D canvases whose primary one-finger gesture needs an initial explanation. |
| `useKeyCapture` | `useKeyCapture({ enabled?, enabledInDialog?, onKeyDown, onKeyUp })` — capture-phase window listener whose handler *claims* an event by returning `true`; a claimed event is `preventDefault`ed AND `stopImmediatePropagation`ed so no app-global bubble handler sees it. Events from editable fields are never offered (shares `isEditableTarget`), nor are events fired while an `aria-modal` dialog is open (`{ enabledInDialog: true }` for a surface that lives INSIDE one — same name and default as `useKeyboardShortcuts`). Each listener subscribes only when its handler is supplied. | A surface that must own a key an app-global handler already binds — chiefly Space, which the voice widget uses for push-to-talk: the POST cognitive drills (n-back, go/no-go, reaction-time), the Morse keyer, RapidReader, the OpenWorld playback transport, and the exploration-mode jump key. Not for ordinary shortcuts (that is `useKeyboardShortcuts`). |
| `useKeyboardShortcuts` | `useKeyboardShortcuts(active, bindings, opts?)` — fire a `{ key: handler }` map while `active`; ignores events from editable fields (`isEditableTarget` also exported), ⌘/Ctrl/Alt chords, OS key auto-repeat (`{ ignoreRepeat: false }` to opt back in), and any keystroke while an `aria-modal` dialog is open (`{ enabledInDialog: true }` for a modal-owned shortcut); a falsy handler disables that key. | Single-surface action shortcuts (editorial comment card prev/next + accept/dismiss/generate, #1603). Not for held-key/game input (that's `useKeyboardControls`). |