-
Notifications
You must be signed in to change notification settings - Fork 1
feat: dictation mode and keybinding #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: dictation mode and keybinding #40
Conversation
…f dictation was stopped
…s actually added to the view
There was a problem hiding this 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.
There was a problem hiding this 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.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…tion cancellation
… to avoid closing the session when we already closing it
andresthor
left a comment
There was a problem hiding this 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
…-talk behave the same as toggle-to-talk
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
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.
event.key) and key codes (fromevent.code)`(backtick)New Components
<dictation-mode-selector>- Tab-based UI for selecting dictation mode<dictation-keybinding-selector>- Interactive key capture input for configuring keyboard shortcutsNew Controller
KeybindingController- Manages global keyboard event handling for keybindingsNew Events
mode-changed- Dispatched when dictation mode changes{ mode: DictationMode }keybinding-changed- Dispatched when keybinding configuration changes{ key: string | null | undefined, code: string | null | undefined }Improvements
Connection Management
Related Issues
Closes GRO-571
Closes GRO-577