Skip to content

PR_26179_CHARLIE_030-sprites-undo-redo#266

Merged
ToolboxAid merged 1 commit into
mainfrom
PR_26179_CHARLIE_030-sprites-undo-redo
Jun 28, 2026
Merged

PR_26179_CHARLIE_030-sprites-undo-redo#266
ToolboxAid merged 1 commit into
mainfrom
PR_26179_CHARLIE_030-sprites-undo-redo

Conversation

@ToolboxAid

Copy link
Copy Markdown
Owner

Summary

  • Add Undo and Redo controls for Sprite Creator page-session editor actions.
  • Cover pencil, eraser, fill, clear canvas, and reset actions.
  • Keep all state unsaved and non-authoritative.

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 runtime/test files
  • PASS: targeted Sprite Creator Playwright shell test

Artifact

  • dev/workspace/zip/PR_26179_CHARLIE_030-sprites-undo-redo_delta.zip

@ToolboxAid ToolboxAid marked this pull request as ready for review June 28, 2026 20:16
@ToolboxAid ToolboxAid changed the base branch from PR_26179_CHARLIE_029-sprites-clear-reset-controls to main June 28, 2026 20:16
@ToolboxAid ToolboxAid merged commit 8eb58d1 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: 4f85c454b6

ℹ️ 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".

function resetGridToDefault() {
setGridSize(DEFAULT_GRID_SIZE);
clearCanvas();
pushUndoSnapshot();

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 Avoid recording no-op resets

When the draft is already an empty 16x16 canvas, such as immediately after undoing a paint from the initial grid, clicking Reset to 16x16 makes no visible state change but this unconditional history push clears the redo stack via pushUndoSnapshot(). That disables Redo and loses the user's ability to restore the undone edit, so the reset should only record history when the grid size or painted pixels would actually change.

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