Skip to content

feat(a2ui-playground): add loading in examples#2811

Merged
HuJean merged 1 commit into
mainfrom
p/a2ui-mock-data
Jun 8, 2026
Merged

feat(a2ui-playground): add loading in examples#2811
HuJean merged 1 commit into
mainfrom
p/a2ui-mock-data

Conversation

@HuJean

@HuJean HuJean commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features

    • Replaced static loading text with a full-screen animated loading overlay: pulsing title and staggered dot indicator.
    • Replaced many mock placeholder texts with standardized Loading components (inline or block) for consistent preview behavior across mock screens.
  • Bug Fixes

    • Fixed an import resolution error reported in the last release.

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).
  • Changeset added, and when a BREAKING CHANGE occurs, it needs to be clearly marked (or not required).

@changeset-bot

changeset-bot Bot commented Jun 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 46d1471

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@lynx-js/genui Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@HuJean HuJean marked this pull request as ready for review June 8, 2026 05:59
@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5096fea0-aa6e-4666-9c6a-c4830d031e51

📥 Commits

Reviewing files that changed from the base of the PR and between b352e04 and 46d1471.

📒 Files selected for processing (11)
  • .changeset/eager-days-try.md
  • packages/genui/a2ui-playground/lynx-src/a2ui/App.tsx
  • packages/genui/a2ui-playground/lynx-src/a2ui/index.css
  • packages/genui/a2ui-playground/src/mock/basic/citywalk-list.json
  • packages/genui/a2ui-playground/src/mock/basic/fridge-search.json
  • packages/genui/a2ui-playground/src/mock/basic/hangzhou-weather-trend.json
  • packages/genui/a2ui-playground/src/mock/basic/recs.json
  • packages/genui/a2ui-playground/src/mock/basic/trip-planner.json
  • packages/genui/a2ui-playground/src/mock/basic/workout-plan.json
  • packages/genui/cli/src/a2ui/index.ts
  • packages/genui/ui-judge/.gitignore
✅ Files skipped from review due to trivial changes (2)
  • packages/genui/ui-judge/.gitignore
  • .changeset/eager-days-try.md
🚧 Files skipped from review as they are similar to previous changes (7)
  • packages/genui/a2ui-playground/src/mock/basic/workout-plan.json
  • packages/genui/a2ui-playground/src/mock/basic/citywalk-list.json
  • packages/genui/a2ui-playground/src/mock/basic/recs.json
  • packages/genui/cli/src/a2ui/index.ts
  • packages/genui/a2ui-playground/lynx-src/a2ui/index.css
  • packages/genui/a2ui-playground/src/mock/basic/hangzhou-weather-trend.json
  • packages/genui/a2ui-playground/src/mock/basic/trip-planner.json

📝 Walkthrough

Walkthrough

Adds a structured animated loading overlay (title + staggered dots) in the A2UI playground, converts many mock placeholder Text nodes to Loading components (block/inline), remaps two CLI dynamic imports to local dist paths, adds a changeset entry, and adds a ui-judge .gitignore.

Changes

Loading Overlay UI and Mock Data Updates

Layer / File(s) Summary
Animated loading overlay implementation
packages/genui/a2ui-playground/lynx-src/a2ui/App.tsx, packages/genui/a2ui-playground/lynx-src/a2ui/index.css
App.tsx replaces single loading text with a2ui-loadingOverlay containing a2ui-loadingTitle and a2ui-loadingDots (three dot elements, two staggered). CSS adds overlay positioning, centered layout, themed colors, pulsing title animation, dot animation, and stagger delay classes.
Simple playground mocks adopt Loading component
packages/genui/a2ui-playground/src/mock/basic/citywalk-list.json, packages/genui/a2ui-playground/src/mock/basic/recs.json, packages/genui/a2ui-playground/src/mock/basic/trip-planner.json, packages/genui/a2ui-playground/src/mock/basic/workout-plan.json
Five basic mock files replace interim Text placeholders like "Generating..." and "Preparing..." with Loading components using block or inline variants.
Fridge search mock updates
packages/genui/a2ui-playground/src/mock/basic/fridge-search.json
Status bar and each product title placeholder switch from Text to Loading (inline) in the fridge-search mock.
Hangzhou weather chart replaced by Loading
packages/genui/a2ui-playground/src/mock/basic/hangzhou-weather-trend.json
The chart component is replaced with a Loading block; previous LineChart config (labels, series, metadata) is removed while updateDataModel fields remain.
CLI imports, changeset, and gitignore
packages/genui/cli/src/a2ui/index.ts, .changeset/eager-days-try.md, packages/genui/ui-judge/.gitignore
Dynamic imports in CLI are remapped to local dist paths for catalog extractor and prompt utilities. Adds a patch changeset for @lynx-js/genui and a .gitignore for ui-judge local files.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • PupilTong
  • Sherry-hue
  • gaoachao

