TT-7371 mark verses step complete#338
Merged
Merged
Conversation
Contributor
gtryus
commented
May 28, 2026
- Introduced new utility functions for validating mark verses and checking autosave blockers.
- Refactored PassageDetailMarkVerses component to utilize these validation functions.
- Updated tests to cover new validation logic and ensure correct behavior.
- Enhanced context handling in PassageDetailStepComplete and MobileStepComplete components for better autosave management.
600c367 to
3464f25
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors Mark Verses validation into shared utilities and updates desktop/mobile step completion so Mark Verses changes are saved before marking a verse step complete.
Changes:
- Adds shared Mark Verses validation helpers and unit tests.
- Refactors desktop and mobile Mark Verses autosave validation to use the shared helpers.
- Updates desktop/mobile step-complete controls to trigger and wait for Mark Verses saves.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/renderer/src/utils/markVersesValidation.ts |
Adds shared hard-blocker and full-issues validation logic. |
src/renderer/src/utils/markVersesValidation.test.ts |
Covers autosave blockers and soft warning behavior. |
src/renderer/src/components/PassageDetail/PassageDetailStepComplete.tsx |
Waits for pending Mark Verses save before completing desktop verse steps. |
src/renderer/src/components/PassageDetail/PassageDetailMarkVerses.tsx |
Refactors desktop validation/autosave behavior around shared helpers. |
src/renderer/src/components/PassageDetail/PassageDetailMarkVerses.test.tsx |
Updates Mark Verses tests for soft warning autosave and hard blocker behavior. |
src/renderer/src/components/PassageDetail/mobile/MobileStepComplete.tsx |
Waits for pending Mark Verses save before completing mobile verse steps. |
src/renderer/src/components/PassageDetail/mobile/MarkVerses/PassageDetailMarkVersesIsMobile.tsx |
Refactors mobile Mark Verses autosave validation to use shared helpers. |
src/renderer/src/components/PassageDetail/markVersesTool.ts |
Centralizes the Mark Verses UnsavedContext tool id. |
| useEffect(() => { | ||
| if (saveRequested(verseToolId) && !savingRef.current) { | ||
| scheduleAutosave.clear(); | ||
| void writeResources(); |
| await finish(); | ||
| // eslint-disable-next-line react-hooks/exhaustive-deps | ||
| }, [complete, currentstep, passage, section]); | ||
| }, [complete, currentstep, tool, isChanged, startSave, waitForSave]); |
|
|
||
| useEffect(() => { | ||
| if (saveRequested(verseToolId) && !savingRef.current) { | ||
| scheduleAutosave.clear(); |
3464f25 to
01082a2
Compare
- Introduced new utility functions for validating mark verses and checking autosave blockers. - Refactored PassageDetailMarkVerses component to utilize these validation functions. - Updated tests to cover new validation logic and ensure correct behavior. - Enhanced context handling in PassageDetailStepComplete and MobileStepComplete components for better autosave management.
01082a2 to
0cbed63
Compare
…letion handling - Introduced useRef hooks in PassageDetailMarkVerses, MobileStepComplete, and PassageDetailStepComplete to maintain references for step completion and navigation functions. - Updated effect dependencies to include new references for better performance and reliability. - Simplified autosave logic in PassageDetailMarkVersesIsMobile by utilizing a ref for the persistSegments function. - Removed unused validation issue checks to streamline the code.
ff5763a to
81044ce
Compare
- Added UnsavedContext to the MobileStepComplete component tests to enhance autosave functionality. - Created a mockUnsavedState to simulate unsaved changes and improve test coverage. - Adjusted context providers to ensure proper state management during testing.
sarahentzel
approved these changes
May 29, 2026
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.