Skip to content

Auto Pause #1204

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Auto Pause #1204

wants to merge 2 commits into from

Conversation

plyght
Copy link
Collaborator

@plyght plyght commented Jul 24, 2025

No description provided.

Copy link

coderabbitai bot commented Jul 24, 2025

📝 Walkthrough

Walkthrough

A new "auto-pause after silence" feature was introduced, allowing users to configure automatic pausing of recordings after a specified duration of silence. This involved updating settings schemas, UI components, Rust backend types, and audio processing logic to support and act on this new configuration. Localization files were updated with new translation entries. Additionally, formatting improvements were made in TypeScript bindings, and a new plugin scaffold was added.

Changes

File(s) Change Summary
apps/desktop/src/components/settings/views/general.tsx Added autoPauseSilenceMinutes field to settings schema, form, and UI. Integrated with config logic.
crates/db-user/src/config_types.rs Added auto_pause_silence_minutes optional field to ConfigGeneral struct and default impl.
plugins/db/js/bindings.gen.ts Refactored formatting; added auto_pause_silence_minutes to ConfigGeneral type.
plugins/listener/src/fsm.rs Implemented silence detection and automatic session pausing logic based on new config field.
apps/desktop/src/locales/en/messages.po
apps/desktop/src/locales/ko/messages.po
Updated translation source references; added entries for new auto-pause setting and description.
apps/desktop/src/components/toast/model-download.tsx Reformatted useEffect dependency array for readability.
plugins/listener/Cargo.toml Added hypr-notification2 dependency.
plugins/meeting-automation/Cargo.toml
plugins/meeting-automation/src/lib.rs
Added new plugin scaffold with Cargo.toml and placeholder lib.rs.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant SettingsUI
    participant Backend (Rust)
    participant AudioProcessor

    User->>SettingsUI: Selects auto-pause silence duration
    SettingsUI->>Backend (Rust): Saves config with auto_pause_silence_minutes
    Backend (Rust)->>AudioProcessor: Passes silence duration config
    AudioProcessor->>AudioProcessor: Monitors audio streams for silence
    AudioProcessor-->>Backend (Rust): Triggers auto-pause if silence exceeds threshold
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~18 minutes

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch plyght/auto-pause

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:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • 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. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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.

Documentation and Community

  • 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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🔭 Outside diff range comments (1)
plugins/meeting-automation/Cargo.toml (1)

1-9: Add essential package metadata and declare baseline dependencies

The manifest compiles but will fail cargo publish linting and lacks information other crates rely on.
Include license, repository, keywords, and tauri-related deps; replace the placeholder author.

 [package]
 name = "tauri-plugin-meeting-automation"
 version = "0.1.0"
-authors = ["You"]
+authors = ["ACME <[email protected]>"]
+license = "MIT OR Apache-2.0"
+repository = "https://github.com/acme/your-repo"
+keywords = ["tauri", "meeting", "automation"]
+categories = ["gui", "productivity"]
 edition = "2021"
 description = "Meeting automation plugin"

 [dependencies]
+# Keep versions aligned with the workspace root
+tauri = { version = ">=1.5", default-features = false }
+tauri-plugin = { version = ">=2.0", features = ["macros"] }

These additions satisfy cargo’s metadata checks and let downstream consumers compile the plugin immediately.

🧹 Nitpick comments (1)
apps/desktop/src/locales/ko/messages.po (1)

379-385: Translation entries added but Korean translations pending.

The new auto-pause feature message entries are properly structured with correct source references, but the Korean translations (msgstr) are still empty and will need to be provided.

Consider adding Korean translations for the new auto-pause feature strings to maintain localization completeness.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4d26bf7 and 2a71465.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (10)
  • apps/desktop/src/components/settings/views/general.tsx (5 hunks)
  • apps/desktop/src/components/toast/model-download.tsx (1 hunks)
  • apps/desktop/src/locales/en/messages.po (9 hunks)
  • apps/desktop/src/locales/ko/messages.po (9 hunks)
  • crates/db-user/src/config_types.rs (2 hunks)
  • plugins/db/js/bindings.gen.ts (1 hunks)
  • plugins/listener/Cargo.toml (1 hunks)
  • plugins/listener/src/fsm.rs (6 hunks)
  • plugins/meeting-automation/Cargo.toml (1 hunks)
  • plugins/meeting-automation/src/lib.rs (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,ts,tsx,rs}

⚙️ CodeRabbit Configuration File

