You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR adds bbox hotkey behavior for canvas. A short tap on C selects the bbox tool, and holding C temporarily activates bbox until the key is released.
This PR also moves temporary bbox hotkey handling into the shared canvas tool state so it works correctly with the existing temporary Space and Alt tool overrides. Persistent tool changes now update the base tool consistently, and focused tests were added for tap, hold, and nested temporary hotkey flows.
As a result it touches more files than it was originally expected.
Related Issues / Discussions
N/A
QA Instructions
Open the canvas and select a non-bbox tool such as brush.
Press and release C quickly. Verify that bbox becomes the selected tool.
Select brush or another tool again, then hold C. Verify that bbox is active only while C is held and that releasing C returns to the previous tool.
Hold C, then hold Space, release C, then release Space. Verify that the active tool returns to the original base tool and does not stay on bbox.
Repeat step 4 with Alt instead of Space and verify the active tool still returns correctly.
Click the bbox toolbar button and verify that it still performs a normal persistent tool switch.
Merge Plan
No special merge plan.
Checklist
The PR has a short but descriptive title, suitable for a changelog
Tests added / updated (if applicable)
❗Changes to a redux slice have a corresponding migration
Documentation added / updated (if applicable)
Updated What's New copy (if doing a release after this PR)
Clearing the temporary bbox hotkey on window.blur changes more than the old view/color-picker quick-switch behavior did, because bbox is stateful.
If I drag the bbox and alt-tab away then back then this doesn't get cleaned up and is sorta stuck mid-interaction.
Good catch. I was only clearing the temporary bbox hotkey state on window.blur, but bbox can still be in the middle of a Konva drag/transform at that point.
I fixed this by explicitly stopping any active bbox interaction before clearing temporary tool overrides. CanvasToolModule.onWindowBlur() now calls bbox.stopInteraction(), and CanvasBboxToolModule.stopInteraction() uses Konva's stopDrag() / stopTransform() to cleanly end an in-flight bbox move/resize before the temporary bbox hotkey state is reset.
That should prevent the bbox from getting stuck half-active after alt-tab.
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
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.
Summary
This PR adds bbox hotkey behavior for canvas. A short tap on
Cselects the bbox tool, and holdingCtemporarily activates bbox until the key is released.This PR also moves temporary bbox hotkey handling into the shared canvas tool state so it works correctly with the existing temporary Space and Alt tool overrides. Persistent tool changes now update the base tool consistently, and focused tests were added for tap, hold, and nested temporary hotkey flows.
As a result it touches more files than it was originally expected.
Related Issues / Discussions
N/A
QA Instructions
Cquickly. Verify that bbox becomes the selected tool.C. Verify that bbox is active only whileCis held and that releasingCreturns to the previous tool.C, then hold Space, releaseC, then release Space. Verify that the active tool returns to the original base tool and does not stay on bbox.Merge Plan
No special merge plan.
Checklist
What's Newcopy (if doing a release after this PR)