Fix annotation guide unsaved changes & back-navigation#10340
Open
prathamesh-patil-5090 wants to merge 23 commits intocvat-ai:developfrom
Open
Fix annotation guide unsaved changes & back-navigation#10340prathamesh-patil-5090 wants to merge 23 commits intocvat-ai:developfrom
prathamesh-patil-5090 wants to merge 23 commits intocvat-ai:developfrom
Conversation
Refactor not found components to use a common handleReturn function for navigation.
Remove console log for history length in TaskNotFoundComponent.
Added a new 'Return to Previous Page' button with smart fallback navigation.
Updated link for 'Return to Previous Page' button feature.
Updated the link for the 'Return to Previous Page' button in the changelog.
… and navigation prompt
2 tasks
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.
PR: Fix annotation guide unsaved changes & back-navigation
Summary
This PR addresses two related user experience issues in the annotation guide editor:
Unsaved changes vulnerability
localStorageas a draft.<Prompt>when unsaved changes exist.beforeunloadhandler warns on browser refresh or tab close.Incorrect back-button target
prevLocationfrom Redux,which defaulted to
/tasksand/projectsregardless of the current item./tasks/<id>or/projects/<id>based on thecurrent URL. The unsaved-changes prompt still intercepts this navigation.
Testing steps
/tasks/<id>or/projects/<id>.Related issue
Closes #10303 (extracted from #6536).
Additional notes
annotation-guide-pagecomponent was updated extensively; please review carefully.changelog.d/20260308_annotation_guide_draft.md.Test
Screencast.from.2026-03-09.00-15-09.webm