feat(M5): selection transform, inspector, z-order & per-object lock (pillars 2 & 3, v0)#9
Merged
Merged
Conversation
Milestone 5, pillars 2 & 3 (v0) — make the selection a first-class, editable, arrangeable, lockable object. Pillar 2 — Select & Style: - Konva Transformer (new TransformLayer) gives resize + rotate handles for box kinds (rect/ellipse/text/asset), gated on the select tool. Renderers now draw in local coords with the ShapesLayer Group carrying x/y/rotation so the transform pivots around the shape's own origin; the transform is baked back to the model on transformend (one undo entry). - SelectionInspector: a Liquid-Glass panel (right dock) with stroke color, fill, opacity, and font-size controls, computing shared/"mixed" values across a multi-selection. Pillar 3 — Arrange & Lock: - Z-order: bringToFront/sendToBack/bringForward/sendBackward on the store; listShapes sorts by z (insertion-order fallback). Buttons + Cmd/Ctrl+]/[ (Shift = front/back). New shapeBase z field. - Per-object lock: wires the existing locked field across select-drag, transform, delete, eraser, marquee, and double-click-edit; lock toggle in the inspector, Cmd/Ctrl+Shift+L, and an amber selection box. New optional shape fields z/opacity (+ rot on text); opacity now applied once on the ShapesLayer Group. All mutations flow through updateShape/ transact so they ride Yjs undo and future realtime. typecheck + build pass across all workspaces. https://claude.ai/code/session_019jiFzJWnoACbYVEURirwxL
It ran `npm ci` / `npm test` with `cache: npm` in a pnpm monorepo that has no package-lock.json and no test script, so its build (18.x/20.x/22.x) jobs failed on every PR and push. The real typecheck + build gate is ci.yml (pnpm-based), which fully covers this; node.js.yml was redundant. https://claude.ai/code/session_019jiFzJWnoACbYVEURirwxL
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Milestone 5 — Pillars 2 & 3 (v0)
Makes the selection a first-class object: you can now resize/rotate, restyle, restack, and lock shapes. The M5 scope line is "highlighter / eraser / shapes / text / select + per-object lock"; the tools shipped in M2/M3, so this PR covers the select and per-object lock halves, grouped into two pillars.
Pillar 2 — Select & Style
Transformer(newTransformLayer) adds resize + rotate handles for box kinds (rect/ellipse/text/asset), mounted only under the select tool. To pivot correctly around each shape's own origin, the box renderers now draw in local coords with theShapesLayerGroup carryingx/y/rotation; the live transform is baked back to the model ontransformend(one undo entry for multi-select). A pointer-down on a handle is guarded so it doesn't also start a drag.ToolPalette) with stroke color, fill, opacity, and font-size controls, showing shared values or "Mixed" across a multi-selection.Pillar 3 — Arrange & Lock
bringToFront / sendToBack / bringForward / sendBackwardon the shape store;listShapessorts by a new optionalz(insertion-order fallback, so existing boards are unchanged). Inspector buttons +Cmd/Ctrl+]/[(Shift = front/back).lockedfield across select-drag, transform, delete, eraser, marquee, and double-click-edit. Lock/Unlock in the inspector,Cmd/Ctrl+Shift+L, and an amber selection box. A locked shape is still single-click-selectable so Unlock stays reachable.Model / plumbing
YShapeBasefieldsz?,opacity?(+rot?onYText); both optional ⇒ no migration, old shapes deserialize fine.ShapesLayerGroup (highlighter keeps its 0.35 default unless overridden); removed fromStrokeRenderer.updateShape/transact, so they ride the YjsUndoManagerand will sync over M4 realtime once that merges.Verification
pnpm typecheck(all 5 workspaces)pnpm buildDeferred past v0
Stroke resize/rotate; line/arrow endpoint handles; rotated-bounds-aware marquee/overlay; fractional z-indexing; flip via negative scale; text aspect-lock; dedicated lock-glyph badge.
https://claude.ai/code/session_019jiFzJWnoACbYVEURirwxL
Generated by Claude Code