Skip to content

Sync recording delay with minimumKeyTime setting#100

Merged
kitlangton merged 1 commit into
kitlangton:mainfrom
coleski:feature/configurable-hotkey-delay
Sep 10, 2025
Merged

Sync recording delay with minimumKeyTime setting#100
kitlangton merged 1 commit into
kitlangton:mainfrom
coleski:feature/configurable-hotkey-delay

Conversation

@coleski

@coleski coleski commented Aug 26, 2025

Copy link
Copy Markdown
Contributor

Sync Recording Delay with Hotkey Detection Time

Summary

This PR syncs the recording delay with the user's configured hotkey detection time (minimumKeyTime), replacing the
hardcoded 200ms delay. This ensures the recording behavior accurately reflects the user's preferences and enables much
snappier recording when set below 0.2s.

Changes

  • Updated TranscriptionFeature to use the minimumKeyTime setting from user preferences instead of a hardcoded 200ms
    delay
  • Modified handleHotKeyPressed to accept the configurable delay time as a parameter
  • Cleaned up stale localization entries in Localizable.xcstrings

Why This Matters

The recording delay was previously disconnected from the hotkey detection time, creating an inconsistent experience:

  • Users who set a fast hotkey detection (e.g., 0.1s) still had to wait the full 200ms for recording to start
  • This made the app feel sluggish even when configured for quick response
  • Now the recording delay matches the hotkey detection time, making the app feel much snappier when set below 0.2s
  • Users who prefer longer delays can still configure them for safety against accidental recordings

Testing

  • Verify that changing the minimum key time slider in settings affects the actual recording delay
  • Test with fast delays (0.1s) to confirm snappy response
  • Test with various delay values (0.0s to 1.0s)
  • Ensure double-tap mode still works correctly
  • Confirm press-and-hold recording starts after the configured delay

Summary by CodeRabbit

  • New Features
    • Added a setting to control the delay before recording starts after pressing the hotkey, allowing you to fine-tune responsiveness and reduce accidental activations.
    • Recording initiation now respects your configured delay for a more consistent start/stop experience when tapping or holding the hotkey.

- 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.
@coderabbitai

coderabbitai Bot commented Aug 26, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Hotkey-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

Cohort / File(s) Summary
Transcription hotkey timing
Hex/Features/Transcription/TranscriptionFeature.swift
Replace fixed 200ms pre-record delay with configurable minimumKeyTime from state.hexSettings; plumb value through hotKeyPressed path; internal delay uses Task.sleep(for: .seconds(minimumKeyTime)). No other control paths changed.

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
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I tap the key and pause—just so,
A beat to breathe before I go.
Seconds set by careful paw,
Delay that keeps the jitters raw.
Then whiskers twitch—recording, whee! 🎙️
A hop, a stop, in perfect key. 🐇

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 details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between a72dd96 and 04dc659.

📒 Files selected for processing (1)
  • Hex/Features/Transcription/TranscriptionFeature.swift (2 hunks)
🔇 Additional comments (2)
Hex/Features/Transcription/TranscriptionFeature.swift (2)

85-89: LGTM: using user-configured minimumKeyTime instead of fixed 200ms

Passing state.hexSettings.minimumKeyTime through the hotkey flow keeps recording behavior aligned with the preference. This improves UX consistency with the slider.


201-216: Script sent for verification.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@kitlangton

Copy link
Copy Markdown
Owner

Thank you very much!

@kitlangton kitlangton merged commit d8b65d2 into kitlangton:main Sep 10, 2025
4 of 5 checks passed
@coleski

coleski commented Sep 13, 2025

Copy link
Copy Markdown
Contributor Author

<3

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.

2 participants