Skip to content

TT-7371 mark verses step complete#338

Merged
sarahentzel merged 3 commits into
developfrom
TT-7371-mark-verse-save
May 29, 2026
Merged

TT-7371 mark verses step complete#338
sarahentzel merged 3 commits into
developfrom
TT-7371-mark-verse-save

Conversation

@gtryus
Copy link
Copy Markdown
Contributor

@gtryus 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.

@gtryus gtryus requested a review from Copilot May 28, 2026 17:04
@gtryus gtryus force-pushed the TT-7371-mark-verse-save branch from 600c367 to 3464f25 Compare May 28, 2026 17:07
Copy link
Copy Markdown
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

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.

Comment thread src/renderer/src/components/PassageDetail/PassageDetailStepComplete.tsx Outdated
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();
@gtryus gtryus force-pushed the TT-7371-mark-verse-save branch from 3464f25 to 01082a2 Compare May 28, 2026 17:10
- 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.
@gtryus gtryus force-pushed the TT-7371-mark-verse-save branch from 01082a2 to 0cbed63 Compare May 28, 2026 17:14
…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.
@gtryus gtryus force-pushed the TT-7371-mark-verse-save branch from ff5763a to 81044ce Compare May 28, 2026 17:33
- 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 sarahentzel merged commit 1dfaa9e into develop May 29, 2026
2 checks passed
@sarahentzel sarahentzel deleted the TT-7371-mark-verse-save branch May 29, 2026 16:33
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