Cancel "Open an issue" mode when switching out of the review workspace#10852
Open
adhavan18 wants to merge 2 commits into
Open
Cancel "Open an issue" mode when switching out of the review workspace#10852adhavan18 wants to merge 2 commits into
adhavan18 wants to merge 2 commits into
Conversation
Switching from the review workspace to another workspace left the canvas in select-region mode when the "Open an issue" control was active, so the next click in the new workspace was still interpreted as issue creation. Reset the control (selectRegion(false) + activeControl -> CURSOR) when leaving the review workspace, mirroring the toggle-off already performed by the issue control itself.
Contributor
|
Hi @adhavan18, Thanks for looking into this. Here's the flow:
|
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.

Motivation and context
Fixes #9813.
In the review workspace the Open an issue control (
CreateIssueControl) puts the canvas into select-region mode viacanvasInstance.selectRegion(true)and setsActiveControl.OPEN_ISSUE. Switching to another workspace (e.g. Standard) throughchangeWorkspaceAsyncdid not clear this state — it only cleareduserUnlockedInReviewModeand re-fetched annotations. The canvas therefore stayed in select-region mode after the switch, so the next click on the image was interpreted as creating an issue instead of a normal annotation action.This change resets the control when leaving the review workspace (
selectRegion(false)andactiveControl → CURSOR), mirroring the toggle-off already implemented inCreateIssueControlitself. The reset is guarded byactiveControl === ActiveControl.OPEN_ISSUEand acanvasInstance instanceof Canvascheck (the 2D canvas that exposesselectRegion), so it is a no-op in every other case.How has this been tested?
Manually, following the reproduction in #9813:
Before this change, step 4 was still handled as issue creation (the select-region handler was left active). After this change the control is reset when the workspace changes, so the click behaves normally.
Note: I was not able to run the Cypress e2e suite locally (it needs a running CVAT deployment), so I have not included an automated test in this PR. I'd be glad to add a regression test under
tests/cypress/— the review-pipeline helpers (cy.changeWorkspace, the.cvat-issue-controlcontrol, and the.cvat-create-issue-dialogassertion) already cover the building blocks — if you'd like one; just let me know your preferred placement.Checklist
developbranchI have updated the documentation accordingly— no user-facing documentation is affectedI have added tests to cover my changes— see the testing note above; happy to add a Cypress regression test on request