**/*.{js,ts,tsx,rs}: 1. No error handling.
2. No unused imports, variables, or functions.
3. For comments, keep it minimal. It should be about "Why", not "What".

Files:

  • plugins/meeting-automation/src/lib.rs
  • apps/desktop/src/components/toast/model-download.tsx
  • crates/db-user/src/config_types.rs
  • plugins/db/js/bindings.gen.ts
  • plugins/listener/src/fsm.rs
  • apps/desktop/src/components/settings/views/general.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: ci (windows, windows-latest)
  • GitHub Check: ci (macos, macos-latest)
  • GitHub Check: ci
🔇 Additional comments (18)
plugins/listener/Cargo.toml (1)

30-30: LGTM! Dependency addition supports auto-pause notifications.

The addition of hypr-notification2 workspace dependency is correctly formatted and necessary for implementing the auto-pause notification feature mentioned in the PR.

apps/desktop/src/components/toast/model-download.tsx (1)

167-174: Good formatting improvement for readability.

The multi-line dependency array format improves readability and follows React best practices. No functional changes were made.

crates/db-user/src/config_types.rs (2)

48-48: Well-structured configuration field for auto-pause feature.

The optional auto_pause_silence_minutes field is properly typed as Option<f64> to allow null values and uses appropriate floating-point precision for minute durations.


61-61: Reasonable default value for auto-pause silence duration.

The default of 10.0 minutes provides a sensible balance - long enough to avoid false positives during brief pauses, but short enough to be useful for detecting extended silence periods.

apps/desktop/src/locales/en/messages.po (1)

379-385: Proper localization entries for auto-pause feature.

The new translation entries for "Auto-pause after silence" and its description are well-structured with correct source references and clear, user-friendly text.

plugins/listener/src/fsm.rs (6)

17-18: Well-defined constants for auto-pause feature

The silence threshold of 0.01 and default 10-minute duration are reasonable values. The constants are appropriately named and documented.


206-229: Proper configuration extraction for auto-pause feature

The configuration extraction correctly handles the optional auto_pause_silence_minutes field, converts it to a proper Duration, and provides a sensible fallback to the default value.


248-248: Fix for ownership issue with session_state_tx

Good fix by cloning session_state_tx to avoid ownership issues when assigning to the struct field.


300-301: Proper parameter passing for auto-pause functionality

The auto-pause duration and session state sender are correctly passed into the audio processing task.


306-306: Initialize silence tracking state

Good initialization of the silence tracking variable to track when silent periods begin.


350-406: Well-implemented silence detection and auto-pause logic

The silence detection implementation is comprehensive and handles all necessary aspects:

  • Correctly calculates maximum amplitude for both audio channels
  • Properly tracks silence duration and triggers auto-pause when threshold is exceeded
  • Shows informative native notifications with appropriate duration formatting
  • Integrates well with the existing state machine
  • Resets silence tracking appropriately when audio is detected or after pausing

The amplitude calculation using max_by with partial_cmp is the correct approach for finding maximum absolute values in the audio samples.

apps/desktop/src/components/settings/views/general.tsx (5)

77-77: Appropriate schema validation for auto-pause setting

The validation constraints (min 1, max 60) are sensible for a silence duration setting in minutes, preventing invalid values while allowing reasonable range.


102-102: Consistent default value

The default value of 10.0 minutes matches the backend default, ensuring consistency across the application.


114-114: Proper form reset handling

The form reset correctly handles the optional field with appropriate fallback to the default value when the config field is not present.


133-133: Correct field name mapping

The mutation properly maps the camelCase frontend field name to the snake_case backend field name as expected.


197-230: Well-implemented UI component for auto-pause setting

The FormField implementation follows consistent patterns used elsewhere in the settings:

  • Proper accessibility with FormLabel and FormDescription
  • Reasonable selection options (5-60 minutes) covering typical use cases
  • Correct value conversion between string (Select) and number (form state)
  • Consistent styling and layout with other settings
plugins/db/js/bindings.gen.ts (2)

8-173: Formatting improvements in generated file

The formatting changes improve readability by adding consistent indentation and line breaks. However, note that this is a generated file, so these changes may be overwritten if the generator doesn't preserve this formatting.


223-223: Correct type addition for auto-pause configuration

The new auto_pause_silence_minutes: number | null field is properly typed and consistent with other optional configuration fields. The field name matches the backend snake_case convention.

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.

1 participant