Skip to content

PR_26179_CHARLIE_036-sprites-animation-preview#273

Merged
ToolboxAid merged 1 commit into
mainfrom
PR_26179_CHARLIE_036-sprites-animation-preview
Jun 28, 2026
Merged

PR_26179_CHARLIE_036-sprites-animation-preview#273
ToolboxAid merged 1 commit into
mainfrom
PR_26179_CHARLIE_036-sprites-animation-preview

Conversation

@ToolboxAid

Copy link
Copy Markdown
Owner

Summary

  • Add unsaved animation preview playback for Sprite Creator frames.
  • Play cycles the right preview through page-session frames; Stop returns to the selected frame.
  • 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_036-sprites-animation-preview_delta.zip

@ToolboxAid ToolboxAid marked this pull request as ready for review June 28, 2026 20:19
@ToolboxAid ToolboxAid changed the base branch from PR_26179_CHARLIE_035-sprites-frame-editing to main June 28, 2026 20:19
@ToolboxAid ToolboxAid merged commit 6a4f0a4 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: afd46a0cbe

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

renderPreview(editorState.frames[normalizedIndex]);
const status = document.querySelector("[data-sprites-animation-status]");
if (status) {
status.textContent = animationStatusText("Playing", normalizedIndex);

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 live-region updates on every animation tick

When Play Preview runs, this line rewrites [data-sprites-animation-status] every 120 ms, and the new HTML renders that element with role="status". For screen-reader users that makes the animation frame counter a live region that can announce continuously while the preview plays, making the page noisy and hard to control. Announce only play/stop, or make the per-frame counter non-live/throttled.

Useful? React with 👍 / 👎.

Comment on lines +617 to +619
animationPreview.timerId = setInterval(() => {
showAnimationFrame((animationPreview.frameIndex + 1) % editorState.frames.length);
}, DEFAULT_FRAME_DURATION_MS);

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 Stop playback when frames drop below two

If the user starts Play Preview with two frames and then clicks Delete Frame, the frame list can shrink to one while this interval keeps firing; the controls stay in the playing state and the status becomes Playing Frame 1 of 1 even though playAnimationPreview refuses to start with fewer than two frames. Re-check the frame count in the timer or stop playback from frame mutation handlers.

Useful? React with 👍 / 👎.


## ZIP

`dev/workspace/zip/PR_26179_CHARLIE_036-sprites-animation-preview_delta.zip`

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 Put the delta ZIP at the required tmp path

The root AGENTS.md Packaging rule requires the BUILD ZIP at <project folder>/tmp/<TASK_NAME>_delta.zip, but this report records dev/workspace/zip/PR_26179_CHARLIE_036-sprites-animation-preview_delta.zip while also claiming the requested path was used. This committed validation record points consumers at the wrong location; update artifact generation/reporting to use tmp/PR_26179_CHARLIE_036-sprites-animation-preview_delta.zip.

Useful? React with 👍 / 👎.

function showAnimationFrame(frameIndex) {
const normalizedIndex = frameIndex % editorState.frames.length;
animationPreview.frameIndex = normalizedIndex;
renderPreview(editorState.frames[normalizedIndex]);

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 Preserve selected draft export during playback

While Play Preview is running, this writes animation frames into the same [data-sprites-preview-canvas] that exportPreviewPng later downloads, even though the export panel promises the unsaved editor draft. If a user previews motion and clicks Download PNG before stopping, the file contains whichever animation frame the timer last rendered rather than the selected frame; stop playback or use a separate animation canvas before exporting.

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