Sync recording delay with minimumKeyTime setting#100
Conversation
- Replace hardcoded 200ms delay with user-configurable minimumKeyTime - Pass minimumKeyTime from state to handleHotKeyPressed function This allows users to customize how long they need to hold the hotkey before recording starts, improving the user experience for different recording styles.
WalkthroughHotkey-triggered recording now respects a configurable delay. The feature reads minimumKeyTime from state.hexSettings, passes it through the hotKeyPressed path, and uses Task.sleep(for: .seconds(minimumKeyTime)) instead of a fixed 200ms wait. Cancellation and key-release behavior remain unchanged. No public API changes. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant HK as Hotkey Manager
participant TF as TranscriptionFeature
participant Rec as Recorder
User->>HK: Press hotkey
HK->>TF: hotKeyPressed(minimumKeyTime from state.hexSettings)
note over TF: Start async task<br/>wait minimumKeyTime
TF-->>TF: Task.sleep(seconds: minimumKeyTime)
TF->>Rec: startRecording()
alt User releases early (before delay)
User->>HK: Release hotkey
HK->>TF: hotKeyReleased()
TF->>Rec: cancel/skip start
else Normal flow
User->>HK: Release hotkey after start
HK->>TF: hotKeyReleased()
TF->>Rec: stopRecording()
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. 📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (1)
🔇 Additional comments (2)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
|
Thank you very much! |
|
<3 |
Sync Recording Delay with Hotkey Detection Time
Summary
This PR syncs the recording delay with the user's configured hotkey detection time (
minimumKeyTime), replacing thehardcoded 200ms delay. This ensures the recording behavior accurately reflects the user's preferences and enables much
snappier recording when set below 0.2s.
Changes
TranscriptionFeatureto use theminimumKeyTimesetting from user preferences instead of a hardcoded 200msdelay
handleHotKeyPressedto accept the configurable delay time as a parameterLocalizable.xcstringsWhy This Matters
The recording delay was previously disconnected from the hotkey detection time, creating an inconsistent experience:
Testing
Summary by CodeRabbit