Poem

I hopped by the UI to lend a paw,
A pulsing title, three dots in awe,
From plain text to Loading we bound,
Mock scenes now shimmer, steady and sound,
CLI imports tucked home — rabbit clap! 🐰✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: introducing Loading components throughout mock examples in a2ui-playground instead of placeholder text.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch p/a2ui-mock-data

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov

codecov Bot commented Jun 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/genui/a2ui-playground/lynx-src/a2ui/index.css (1)

64-68: ⚡ Quick win

Add reduced-motion fallback for infinite loading animations.

Line 64 and Line 84 start perpetual animations without a prefers-reduced-motion fallback. Add an override so motion-sensitive users can still use the loading state comfortably.

♿ Suggested CSS patch
 `@keyframes` a2ui-loading-dot {
   0%, 100% {
     transform: translateY(0);
     opacity: 0.25;
   }
   50% {
     transform: translateY(-2px);
     opacity: 0.9;
   }
 }
+
+@media (prefers-reduced-motion: reduce) {
+  .a2ui-loadingTitle,
+  .a2ui-loadingDot {
+    animation: none;
+  }
+
+  .a2ui-loadingDot {
+    opacity: 0.6;
+    transform: none;
+  }
+}

Also applies to: 84-88, 98-116

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/genui/a2ui-playground/lynx-src/a2ui/index.css` around lines 64 - 68,
The infinite loading animation uses animation-name: a2ui-loading-pulse (and
similar blocks at the ranges referencing those CSS rules at 64-68, 84-88, and
98-116) but lacks a prefers-reduced-motion fallback; add a media query `@media`
(prefers-reduced-motion: reduce) that targets the same selectors and forces
animations off (e.g., set animation: none !important; and transition: none
!important or animation-iteration-count: 1 and animation-duration: 0.001s) so
motion-sensitive users won't see perpetual motion.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/genui/ui-judge/tests/helpers/playground-demo-cases.ts`:
- Around line 35-39: The test assertion for the demo object with demoId
'fridge-search' is stale: expectedText currently reads "Midea 550L Frost-Free
French-Door Fridge" but the updated fridge-search.json contains different titles
(e.g., "Midea 518L Multi Door Refrigerator"); update the expectedText field of
the object (the demo entry where demoId === 'fridge-search') to match a current
title from the new mock payload (for example "Midea 518L Multi Door
Refrigerator") so the playground readiness check reflects the updated mock data.

---

Nitpick comments:
In `@packages/genui/a2ui-playground/lynx-src/a2ui/index.css`:
- Around line 64-68: The infinite loading animation uses animation-name:
a2ui-loading-pulse (and similar blocks at the ranges referencing those CSS rules
at 64-68, 84-88, and 98-116) but lacks a prefers-reduced-motion fallback; add a
media query `@media` (prefers-reduced-motion: reduce) that targets the same
selectors and forces animations off (e.g., set animation: none !important; and
transition: none !important or animation-iteration-count: 1 and
animation-duration: 0.001s) so motion-sensitive users won't see perpetual
motion.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 15f8286c-ae9d-4d56-a529-02045df448bf

📥 Commits

Reviewing files that changed from the base of the PR and between 5eb6589 and fc41b2d.

📒 Files selected for processing (9)
  • packages/genui/a2ui-playground/lynx-src/a2ui/App.tsx
  • packages/genui/a2ui-playground/lynx-src/a2ui/index.css
  • packages/genui/a2ui-playground/src/mock/basic/citywalk-list.json
  • packages/genui/a2ui-playground/src/mock/basic/fridge-search.json
  • packages/genui/a2ui-playground/src/mock/basic/hangzhou-weather-trend.json
  • packages/genui/a2ui-playground/src/mock/basic/recs.json
  • packages/genui/a2ui-playground/src/mock/basic/trip-planner.json
  • packages/genui/a2ui-playground/src/mock/basic/workout-plan.json
  • packages/genui/ui-judge/tests/helpers/playground-demo-cases.ts

Comment thread packages/genui/ui-judge/tests/helpers/playground-demo-cases.ts
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

UI Judge

GEQI weighted score: 60.6 / 100 across 8 examples.
Average visual-correctness score: 3.4 / 5.

Dimension Weight Average Results Status
Usability & Interaction 30% 2.9 / 5 8 OK
Visual & Aesthetics 25% 3.1 / 5 8 OK
Consistency & Standards 15% 3.1 / 5 8 OK
Architecture & UX Writing 15% 3.1 / 5 8 OK
Accessibility & Performance 15% 3 / 5 8 OK
# Example Visual Correctness Usability & Interaction (30%) Visual & Aesthetics (25%) Consistency & Standards (15%) Architecture & UX Writing (15%) Accessibility & Performance (15%) GEQI Page Status
1 recs 2 / 5 2 / 5 3 / 5 2 / 5 2 / 5 3 / 5 48 / 100 preview OK
2 cast-grid 5 / 5 3 / 5 4 / 5 5 / 5 4 / 5 4 / 5 77 / 100 preview OK
3 citywalk-list 2 / 5 2 / 5 3 / 5 3 / 5 2 / 5 2 / 5 48 / 100 preview OK
4 fridge-search 5 / 5 3 / 5 3 / 5 3 / 5 3 / 5 3 / 5 60 / 100 preview OK
5 trip-planner 1 / 5 2 / 5 2 / 5 2 / 5 2 / 5 2 / 5 40 / 100 preview OK
6 weather-current 5 / 5 5 / 5 4 / 5 4 / 5 5 / 5 4 / 5 89 / 100 preview OK
7 product-card 5 / 5 4 / 5 4 / 5 4 / 5 5 / 5 4 / 5 83 / 100 preview OK
8 workout-plan 2 / 5 2 / 5 2 / 5 2 / 5 2 / 5 2 / 5 40 / 100 preview OK
Details

Result 1

  • Example: recs
  • Dimension: visual-correctness
  • Visual correctness: 2 / 5
  • GEQI dimensions:
    • Usability & Interaction: 2 / 5 (30%)
    • Visual & Aesthetics: 3 / 5 (25%)
    • Consistency & Standards: 2 / 5 (15%)
    • Architecture & UX Writing: 2 / 5 (15%)
    • Accessibility & Performance: 3 / 5 (15%)
  • Task: The A2UI playground preview should show date-night dining recommendations for Moonlight Terrace, Pinewood Bistro, and Sea Breeze Kitchen.

Result 2

  • Example: cast-grid
  • Dimension: visual-correctness
  • Visual correctness: 5 / 5
  • GEQI dimensions:
    • Usability & Interaction: 3 / 5 (30%)
    • Visual & Aesthetics: 4 / 5 (25%)
    • Consistency & Standards: 5 / 5 (15%)
    • Architecture & UX Writing: 4 / 5 (15%)
    • Accessibility & Performance: 4 / 5 (15%)
  • Task: The A2UI playground preview should show a cast grid for the short film Night Notes, including Lin Xia and Zhou Ning cast cards.

Result 3

  • Example: citywalk-list
  • Dimension: visual-correctness
  • Visual correctness: 2 / 5
  • GEQI dimensions:
    • Usability & Interaction: 2 / 5 (30%)
    • Visual & Aesthetics: 3 / 5 (25%)
    • Consistency & Standards: 3 / 5 (15%)
    • Architecture & UX Writing: 2 / 5 (15%)
    • Accessibility & Performance: 2 / 5 (15%)
  • Task: The A2UI playground preview should show weekend citywalk coffee picks with Rooftop Brew Room, Corner Canvas Lab, and Late Sun Roastery.

Result 4

  • Example: fridge-search
  • Dimension: visual-correctness
  • Visual correctness: 5 / 5
  • GEQI dimensions:
    • Usability & Interaction: 3 / 5 (30%)
    • Visual & Aesthetics: 3 / 5 (25%)
    • Consistency & Standards: 3 / 5 (15%)
    • Architecture & UX Writing: 3 / 5 (15%)
    • Accessibility & Performance: 3 / 5 (15%)
  • Task: The A2UI playground preview should show refrigerator search results with Siemens, Hualing, Haier, and Midea product cards.

Result 5

  • Example: trip-planner
  • Dimension: visual-correctness
  • Visual correctness: 1 / 5
  • GEQI dimensions:
    • Usability & Interaction: 2 / 5 (30%)
    • Visual & Aesthetics: 2 / 5 (25%)
    • Consistency & Standards: 2 / 5 (15%)
    • Architecture & UX Writing: 2 / 5 (15%)
    • Accessibility & Performance: 2 / 5 (15%)
  • Task: The A2UI playground preview should show a Kyoto 48-hour trip planner with Day 1 and Day 2 itinerary sections, including Monkey Park Viewpoint.

Result 6

  • Example: weather-current
  • Dimension: visual-correctness
  • Visual correctness: 5 / 5
  • GEQI dimensions:
    • Usability & Interaction: 5 / 5 (30%)
    • Visual & Aesthetics: 4 / 5 (25%)
    • Consistency & Standards: 4 / 5 (15%)
    • Architecture & UX Writing: 5 / 5 (15%)
    • Accessibility & Performance: 4 / 5 (15%)
  • Task: The A2UI playground preview should show the current weather for Austin, TX, including clear skies with light breeze.

Result 7

  • Example: product-card
  • Dimension: visual-correctness
  • Visual correctness: 5 / 5
  • GEQI dimensions:
    • Usability & Interaction: 4 / 5 (30%)
    • Visual & Aesthetics: 4 / 5 (25%)
    • Consistency & Standards: 4 / 5 (15%)
    • Architecture & UX Writing: 5 / 5 (15%)
    • Accessibility & Performance: 4 / 5 (15%)
  • Task: The A2UI playground preview should show a Wireless Headphones Pro product card with a visible Add to Cart action.

Result 8

  • Example: workout-plan
  • Dimension: visual-correctness
  • Visual correctness: 2 / 5
  • GEQI dimensions:
    • Usability & Interaction: 2 / 5 (30%)
    • Visual & Aesthetics: 2 / 5 (25%)
    • Consistency & Standards: 2 / 5 (15%)
    • Architecture & UX Writing: 2 / 5 (15%)
    • Accessibility & Performance: 2 / 5 (15%)
  • Task: The A2UI playground preview should show a weekly workout plan with five days from Monday Ramp-Up through Friday Conditioning.

Workflow run

@HuJean HuJean force-pushed the p/a2ui-mock-data branch 3 times, most recently from 9eed202 to b352e04 Compare June 8, 2026 11:28

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/genui/cli/src/a2ui/index.ts (1)

136-142: ⚠️ Potential issue | 🟡 Minor

Adjust the a2ui-prompt import resolution reasoning (it’s blocked by missing build artifacts, not missing exports)

  • @lynx-js/genui’s ./a2ui-prompt export points to ./a2ui-prompt/dist/index.d.ts + ./a2ui-prompt/dist/index.js, and packages/genui/a2ui-prompt/dist/ isn’t present in this checkout—so import/no-unresolved can’t resolve the typings.
  • The destructured APIs exist in source: packages/genui/a2ui-prompt/src/index.ts re-exports BASIC_CATALOG/BASIC_CATALOG_ID from packages/genui/server/agent/a2ui-catalog.ts, re-exports buildA2UISystemPrompt from packages/genui/server/agent/a2ui-prompt.ts, and defines readA2UICatalogFromDirectory.

Run pnpm -C packages/genui/a2ui-prompt build (and rebuild if you changed the server agent prompt/catalog sources) so the dist entrypoints/typings exist when this dynamic import runs.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/genui/cli/src/a2ui/index.ts` around lines 136 - 142, The dynamic
import of `@lynx-js/genui/a2ui-prompt` in packages/genui/cli/src/a2ui/index.ts is
being flagged by import/no-unresolved because the package's dist/ artifacts
(which provide ./a2ui-prompt/dist/index.js and its typings) are missing—not
because the exported symbols are absent; ensure the build products exist by
running pnpm -C packages/genui/a2ui-prompt build (and rebuild after any changes
to the server agent sources), so the exported symbols BASIC_CATALOG,
BASIC_CATALOG_ID, buildA2UISystemPrompt, and readA2UICatalogFromDirectory can be
resolved at runtime by the dynamic import.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@packages/genui/cli/src/a2ui/index.ts`:
- Around line 136-142: The dynamic import of `@lynx-js/genui/a2ui-prompt` in
packages/genui/cli/src/a2ui/index.ts is being flagged by import/no-unresolved
because the package's dist/ artifacts (which provide ./a2ui-prompt/dist/index.js
and its typings) are missing—not because the exported symbols are absent; ensure
the build products exist by running pnpm -C packages/genui/a2ui-prompt build
(and rebuild after any changes to the server agent sources), so the exported
symbols BASIC_CATALOG, BASIC_CATALOG_ID, buildA2UISystemPrompt, and
readA2UICatalogFromDirectory can be resolved at runtime by the dynamic import.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d5b95c5b-49a5-4ee5-a405-56ca1fa3cd73

