Skip to content

Conversation

@markitosha
Copy link
Contributor

@markitosha markitosha commented Jan 5, 2026

Summary

This PR adds support for two dictation modes (toggle-to-talk and push-to-talk) and keyboard shortcut (keybinding) configuration. It also improves connection management by using connection pausing instead of closing connections when recording stops.

What Changed

New Features

Dictation Modes

  • Toggle-to-Talk (default): Click/tap to start recording, click/tap again to stop
  • Push-to-Talk: Press and hold to record, release to stop

Keyboard Shortcuts (Keybindings)

It was considered to add key combinations, but I decided to keep it simple at this time. We can add it later if requested, as well as other keybinding interfaces.

  • Configurable keyboard shortcuts to start/stop recording
  • Supports both key names (from event.key) and key codes (from event.code)
  • Automatically ignored when typing in input fields, textareas, or contenteditable elements
  • Default keybinding: ` (backtick)

New Components

  • <dictation-mode-selector> - Tab-based UI for selecting dictation mode
  • <dictation-keybinding-selector> - Interactive key capture input for configuring keyboard shortcuts

New Controller

  • KeybindingController - Manages global keyboard event handling for keybindings

New Events

  • mode-changed - Dispatched when dictation mode changes
    • Detail: { mode: DictationMode }
  • keybinding-changed - Dispatched when keybinding configuration changes
    • Detail: { key: string | null | undefined, code: string | null | undefined }

Improvements

Connection Management

  • Changed from closing WebSocket connections to pausing them when recording stops
  • Allows for faster reconnection when resuming recording
  • Better resource management and performance
  • We do a real reconnection only when proxy or dictation configurations are updated: we can safely close sockets there since we know that the whole queue has been processed

Related Issues

Closes GRO-571
Closes GRO-577

@markitosha markitosha self-assigned this Jan 5, 2026
@linear
Copy link

linear bot commented Jan 5, 2026

@markitosha markitosha requested a review from Copilot January 5, 2026 13:15
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds dictation mode and keybinding features to support both toggle-to-talk and push-to-talk recording modes with keyboard shortcut functionality.

  • Adds two dictation modes: toggle-to-talk (click to start/stop) and push-to-talk (press and hold)
  • Implements keyboard shortcut support with platform-aware key normalization
  • Updates the WebSocket connection logic to handle configuration changes and reuse existing connections

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/types.ts Defines DictationMode and Keybinding types, adds mode and keybinding to ConfigurableSettings
src/utils/keybinding.ts Implements keybinding utilities for key normalization, matching, and platform detection
src/utils/events.ts Adds mode-changed and keybinding-changed event creators
src/controllers/keybinding-controller.ts Implements keyboard event handling for both dictation modes
src/controllers/dictation-controller.ts Updates WebSocket connection logic to detect config changes and reuse connections
src/contexts/dictation-context.ts Adds mode and keybinding context providers and event handlers
src/components/mode-selector.ts New component for selecting between toggle-to-talk and push-to-talk modes
src/components/keybinding-selector.ts New component for capturing and displaying keyboard shortcuts
src/components/recording-button.ts Updates button behavior to support both dictation modes with mouse and keyboard events
src/components/settings-menu.ts Integrates mode and keybinding selectors into settings UI
src/components/corti-dictation.ts Adds mode and keybinding properties to main component
src/styles/*.ts Adds styling for new components and extracts shared label styles
src/index.ts Exports new components and types
stories/*.stories.ts Updates stories with new settings options and event handlers
docs/API_REFERENCE.md Documents new components, properties, and events
README.md Adds usage examples for dictation modes and keyboard shortcuts

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@markitosha markitosha requested a review from Copilot January 5, 2026 13:37
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 23 out of 23 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

markitosha and others added 3 commits January 5, 2026 14:41
@markitosha markitosha requested a review from tve-corti January 5, 2026 13:48
tve-corti
tve-corti previously approved these changes Jan 6, 2026
andresthor
andresthor previously approved these changes Jan 7, 2026
Copy link

@andresthor andresthor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm quite tired so I can't say I've got a full picture 😅

But I'm approving with just a couple of questions/nits

andresthor
andresthor previously approved these changes Jan 7, 2026
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.

4 participants