Skip to content

fix(cursor): play click sounds for every clip of a recording - #1151

Merged
EtienneLescot merged 1 commit into
mainfrom
fix/1146-click-sound-every-clip
Oct 12, 2026
Merged

EtienneLescot merged 1 commit into
mainfrom
fix/1146-click-sound-every-clip

Conversation

@EtienneLescot

@EtienneLescot EtienneLescot commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

With Mouse clicks on, a pasted copy of a recording (#1011) played no click sounds, in the export or the preview. clickPlacement returned on the first clip whose kept source window held the click, so each click got at most one placement. It now places the click once per clip that keeps it, each through that clip's trims and speed regions. The export's hits and the preview's per-clip buckets both read that list, so both are fixed. The preview's clip-less fallback list (used while the mounted clip id is unresolved) keeps each cue once, so one source crossing still fires it once.

Candidate for cherry-pick to release/v2.1.0.

Related issue

Fixes #1146

Type of change

  • Bug fix
  • Feature
  • Enhancement
  • Documentation
  • Refactor / maintenance
  • Performance
  • Security

Release impact

  • Patch
  • Minor
  • Major / breaking change
  • No release note needed

Desktop impact

  • Windows
  • macOS
  • Linux
  • Installer / packaging
  • Not platform-specific

Screenshots / video

None, audio only.

Testing

  • New unit tests in src/lib/ai-edition/clickSound.test.ts: two clips on one take, each with its own 2x region, place a click kept by both twice at the right programme times and a click past the copy's end once; the preview fires the click over each clip and once with no clip id. The placement test fails on main.
  • Against the e2e project from the v2.1.0 pass (clip 1 = source 0 to 37.78 s, clip 2 = copy trimmed to 0 to 8.8 s, 1.5x regions at 1.989 to 3.918 s on each), the presses now land at 6.036, 10.267, 14.462, 28.601, 36.925 and 43.173 s. The first five match the transients measured in the v2.1.0 export within 20 ms; 43.173 s is clip 2's, which the export was missing.
  • npx vitest --run src/lib/ai-edition/clickSound.test.ts, npx tsc --noEmit, npx tsc -p tsconfig.test.json --noEmit, npm run lint.
  • Not re-exported through the GUI: a manual export of a duplicated clip with Mouse clicks on remains to confirm the hit is audible at the expected time.

clickPlacement returned on the first clip whose kept source window held the click, so a pasted copy of a take got no clicks in the export or the preview. It now places the click once per clip that keeps it, each through that clip's trims and speed regions. The preview's clip-less fallback list keeps each cue once.

Fixes #1146
@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5d4cc638-28a9-438e-9348-1ac4dfa682fa

📥 Commits

Reviewing files that changed from the base of the PR and between 9c55596 and cf441e7.


📒 Files selected for processing (2)
  • src/lib/ai-edition/clickSound.test.ts
  • src/lib/ai-edition/clickSound.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 3 remain after this review.



📝 Walkthrough

Walkthrough

Click cues now receive a placement in every clip whose kept source range contains the cue. Hit generation emits each placement. Preview storage keeps cues in each matching clip bucket and stores each cue once in the source-clock crossing list.

Changes

Click placement across duplicated clips

Layer / File(s) Summary
Place cues across matching clips
src/lib/ai-edition/clickSound.ts, src/lib/ai-edition/clickSound.test.ts
The placement function returns all matching clip placements, and hit generation emits a hit for each. Preview storage keeps cues in each clip bucket while deduplicating the source-clock list. Tests cover placement across duplicated clips and preview playback with either clip active or no resolved clip ID.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: akahoz94


Merge Risk: ⚪ Minimal · up to cf441

No concrete issue currently blocks merging; audible confirmation of the duplicated clip’s click remains outstanding.

Pre-merge checks | Passed 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check Passed The title clearly identifies the bug fix: click sounds now play for every clip of a recording.
Description check Passed The description includes all required sections, explains the fix, links the related issue, identifies the change as a patch bug fix, and lists tests and remaining GUI export validation.
Linked Issues check Passed PR changes directly implement [#1146]. clickPlacement now collects every matching clip instead of returning after the first match. placedClickHits creates one hit per placement. The existing trim …
Out of Scope Changes check Passed The diff changes only src/lib/ai-edition/clickSound.ts and its unit tests. The implementation changes export hit placement and preview cue selection, which are required by [#1146]. The tests verify …
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files.

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR

🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

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

@EtienneLescot
EtienneLescot merged commit d26dcda into main Oct 12, 2026
19 checks passed
@EtienneLescot
EtienneLescot deleted the fix/1146-click-sound-every-clip branch October 12, 2026 21:09
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.

[Bug]: Click sounds play only for the first clip of a recording, not for a duplicated clip

1 participant