📥 Commits

Reviewing files that changed from the base of the PR and between fc41b2d and ea87792.

📒 Files selected for processing (11)
  • .changeset/eager-days-try.md
  • packages/genui/a2ui-playground/lynx-src/a2ui/App.tsx
  • packages/genui/a2ui-playground/lynx-src/a2ui/index.css
  • packages/genui/a2ui-playground/src/mock/basic/citywalk-list.json
  • packages/genui/a2ui-playground/src/mock/basic/fridge-search.json
  • packages/genui/a2ui-playground/src/mock/basic/hangzhou-weather-trend.json
  • packages/genui/a2ui-playground/src/mock/basic/recs.json
  • packages/genui/a2ui-playground/src/mock/basic/trip-planner.json
  • packages/genui/a2ui-playground/src/mock/basic/workout-plan.json
  • packages/genui/cli/src/a2ui/index.ts
  • packages/genui/cli/tsconfig.json
✅ Files skipped from review due to trivial changes (2)
  • .changeset/eager-days-try.md
  • packages/genui/a2ui-playground/src/mock/basic/citywalk-list.json
🚧 Files skipped from review as they are similar to previous changes (7)
  • packages/genui/a2ui-playground/src/mock/basic/trip-planner.json
  • packages/genui/a2ui-playground/src/mock/basic/workout-plan.json
  • packages/genui/a2ui-playground/src/mock/basic/hangzhou-weather-trend.json
  • packages/genui/a2ui-playground/lynx-src/a2ui/App.tsx
  • packages/genui/a2ui-playground/src/mock/basic/fridge-search.json
  • packages/genui/a2ui-playground/src/mock/basic/recs.json
  • packages/genui/a2ui-playground/lynx-src/a2ui/index.css

@pkg-pr-new

pkg-pr-new Bot commented Jun 8, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@lynx-js/genui@2811

commit: 46d1471

@codspeed-hq

codspeed-hq Bot commented Jun 8, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 87 untouched benchmarks
⏩ 26 skipped benchmarks1


Comparing p/a2ui-mock-data (46d1471) with main (ef84609)2

Open in CodSpeed

Footnotes

  1. 26 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on main (28039c8) during the generation of this report, so ef84609 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@HuJean HuJean force-pushed the p/a2ui-mock-data branch from b352e04 to 46d1471 Compare June 8, 2026 14:10
@HuJean HuJean enabled auto-merge (squash) June 8, 2026 14:13
@HuJean HuJean merged commit 4d3ba05 into main Jun 8, 2026
45 checks passed
@HuJean HuJean deleted the p/a2ui-mock-data branch June 8, 2026 14:37
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.

2 participants