PR_26179_CHARLIE_036-sprites-animation-preview#273
Conversation
There was a problem hiding this comment.
💡 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); |
There was a problem hiding this comment.
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 👍 / 👎.
| animationPreview.timerId = setInterval(() => { | ||
| showAnimationFrame((animationPreview.frameIndex + 1) % editorState.frames.length); | ||
| }, DEFAULT_FRAME_DURATION_MS); |
There was a problem hiding this comment.
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` |
There was a problem hiding this comment.
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]); |
There was a problem hiding this comment.
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 👍 / 👎.
Summary
Validation
Artifact