TT-7104 Refactor recording state management in PassageDetailItem#208
TT-7104 Refactor recording state management in PassageDetailItem#208sarahentzel merged 1 commit intodevelopfrom
Conversation
gtryus
commented
Feb 12, 2026
- Simplified the isRecording function to only check for recorderRecordingRef.
- Updated the updateRecorderBusy function to set recording based on both isRecording and recorderPlayingRef.current.
There was a problem hiding this comment.
Pull request overview
Refactors how PassageDetailItem determines and propagates “recording/busy” state to the shared Passage Detail context during MediaRecord recording vs playback.
Changes:
- Simplifies
isRecording()to only reflect the recorder’s active recording ref (recorderRecordingRef). - Updates
updateRecorderBusy()to drive the sharedsetRecording(...)state based on both recorder recording and recorder playback refs.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
af35e85 to
5b601d7
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| aria-label={isRecorderPlaying ? 'Pause' : 'Play'} | ||
| onClick={() => recorderControlsRef.current?.togglePlay()} | ||
| disabled={recorderDuration === 0 || isRecording()} | ||
| onClick={() => { |
There was a problem hiding this comment.
pull this duplicated code out into a function
…cks in PassageDetailItem - Added a debounce mechanism to prevent rapid successive clicks on play and record buttons. - Introduced a new constant DEBOUNCE_CLICK_MS to define the debounce duration. - Updated button click handlers to utilize the debounce logic, enhancing user experience by avoiding unintended multiple actions.
5b601d7 to
600cc11
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.