-
Notifications
You must be signed in to change notification settings - Fork 0
PR_26179_CHARLIE_030-sprites-undo-redo #266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
73 changes: 73 additions & 0 deletions
73
docs_build/dev/reports/PR_26179_CHARLIE_030-sprites-undo-redo.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| # PR_26179_CHARLIE_030-sprites-undo-redo | ||
|
|
||
| Team: CHARLIE | ||
|
|
||
| Mode: Batch governance stacked feature workflow | ||
|
|
||
| Base branch: PR_26179_CHARLIE_029-sprites-clear-reset-controls | ||
|
|
||
| Branch: PR_26179_CHARLIE_030-sprites-undo-redo | ||
|
|
||
| ## Summary | ||
|
|
||
| Added undo and redo controls for Sprite Creator page-session editor actions. Undo/redo covers pencil, eraser, fill, clear canvas, and grid reset actions while preserving the unsaved editor-state-only model. No persistence, database, API, schema, or start_of_day files were changed. | ||
|
|
||
| ## Branch Validation | ||
|
|
||
| PASS | ||
|
|
||
| - Started from the prior stacked Sprite branch. | ||
| - Scope stayed limited to Sprite Creator undo/redo. | ||
| - No DB/API/schema/runtime ownership changes. | ||
| - No browser-owned authoritative product data was introduced. | ||
| - No start_of_day files were changed. | ||
| - ZIP package created at the user-requested batch path. | ||
|
|
||
| ## Requirement Checklist | ||
|
|
||
| PASS - Add undo/redo for drawing. | ||
|
|
||
| PASS - Add undo/redo for erase. | ||
|
|
||
| PASS - Add undo/redo for fill. | ||
|
|
||
| PASS - Add undo/redo for clear canvas. | ||
|
|
||
| PASS - Add undo/redo for grid reset. | ||
|
|
||
| PASS - Keep state as unsaved page-session editor state only. | ||
|
|
||
| PASS - No persistence added. | ||
|
|
||
| PASS - No DB/API/schema changes. | ||
|
|
||
| PASS - No stale PR #219-#228 code copied. | ||
|
|
||
| PASS - Targeted Playwright test updated. | ||
|
|
||
| ## Validation Lane | ||
|
|
||
| PASS - `node --check assets/toolbox/sprites/js/index.js` | ||
|
|
||
| PASS - `node --check dev/tests/playwright/tools/SpritesToolShell.spec.mjs` | ||
|
|
||
| PASS - `git diff --check -- toolbox/sprites/index.html assets/toolbox/sprites/js/index.js dev/tests/playwright/tools/SpritesToolShell.spec.mjs` | ||
|
|
||
| PASS - Guard scan found no prohibited inline style/script/event-handler or stale placeholder text in touched runtime files. | ||
|
|
||
| PASS - `npx playwright test dev/tests/playwright/tools/SpritesToolShell.spec.mjs --workers=1 --reporter=list` | ||
|
|
||
| ## Manual Validation Notes | ||
|
|
||
| 1. Open `toolbox/sprites/index.html`. | ||
| 2. Confirm Undo and Redo controls are visible and disabled before edits. | ||
| 3. Switch to 32x32 and confirm Undo becomes available. | ||
| 4. Paint a pixel, undo it, then redo it. | ||
| 5. Erase a pixel, undo it, then redo it. | ||
| 6. Fill the canvas, undo to the prior draft, then redo the fill. | ||
| 7. Clear the canvas, undo to restore the filled draft, then redo the clear. | ||
| 8. Reset to 16x16, undo to restore the prior 32x32 draft, then redo the reset. | ||
|
|
||
| ## ZIP | ||
|
|
||
| `dev/workspace/zip/PR_26179_CHARLIE_030-sprites-undo-redo_delta.zip` |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| toolbox/sprites/index.html | ||
| assets/toolbox/sprites/js/index.js | ||
| dev/tests/playwright/tools/SpritesToolShell.spec.mjs | ||
| docs_build/dev/reports/PR_26179_CHARLIE_029-sprites-clear-reset-controls.md | ||
| docs_build/dev/reports/PR_26179_CHARLIE_030-sprites-undo-redo.md | ||
| docs_build/dev/reports/codex_changed_files.txt | ||
| docs_build/dev/reports/codex_review.diff | ||
| toolbox/sprites/index.html |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the draft is already an empty 16x16 canvas, such as immediately after undoing a paint from the initial grid, clicking
Reset to 16x16makes no visible state change but this unconditional history push clears the redo stack viapushUndoSnapshot(). 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 👍 / 👎.