Skip to content

Conversation

@shai-almog
Copy link
Collaborator

Summary

  • loop through the active form stack in the animation screenshot test until the demo browser host is active again
  • fall back to explicitly showing the host form if repeated showBack calls fail and keep animating during waits

Testing

  • mvn -f docs/demos/pom.xml -Dtest=AnimationDemosScreenshotTest test (fails: network is unreachable while downloading UpdateCodenameOne.jar)

https://chatgpt.com/codex/tasks/task_e_68fe3b8b4ef483319f960dd8db55bc8f

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

Comment on lines 288 to 338
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);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@shai-almog shai-almog closed this Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants