Repository navigation
Strip Silence: closing the window while Mix shows stops the rectangle scan - #1095
Conversation
… scan Only the Edit window dropped the Strip Silence rectangles and their scan when Strip Silence closed. With the Mix window showing, a scan for old values ran to the end and strip_scan_running() stayed true. dialogs::show, which runs every frame, now drops them whenever neither Strip Silence nor its Rename Selected Clips dialog is open. edit.strip_silence_preview, strip_silence_scan and strip_settings move from cmd/edit.rs to a new cmd/strip_silence.rs with its own specs(), as AGENTS.md asks for new commands. edit.strip_silence reads its settings through the same strip_settings.
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Shared settings and preview command crates/engine/src/cmd/strip_silence.rs, crates/engine/src/cmd/edit.rs, crates/engine/src/cmd.rs |
The new module parses settings, constructs scans, and provides the preview command. The edit command uses the shared parser, and the command registry registers and re-exports the module’s functions. |
Dialog rectangle cleanup crates/ui-egui/src/dialogs.rs, crates/ui-egui/src/dialogs/strip_silence.rs, crates/ui-egui/tests/it/strip_silence_rectangles.rs |
Dialog display resets rectangle state outside Strip Silence dialogs. The rectangle helper no longer resets cached state or an active scan when neither dialog is open. The integration test checks scan status after the dialog closes. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers: echelon
Merge Risk: 
Minimal · up to c14dc
-
Closing Strip Silence stops its scan. No merge-blocking risk is identified.
Architecture risk: 
Low · up to c14dc
-
The change affects 1 system.
Changed systems:
cratesArchitecture concerns
No architecture-level concerns identified.Review details
-
Systems and components
- observed — crates (service) was modified; 6 changed files map to changed impact.
Before / after behavior
- observed — Modified behavior in crates/engine/src/cmd/strip_silence.rs: Adds the module documentation and registers the
edit.strip_silence_previewquery command, which accepts optional threshold, minimum-length, padding, track, and range parameters and delegates tostrip_silence_preview. - observed — Modified behavior in crates/engine/src/cmd/strip_silence.rs: Adds
StripSettingsandstrip_settings, which require tracks and a range, default the threshold to-48 dBand clamp it to[-96, 0], and convert minimum length and before/after padding from milliseconds to samples after clamping each value to[0, 10,000]ms. - observed — Modified behavior in crates/engine/src/cmd/strip_silence.rs: Adds the public scan function, which builds a
StripScanfrom the current session, parsed settings, and a default stop value. - observed — Modified behavior in crates/engine/src/cmd/strip_silence.rs: Adds the preview handler, which runs the scan and returns each track ID with its detected ranges represented as start/end pairs.
-
Pre-merge checks: 
4
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
…can-stops # Conflicts: # crates/ui-egui/src/dialogs.rs
|
Merged Checks on Windows 11 (x86-64), rustc 1.99.0, on |
|
Merged. Thank you! |
Follow-up to #1055, for two review comments left open when it merged.
On
main, only the Edit window drops the Strip Silence rectangles and stops their scan when Strip Silence closes (strip_silence_rectangles, called fromedit_window::track_row). If the Mix window is showing when the window closes (afterwindow.mix), a scan for old values runs to the end andstrip_scan_running()stays true.dialogs::show, which runs every frame whichever window shows, now drops the rectangles and stops the scan whenever neither Strip Silence nor its Rename Selected Clips dialog is open.strip_silence_rectangles(indialogs/strip_silence.rs) returns no rectangles in that case and no longer resets the state itself.edit.strip_silence_preview,strip_silence_scanandstrip_settingsmove fromcmd/edit.rsto a newcmd/strip_silence.rswith its ownspecs(), registered incmd.rs, asAGENTS.mdasks for new commands.edit.strip_silencereads its settings through the samestrip_settings. The command's id, label and params do not change.New test
strip_silence_rectangles::closing_the_window_while_the_mix_window_shows_stops_the_scan(ui-egui): it starts a scan, shows the Mix window, closes Strip Silence and checks that no scan is running. It fails with thedialogs::showchange removed.On Windows 11 (x86-64) with rustc 1.99.0, with
SOUNDCRAFT_NO_SYSTEM_PLUGINS=1set:ee55acb(frommainata44d1b8),cargo xtask cipassed its 7 steps: 1,437 tests passed, 0 failed, 1 ignored.c14dc61(merged withmainate82c168):cargo fmt --all -- --check;cargo clippy -p soundcraft-engine -p soundcraft-ui-egui --all-targets -- -D warnings;cargo test --no-fail-fast -p soundcraft-engine -p soundcraft-ui-egui -p soundcraft-automation -p soundcraft -p soundcraft-cli -p soundcraft-web: 928 passed, 3 failed, 0 ignored, in 24 binaries (the 3 aresoundcraft-cliapp_tests that fail the same way onmainate82c168on this machine);cargo xtask layersandassetspass.Summary by CodeRabbit