-
Notifications
You must be signed in to change notification settings - Fork 435
Ensure animation screenshot test walks back nested forms #4083
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
Ensure animation screenshot test walks back nested forms #4083
Conversation
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ 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".
| private void captureAnimationFrames(Demo demo, Form form) throws IOException { | ||
| String sanitized = sanitizeFileName(demo.getTitle()); | ||
| String baseKey = storageKeyFor(demo.getTitle()); | ||
| boolean baseSaved = false; | ||
| List<String> frameKeys = new ArrayList<>(FRAMES_PER_ANIMATION); | ||
| Image finalFrameImage = null; | ||
|
|
||
| for (int frameIndex = 0; frameIndex < FRAMES_PER_ANIMATION; frameIndex++) { | ||
| if (!isAnimating(form) && frameIndex == 0) { | ||
| break; | ||
| } | ||
|
|
||
| Image frameImage = capture(form); | ||
| if (!baseSaved) { | ||
| saveScreenshot(baseKey, frameImage); | ||
| baseSaved = true; | ||
| } | ||
|
|
||
| String frameKey = stageStorageKeyFor(sanitized, frameIndex); | ||
| saveScreenshot(frameKey, frameImage); | ||
| frameKeys.add(frameKey); | ||
| finalFrameImage = frameImage; | ||
|
|
||
| if (frameIndex >= FRAMES_PER_ANIMATION - 1) { | ||
| break; | ||
| } | ||
|
|
||
| if (!advanceAnimation(form)) { | ||
| finalFrameImage = capture(form); | ||
| break; | ||
| } | ||
| } | ||
|
|
||
| if (!baseSaved) { | ||
| Image screenshot = capture(form); | ||
| saveScreenshot(baseKey, screenshot); | ||
| finalFrameImage = screenshot; | ||
| } | ||
|
|
||
| if (finalFrameImage == null) { | ||
| finalFrameImage = capture(form); | ||
| } | ||
|
|
||
| while (frameKeys.size() < FRAMES_PER_ANIMATION) { | ||
| String frameKey = stageStorageKeyFor(sanitized, frameKeys.size()); | ||
| saveScreenshot(frameKey, finalFrameImage); | ||
| frameKeys.add(frameKey); | ||
| } | ||
|
|
||
| if (!frameKeys.isEmpty()) { | ||
| recordFrameManifest(sanitized, frameKeys); |
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.
Frame capture produces unmatched screenshots
The new code captures animation sequences by writing developer-guide.animations.<title>-frame-*.png files and a manifest for each demo, but the workflow that follows (.github/scripts/compare-animation-screenshots.sh) still diffs every PNG in the storage directory against docs/developer-guide/img. No baseline assets exist for these newly produced frame images, so every run will report “No baseline found for …” and mark the job as failed even though the frames are expected. Either update the comparison script to skip or specially handle *-frame-*.png files (e.g. consult the manifest) or add matching baseline images, otherwise the CI build will consistently fail after this change.
Useful? React with 👍 / 👎.
Summary
Testing
https://chatgpt.com/codex/tasks/task_e_68fe3b8b4ef483319f960dd8db55bc8f