Skip to content

feat(editor): make layer locking actually prevent accidental canvas s… - #542

Open
fortusfederal wants to merge 1 commit into
CoreBunch:mainfrom
fortusfederal:feat/layer-lock-blocks-canvas-selection
Open

fortusfederal wants to merge 1 commit into
CoreBunch:mainfrom
fortusfederal:feat/layer-lock-blocks-canvas-selection

Conversation

@fortusfederal

Copy link
Copy Markdown

Summary

toggleNodeLocked already existed at the mutation layer, and a tree row rendered a lock glyph once a node was locked — but there was no discoverable way to lock a node (only Spotlight's command palette called the action), and canvas click-to-select ignored the locked flag entirely. Locking a layer therefore did not protect it from being selected by an accidental click, which is the point of the feature.

  • Adds a Lock/Unlock item to the layer context menu (canvas and DOM panel), mirroring the existing Hide/Unhide item's structure and multi-select awareness.
  • CanvasRoot's onNodeClick now skips selection for locked nodes. Right-click still targets them, so Unlock stays reachable.

Verification

  • bun run build
  • bun test
  • bun run lint
  • Docker/deployment check — not relevant

Checklist

  • Tests cover behavior changes — layerNodeContextMenu.test.tsx
  • Docs — no documented surface changed
  • No compatibility shim was added for old pre-release behavior.
  • No secrets, local databases, uploads, or generated artifacts are included.

🤖 Generated with Claude Code

…election

toggleNodeLocked already existed at the mutation layer and the tree row
showed a lock glyph once a node was already locked, but there was no
discoverable way to lock a node (only Spotlight's command palette
called the action), and canvas click-to-select ignored the locked flag
entirely -- so locking a layer didn't protect it from being selected by
an accidental click, which was the whole point of the feature.

- Add a Lock/Unlock item to the layer context menu (canvas + DOM panel),
  mirroring the existing Hide/Unhide item's structure and multi-select
  awareness.
- CanvasRoot's onNodeClick now skips selection for locked nodes. Right-
  click (context menu) still targets them, so Unlock stays reachable
  from the canvas, not just the Layers panel.
- Update the pre-existing "Hide first with a divider" menu-order test
  to account for the new Lock item, and add coverage for Lock/Unlock
  show/click behavior and root-node exclusion.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@fortusfederal
fortusfederal marked this pull request as ready for review September 18, 2026 00:59

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants