Skip to content

Cancel "Open an issue" mode when switching out of the review workspace#10852

Open
adhavan18 wants to merge 2 commits into
cvat-ai:developfrom
adhavan18:fix/9813-cancel-open-issue-on-workspace-switch
Open

Cancel "Open an issue" mode when switching out of the review workspace#10852
adhavan18 wants to merge 2 commits into
cvat-ai:developfrom
adhavan18:fix/9813-cancel-open-issue-on-workspace-switch

Conversation

@adhavan18

Copy link
Copy Markdown

Motivation and context

Fixes #9813.

In the review workspace the Open an issue control (CreateIssueControl) puts the canvas into select-region mode via canvasInstance.selectRegion(true) and sets ActiveControl.OPEN_ISSUE. Switching to another workspace (e.g. Standard) through changeWorkspaceAsync did not clear this state — it only cleared userUnlockedInReviewMode and 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) and activeControl → CURSOR), mirroring the toggle-off already implemented in CreateIssueControl itself. The reset is guarded by activeControl === ActiveControl.OPEN_ISSUE and a canvasInstance instanceof Canvas check (the 2D canvas that exposes selectRegion), so it is a no-op in every other case.

How has this been tested?

Manually, following the reproduction in #9813:

  1. Open a job and switch to the Review workspace.
  2. Click the Open an issue control on the left panel (it becomes active and the cursor enters select-region mode).
  3. Switch to the Standard workspace without drawing an issue.
  4. Click on the image.

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-control control, and the .cvat-create-issue-dialog assertion) already cover the building blocks — if you'd like one; just let me know your preferred placement.

Checklist

  • I submit my changes into the develop branch
  • I have created a changelog fragment
  • I have updated the documentation accordingly — no user-facing documentation is affected
  • I have added tests to cover my changes — see the testing note above; happy to add a Cypress regression test on request
  • I have linked related issues
  • I submit my code changes under the same MIT License that covers the project.

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.
@adhavan18 adhavan18 requested a review from bsekachev as a code owner July 1, 2026 06:00
@adhavan18 adhavan18 requested a review from nmanovic as a code owner July 1, 2026 06:00
@klakhov

klakhov commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Hi @adhavan18, Thanks for looking into this.
But I was not able to reproduce this issue. Is it still relevant?

Here's the flow:

  • When the "Open an issue" tool is active, [issue-control.tsx:51] sets activeControl to ActiveControl.OPEN_ISSUE.

  • When you try to switch workspace, the reducer's CHANGE_WORKSPACE handler bails out early at [annotation-reducer.ts:1089]:

Kooha-2026-07-01-12-11-40

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.

Switching between modes do not cancel "Open an issue" effect

2 participants