feat(a2ui-playground): add loading in examples#2811
Conversation
🦋 Changeset detectedLatest commit: 46d1471 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (11)
✅ Files skipped from review due to trivial changes (2)
🚧 Files skipped from review as they are similar to previous changes (7)
📝 WalkthroughWalkthroughAdds a structured animated loading overlay (title + staggered dots) in the A2UI playground, converts many mock placeholder Text nodes to ChangesLoading Overlay UI and Mock Data Updates
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
packages/genui/a2ui-playground/lynx-src/a2ui/index.css (1)
64-68: ⚡ Quick winAdd reduced-motion fallback for infinite loading animations.
Line 64 and Line 84 start perpetual animations without a
prefers-reduced-motionfallback. 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
📒 Files selected for processing (9)
packages/genui/a2ui-playground/lynx-src/a2ui/App.tsxpackages/genui/a2ui-playground/lynx-src/a2ui/index.csspackages/genui/a2ui-playground/src/mock/basic/citywalk-list.jsonpackages/genui/a2ui-playground/src/mock/basic/fridge-search.jsonpackages/genui/a2ui-playground/src/mock/basic/hangzhou-weather-trend.jsonpackages/genui/a2ui-playground/src/mock/basic/recs.jsonpackages/genui/a2ui-playground/src/mock/basic/trip-planner.jsonpackages/genui/a2ui-playground/src/mock/basic/workout-plan.jsonpackages/genui/ui-judge/tests/helpers/playground-demo-cases.ts
UI JudgeGEQI weighted score: 60.6 / 100 across 8 examples.
DetailsResult 1
Result 2
Result 3
Result 4
Result 5
Result 6
Result 7
Result 8
|
9eed202 to
b352e04
Compare
There was a problem hiding this comment.
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 | 🟡 MinorAdjust the
a2ui-promptimport resolution reasoning (it’s blocked by missing build artifacts, not missing exports)
@lynx-js/genui’s./a2ui-promptexport points to./a2ui-prompt/dist/index.d.ts+./a2ui-prompt/dist/index.js, andpackages/genui/a2ui-prompt/dist/isn’t present in this checkout—soimport/no-unresolvedcan’t resolve the typings.- The destructured APIs exist in source:
packages/genui/a2ui-prompt/src/index.tsre-exportsBASIC_CATALOG/BASIC_CATALOG_IDfrompackages/genui/server/agent/a2ui-catalog.ts, re-exportsbuildA2UISystemPromptfrompackages/genui/server/agent/a2ui-prompt.ts, and definesreadA2UICatalogFromDirectory.Run
pnpm -C packages/genui/a2ui-prompt build(and rebuild if you changed the server agent prompt/catalog sources) so thedistentrypoints/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
📒 Files selected for processing (11)
.changeset/eager-days-try.mdpackages/genui/a2ui-playground/lynx-src/a2ui/App.tsxpackages/genui/a2ui-playground/lynx-src/a2ui/index.csspackages/genui/a2ui-playground/src/mock/basic/citywalk-list.jsonpackages/genui/a2ui-playground/src/mock/basic/fridge-search.jsonpackages/genui/a2ui-playground/src/mock/basic/hangzhou-weather-trend.jsonpackages/genui/a2ui-playground/src/mock/basic/recs.jsonpackages/genui/a2ui-playground/src/mock/basic/trip-planner.jsonpackages/genui/a2ui-playground/src/mock/basic/workout-plan.jsonpackages/genui/cli/src/a2ui/index.tspackages/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
commit: |
Merging this PR will not alter performance
Comparing Footnotes
|
Summary by CodeRabbit
New Features
Bug Fixes
Checklist