Skip to content

PR_26179_CHARLIE_035-sprites-frame-editing#272

Merged
ToolboxAid merged 1 commit into
mainfrom
PR_26179_CHARLIE_035-sprites-frame-editing
Jun 28, 2026
Merged

PR_26179_CHARLIE_035-sprites-frame-editing#272
ToolboxAid merged 1 commit into
mainfrom
PR_26179_CHARLIE_035-sprites-frame-editing

Conversation

@ToolboxAid

Copy link
Copy Markdown
Owner

Summary

  • Add unsaved page-session frame editing: add, duplicate, select, and delete frames.
  • Keep each frame's draft pixels separate in page-session editor state only.
  • Preserve no DB/API/schema/persistence scope.

Validation

  • PASS: node --check assets/toolbox/sprites/js/index.js
  • PASS: node --check dev/tests/playwright/tools/SpritesToolShell.spec.mjs
  • PASS: git diff --check for touched files
  • PASS: targeted Sprite Creator Playwright spec

Artifact

  • dev/workspace/zip/PR_26179_CHARLIE_035-sprites-frame-editing_delta.zip

@ToolboxAid ToolboxAid marked this pull request as ready for review June 28, 2026 20:18
@ToolboxAid ToolboxAid changed the base branch from PR_26179_CHARLIE_034-sprites-frame-strip to main June 28, 2026 20:19
@ToolboxAid ToolboxAid merged commit 343fbdf into main Jun 28, 2026
1 check passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eae87196a7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +602 to +604
editorState.frames.forEach((frame) => {
frame.paintedPixels.clear();
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve other frames when applying undo snapshots

When multiple frames exist, any Undo/Redo path calls applySnapshot(), which calls setGridSize(...); this new loop clears every frame before applySnapshot() restores only the active frame's snapshot.paintedPixels. For example, paint Frame 1, add and paint Frame 2, then press Undo while on Frame 2: Frame 1's pixels are silently erased when you select it again. The snapshot restore needs to avoid clearing unrelated frames or snapshot/restore the full frame set.

Useful? React with 👍 / 👎.

Comment on lines +551 to +553
editorState.frames.splice(editorState.activeFrameIndex, 1);
renumberFrames();
editorState.activeFrameIndex = Math.max(0, Math.min(editorState.activeFrameIndex, editorState.frames.length - 1));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Drop deleted-frame undo history

When the active frame has edit history, deleting it leaves those snapshots in the global undo stack and keeps Undo enabled. If a user paints Frame 2, deletes Frame 2, then presses Undo, applySnapshot() clamps that stale frame index to the remaining frame and overwrites Frame 1 with Frame 2's snapshot. Either record frame deletion in history or remove snapshots for the deleted frame before exposing Undo again.

Useful? React with 👍 / 👎.

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