Skip to content

TT-7437,7438,7439 feat: implement segment locking during recording and saving processes#368

Open
gtryus wants to merge 4 commits into
developfrom
bold-cs-guardrails
Open

TT-7437,7438,7439 feat: implement segment locking during recording and saving processes#368
gtryus wants to merge 4 commits into
developfrom
bold-cs-guardrails

Conversation

@gtryus

@gtryus gtryus commented Jun 19, 2026

Copy link
Copy Markdown
Contributor
  • Added lockSegmentSelection prop to WSAudioPlayer and PassageDetail components to prevent segment navigation during recording.
  • Introduced state management for savingRecording in PassageDetail to disable navigation and controls while uploads are in progress.
  • Updated tests to verify that segment selection is correctly locked during recording and saving operations.
  • Enhanced context to block navigation when recording or comment recording is active.

…d saving processes

- Added `lockSegmentSelection` prop to WSAudioPlayer and PassageDetail components to prevent segment navigation during recording.
- Introduced state management for `savingRecording` in PassageDetail to disable navigation and controls while uploads are in progress.
- Updated tests to verify that segment selection is correctly locked during recording and saving operations.
- Enhanced context to block navigation when recording or comment recording is active.
@gtryus gtryus marked this pull request as draft June 19, 2026 21:13
Greg Trihus added 2 commits June 19, 2026 16:25
…rding

- Updated `lockSegmentSelection` prop description in WSAudioPlayer for clarity on its behavior.
- Improved state management for recording status in PassageDetail, ensuring accurate handling of segment locking.
- Refined tests to validate segment locking behavior during recording and saving processes.
- Enhanced navigation context to allow for optional blocking based on caller conditions.
…pload flow

- Introduced `handleSaveFailed` callback to manage save errors during audio uploads.
- Updated upload logic to handle errors gracefully, ensuring proper state management and user feedback.
- Enhanced existing upload processes to utilize the new error handling mechanism for both successful and failed uploads.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds mechanisms to prevent users from changing segments or navigating passages/workflow steps while audio capture is active and while certain recording-save flows are in progress, improving safety of recording and upload workflows in the renderer.

Changes:

  • Added a lockSegmentSelection capability through PassageDetailPlayerWSAudioPlayer → WaveSurfer hooks to ignore user-initiated segment changes (clicks, prev/next) during recording/saving.
  • Introduced navigation-blocking logic in PassageDetailContext (and a small helper) to prevent step/passage navigation while recording/comment recording is active.
  • Improved saving failure handling in MediaRecord and expanded unit tests to cover recording/saving lock behavior.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/renderer/src/crud/useWavesurferRegions.tsx Adds lockSegmentSelection gating for region click and prev/next region navigation.
src/renderer/src/crud/useWaveSurfer.tsx Wires lockSegmentSelection through to region-handling hook.
src/renderer/src/context/passageDetailNavigationBlocked.ts Adds a small helper to decide when navigation must be blocked.
src/renderer/src/context/passageDetailNavigationBlocked.test.ts Unit tests for the navigation-block helper.
src/renderer/src/context/PassageDetailContext.tsx Adds isNavigationBlocked() and uses it to prevent step/passage navigation during active recording.
src/renderer/src/components/WSAudioPlayer.tsx Accepts lockSegmentSelection and forwards to WaveSurfer; clarifies recording activation semantics.
src/renderer/src/components/PassageDetail/WorkflowSteps.tsx Prevents workflow-step selection while recording/comment recording is active.
src/renderer/src/components/PassageDetail/usePassageNavigate.ts Adds navigation-block checks before navigating between passages/views.
src/renderer/src/components/PassageDetail/PassageDetailPlayer.tsx Plumbs lockSegmentSelection down into WSAudioPlayer.
src/renderer/src/components/PassageDetail/PassageDetailChooser.tsx Prevents chooser interaction while recording/comment recording is active.
src/renderer/src/components/PassageDetail/PassageDetailCarefulSpeech.tsx Adds savingRecording state and uses it (and recording) to lock segment selection and disable “Next Clause” during save/upload.
src/renderer/src/components/PassageDetail/PassageDetailCarefulSpeech.test.tsx Adds tests validating segment locking and saving-in-progress behavior.
src/renderer/src/components/PassageDetail/mobile/PassageDetailMobileFooter.cy.tsx Updates Cypress fixture state to include new context function.
src/renderer/src/components/PassageDetail/carefulSpeech/CarefulSpeechControls.tsx Adds props to reflect saving state and wires save lifecycle callbacks through to MediaRecord.
src/renderer/src/components/PassageDetail/carefulSpeech/CarefulSpeechControls.test.tsx Adds test for disabling “Next Clause” while saving.
src/renderer/src/components/MediaRecord.tsx Adds upload error handling to reliably reset state and signal failure.
migration/usj-structure.test.mjs Adds JSDoc / lint suppressions for helper functions in the migration test.

Comment thread src/renderer/src/components/PassageDetail/usePassageNavigate.ts Outdated
- Updated `usePassageNavigate` to accept `isNavigationBlocked` as a parameter, allowing for more flexible navigation control.
- Refactored `PassageDetailChooser`, `PassageDetailStepComplete`, `MobileWorkflowSteps`, and `PassageDetailMobileFooter` to utilize the new navigation blocking logic.
- Enhanced context management for navigation blocking to improve user experience during passage detail interactions.
@gtryus gtryus marked this pull request as ready for review June 20, 2026 02:18
@gtryus gtryus requested a review from sarahentzel June 20, 2026 02:18
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.

2 participants