Skip to content

Fix segments thinking they have changed when switching steps#203

Merged
gtryus merged 2 commits intodevelopfrom
FixSpuriousSegmentChange
Feb 11, 2026
Merged

Fix segments thinking they have changed when switching steps#203
gtryus merged 2 commits intodevelopfrom
FixSpuriousSegmentChange

Conversation

@sarahentzel
Copy link
Collaborator

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Addresses unintended “segments changed” behavior when switching steps by suppressing region callbacks during WaveSurfer teardown.

Changes:

  • Add a destroy/teardown guard (destroyingRef + prepareForDestroy) to prevent region-removed side effects during destroy/unmount.
  • Hook WaveSurfer destroy/unmount paths to set the destroy guard and adjust region clearing behavior.
  • Reduce controlsRef effect dependencies and clean up minor lint/comment noise.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/renderer/src/crud/useWavesurferRegions.tsx Introduces destroyingRef + prepareForDestroy and guards region-removed follow-up work during teardown.
src/renderer/src/crud/useWaveSurfer.tsx Calls prepareForDestroy() on WaveSurfer destroy/unmount; changes how clearRegions is invoked from wsClear.
src/renderer/src/components/WSAudioPlayer.tsx Changes controlsRef setup effect dependency handling (now lint-disabled and reduced deps).
src/renderer/src/components/App/HeadStatus.tsx Removes an unnecessary exhaustive-deps disable comment.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gtryus gtryus merged commit 83a18b2 into develop Feb 11, 2026
2 checks passed
@gtryus gtryus deleted the FixSpuriousSegmentChange branch February 11, 2026 17:04
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.

3 participants