Skip to content

feat(canvas): restore eraser pressure width, layer quick switch, crop tools and middle-click open - #9808

Open
joshistoast wants to merge 2 commits into
mainfrom
feat/parity-canvas-interaction
Open

joshistoast wants to merge 2 commits into
mainfrom
feat/parity-canvas-interaction

Conversation

@joshistoast

@joshistoast joshistoast commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Four interaction behaviors from the legacy frontend were missing from webv2.

  • Eraser pressure width. The eraser honours pen pressure for stroke width through a Dynamics switch (on by default), never for opacity, matching legacy; the brush is unchanged.
  • Layer navigation and quick switch. Alt+[ / Alt+] cycle all layers in document order (wrapping) when nothing is staged, and keep cycling staged results when it is. Q switches to a bookmarked layer, else the previously selected one; "Bookmark for quick switch" is in the layer context menu. Bookmark and previous selection are transient per engine.
  • Reference crop. Aspect-ratio presets constrain the crop (opening Free for a full-frame box, matching a preset only for a saved partial crop), wheel zoom about the cursor, Space or middle-button pan, Fit / Actual size / Zoom buttons, and "Save to Uploads", which uploads the crop as a user image to the gallery's auto-add board independently of Apply.
  • Middle-click opens media. An opt-in Gallery setting makes middle-click on image and video tiles open the media in a new tab without selecting it; Canvas middle-button pan is untouched.

Related Issues / Discussions

Follows up the legacy parity audit behind #9803.

QA Instructions

From invokeai/frontend/webv2 (Node 22.14, pnpm 10.12): pnpm check:release passes; no baseline changes (the crop geometry lives in the already-eager core/referenceImage.ts, so the editor's source-owner set is unchanged).

Mock backend (representative profile):

  1. Canvas → press E → Properties → Dynamics shows only "Pen pressure affects width". With a pen, light and firm eraser strokes differ in width; the brush still shows both switches.
  2. With two or more layers and nothing staged, Alt+] and Alt+[ step the Layers-panel selection and wrap. Right-click a layer → Bookmark for quick switch, select another layer, press Q: the bookmark is selected; Q again returns. Without a bookmark Q toggles the last two selections.
  3. Generate panel → reference image → Crop: pick 1:1; the box reshapes about its centre and handle drags keep the ratio. Wheel zooms at the cursor; hold Space or use the middle button to pan; Fit resets. Tab to Apply and press Space: it applies. "Save to Uploads" shows a notice and a new user image appears in the gallery while the dialog stays open.
  4. Gallery settings → Thumbnails → "Middle-click opens media in a new tab": off by default; when on, middle-click on a tile opens the full media in a new tab without selecting it.

Review

Material findings resolved: Space was swallowed for every button in the crop dialog (keyboard users could not activate Apply/Cancel with Space); the dialog opened ratio-locked for any image whose full frame matched a preset; the aspect-ratio combobox had no accessible name. Also applied: a selected group now cycles from its first leaf, Save to Uploads honours the auto-add board, and browser tests cover wheel zoom, pan and Space activation. Remaining limitation: "Actual size" assumes the fitted image spans the viewport width; a very tall image capped by the dialog height is slightly off (pre-existing crop-percentage behavior).

Compatibility / Rollout

The new Gallery setting is optional and off by default; bookmark and previous-selection memory are never persisted. No API changes.

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Meaningful regression coverage added / updated where needed; obsolete tests/code removed
  • Persisted-state and API changes include required migrations / compatibility validation
  • Relevant performance/efficiency opportunities considered; material claims have evidence
  • Material review findings resolved and relevant checks rerun
  • Documentation added / updated (if applicable)
  • Updated What's New copy (if doing a release after this PR)

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

…iddle-click open

Eraser honours pen pressure for width through its own Dynamics switch; Alt+[ / Alt+] cycle layers when nothing is staged and Q jumps to a bookmarked or previous layer via engine-held memory and a layer-menu bookmark.
Reference crop dialog gains aspect-ratio presets, wheel zoom, Space/middle-button pan, view buttons and Save to Uploads; Gallery gets an opt-in middle-click-opens-in-new-tab setting on image and video tiles.
…rops free

Reference crop: Space pans only when no button or field has focus, the aspect preset is restored only for a saved partial crop, the ratio Select carries an accessible name, Save to Uploads targets the Gallery auto-add board, and the crop geometry lives in the reference image core so the editor startup graph is unchanged.
Canvas: Alt+] enters a selected group at its first leaf and Alt+[ leaves it upward.
@github-actions github-actions Bot added frontend PRs that change frontend files docs PRs that change docs labels Oct 11, 2026

This branch has not been deployed

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

Labels

docs PRs that change docs frontend PRs that change frontend files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant