TT-7437,7438,7439 feat: implement segment locking during recording and saving processes#368
Open
gtryus wants to merge 4 commits into
Open
TT-7437,7438,7439 feat: implement segment locking during recording and saving processes#368gtryus wants to merge 4 commits into
gtryus wants to merge 4 commits into
Conversation
…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.
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.
Contributor
There was a problem hiding this comment.
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
lockSegmentSelectioncapability throughPassageDetailPlayer→WSAudioPlayer→ 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
MediaRecordand 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. |
- 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
lockSegmentSelectionprop to WSAudioPlayer and PassageDetail components to prevent segment navigation during recording.savingRecordingin PassageDetail to disable navigation and controls while uploads are in progress.