Skip to content

Fix sticker move not recording in canvas undo history#23

Merged
jeffgo10 merged 1 commit into
masterfrom
fix/canvas-move-undo-history
Jul 4, 2026
Merged

Fix sticker move not recording in canvas undo history#23
jeffgo10 merged 1 commit into
masterfrom
fix/canvas-move-undo-history

Conversation

@jeffgo10

@jeffgo10 jeffgo10 commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Summary

Drag moves were wired into history gestures but never committed: endHistoryGesture ran in the same tick as dragend and compared against a stale itemsRef (pre-move positions), so moves looked like “no change.” Resize/rotate already worked because live transform events updated state between frames. This keeps itemsRef in sync before the gesture commit and bumps @jeffgo10/react-canvas-designer to 0.2.34.

Changes

Canvas designer (@jeffgo10/react-canvas-designer)

  • Sync itemsRef inside updateItem, applyLiveGroupTransform, and undo/redo before history commit
  • Add unit test that fires mock Konva dragstart/dragend and asserts move undo/redo
  • Version 0.2.33 → 0.2.34

Test utils

  • Mock Konva Group now supports fire('dragstart'|'dragend'|…) and getMockGroupApi() for tests

Docs / Cursor rules

  • docs/stickpak/engineering-notes.md and phase-1.md document the move fix and pin
  • ls-foundry-core.mdc pin table updated to 0.2.34

Commits

SHA Message
d96895f Fix sticker move not recording in canvas undo history.

Test plan

  • pnpm test --filter=@jeffgo10/react-canvas-designer
  • pnpm run dev --filter=@ls-foundry/docs/stickpak
  • Place a sticker, drag it, Undo restores prior position, Redo restores the move
  • Confirm resize/rotate/add/delete undo still work

Notes / follow-ups

  • Publish on merge via CI (publish-packages.yml) for @jeffgo10/react-canvas-designer@0.2.34
  • Storefront should bump pin from 0.2.33 → 0.2.34 for move undo

Made with Cursor

- Keep itemsRef in sync on updateItem/group transform before gesture commit
- Add dragend move undo/redo test via mock Konva fire helpers
- Bump react-canvas-designer to 0.2.34

Co-authored-by: Cursor <cursoragent@cursor.com>
@cursor

cursor Bot commented Jul 4, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@jeffgo10 jeffgo10 merged commit 1a1247b into master Jul 4, 2026
1 check passed
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.

1 participant