-
Notifications
You must be signed in to change notification settings - Fork 202
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
base: main
Are you sure you want to change the base?
Auto Pause #1204
Conversation
📝 WalkthroughWalkthroughA 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
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
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 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. 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)
Other keywords and placeholders
Documentation and Community
|
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.
Actionable comments posted: 1
🔭 Outside diff range comments (1)
plugins/meeting-automation/Cargo.toml (1)
1-9
: Add essential package metadata and declare baseline dependenciesThe 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
⛔ 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 asOption<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 featureThe 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 featureThe configuration extraction correctly handles the optional
auto_pause_silence_minutes
field, converts it to a properDuration
, and provides a sensible fallback to the default value.
248-248
: Fix for ownership issue with session_state_txGood fix by cloning
session_state_tx
to avoid ownership issues when assigning to the struct field.
300-301
: Proper parameter passing for auto-pause functionalityThe auto-pause duration and session state sender are correctly passed into the audio processing task.
306-306
: Initialize silence tracking stateGood initialization of the silence tracking variable to track when silent periods begin.
350-406
: Well-implemented silence detection and auto-pause logicThe 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
withpartial_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 settingThe 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 valueThe default value of 10.0 minutes matches the backend default, ensuring consistency across the application.
114-114
: Proper form reset handlingThe 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 mappingThe 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 settingThe 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 fileThe 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 configurationThe 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.
No description provided.