Skip to content

Feat(canvas): Add temporary bbox move with C key hold#9104

Open
DustyShoe wants to merge 8 commits into
invoke-ai:mainfrom
DustyShoe:Feat(Canvas)/BBox-temp-move-on-C-hold
Open

Feat(canvas): Add temporary bbox move with C key hold#9104
DustyShoe wants to merge 8 commits into
invoke-ai:mainfrom
DustyShoe:Feat(Canvas)/BBox-temp-move-on-C-hold

Conversation

@DustyShoe
Copy link
Copy Markdown
Collaborator

Summary

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

  1. Open the canvas and select a non-bbox tool such as brush.
  2. Press and release C quickly. Verify that bbox becomes the selected tool.
  3. 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.
  4. 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.
  5. Repeat step 4 with Alt instead of Space and verify the active tool still returns correctly.
  6. 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)

@github-actions github-actions Bot added the frontend PRs that change frontend files label May 1, 2026
@lstein lstein added the 6.14.x label May 9, 2026
@lstein lstein moved this to 6.14.x Theme: LIBRARY UPDATES in Invoke - Community Roadmap May 9, 2026
@DustyShoe
Copy link
Copy Markdown
Collaborator Author

@joshistoast

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.14.x frontend PRs that change frontend files

Projects

Status: 6.14.x Theme: USER EXPERIENCE

Development

Successfully merging this pull request may close these issues.

3 participants