Skip to main content

Settings shortcuts documented and empty clip timer fixed

· 2 min read
Brain Research Visualizer

EXEPERT now treats visualizer keyboard controls as documented commands instead of hidden global behavior, and the right-panel clip preview no longer pretends a video is loaded when the stimulus slot is empty.

What changed

  • src/ui/keyboard-shortcuts.ts adds a shared registry for visible keyboard commands and a guard that decides whether global scene shortcuts should run.
  • src/events.ts now scopes the visualizer shortcuts so Space, A, and S only affect the 3D scene when focus is outside inputs, buttons, chat, search, Settings, diagnostics, prompt playground, and lil-gui controls.
  • index.html adds a Keyboard Shortcuts & Commands card to Settings and changes the initial clip preview from a fake 0:06 duration to an explicit empty state.
  • src/ui/workbench.ts renders the Settings command list from the shortcut registry so the visible docs match the active runtime behavior.
  • src/ui/media-duration.ts centralizes duration labels: no stimulus shows :, images show Still, videos show their metadata duration, and unknown loaded media shows Loaded.
  • src/brain-ui.ts now resets cleared media to an empty state, waits for video metadata before showing a duration badge, and removes the clip-thumb badge when no stimulus is loaded.
  • css/app.css adds the empty clip thumbnail style and responsive Settings shortcut rows with compact kbd chips, scope labels, and wrapped descriptions.
  • src/__tests__/keyboard-shortcuts.test.ts and src/__tests__/media-duration.test.ts cover the shortcut guard and duration label behavior.

User impact

  • Pressing A, S, or Space while typing in Chat or interacting with Settings no longer toggles visualizer helpers by accident.
  • Settings now lists the app's current global and contextual commands, including Search, Diagnostics, Chat send, model picker navigation, and the Floor Platform visualizer command.
  • Fresh app load and cleared clips show Duration : and a muted No clip thumbnail instead of 0:06.
  • Uploaded images show Still instead of a fake video duration; uploaded videos show their real metadata duration once available.

Verification

Checked locally with:

pnpm typecheck
pnpm exec vitest run src/__tests__/keyboard-shortcuts.test.ts src/__tests__/media-duration.test.ts
pnpm build

The browser smoke test opened http://localhost:9001/, confirmed the empty clip state, confirmed the Settings list rendered nine command rows, and verified A, S, and Space type normally inside the Chat input.