Skip to content

feat(a2ui): refine playground create experience#2690

Open
Sherry-hue wants to merge 1 commit into
lynx-family:mainfrom
Sherry-hue:codex/a2ui-playground-ai-ui
Open

feat(a2ui): refine playground create experience#2690
Sherry-hue wants to merge 1 commit into
lynx-family:mainfrom
Sherry-hue:codex/a2ui-playground-ai-ui

Conversation

@Sherry-hue
Copy link
Copy Markdown
Collaborator

@Sherry-hue Sherry-hue commented May 22, 2026

Summary by CodeRabbit

  • New Features

    • Configurable AI provider presets with local persistence and a “Custom Provider” option; preset selection shown in the header badge. Provider controls now live in the composer footer and the composer supports multi-line input (Enter to send, Shift+Enter for newline); send disabled when input is empty or while generating.
  • Style

    • Redesigned chat and preview UIs: gradients, card-like composer, refreshed conversation list items and actions, updated buttons/hover states, chat/header/input spacing, and improved responsive/QR preview layouts.

Review Change Stack

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
Copy link
Copy Markdown

changeset-bot Bot commented May 22, 2026

⚠️ No Changeset found

Latest commit: 17cfab9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 22, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds localStorage-persisted AI provider presets and a textarea composer (Enter sends, Shift+Enter newline), includes derived providerRequestOptions in message/action payloads, and restyles the conversation panel, chat composer, chat area, and preview with expanded responsive rules.

Changes

AI Chat UI Redesign with Provider Configuration

Layer / File(s) Summary
Conversation panel visual redesign
packages/genui/a2ui-playground/src/pages/AIChatPage.css
Redesigns left conversation panel with gradient container, adjusted header/create-row, "new conversation" button restyle, bordered card list items with persistent left accent, updated typography, spacing, and action reveal transitions.
Chat panel and input area styling
packages/genui/a2ui-playground/src/pages/AIChatPage.css
Changes main chat panel to layered gradient, updates header backdrop/padding, increases chat message horizontal padding, and restyles chat input area with a gradient top fade and blended border-top.
Chat composer and provider controls styling
packages/genui/a2ui-playground/src/pages/AIChatPage.css
Adds a card-like chat composer (gradient, multi-layer shadows, transitions), resizes textarea/placeholder, restructures provider config grid and controls, restyles send button, and includes responsive adjustments for <=980px / <=720px.
Provider settings infrastructure and persistence
packages/genui/a2ui-playground/src/pages/AIChatPage.tsx
Adds typed provider presets (gpt-5.4, custom) and validation, helper to label providers, readProviderSettings() with fallback, toProviderRequestOptions() mapping, React state for providerSettings, memo/ref wiring for derived request options, and localStorage persistence including preset.
Composer behavior and provider UI integration
packages/genui/a2ui-playground/src/pages/AIChatPage.tsx
Replaces single-line input with textarea (Enter sends, Shift+Enter newline), embeds preset dropdown and conditional custom fields (baseURL/model/apiKey) into composer footer, removes header collapsible provider panel, updates keyboard handling, and disables send while generating or when input empty.
Preview and QR panel styling and responsive tweaks
packages/genui/a2ui-playground/src/styles.css
Uses min() for phone frame sizing, increases preview panel width, centers preview body (min-height: 0), tightens QR section with max-height/scrolling and smaller typography, and expands <=980px / <=720px responsive behavior.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes


Possibly related PRs


Suggested reviewers

  • HuJean
  • PupilTong
  • gaoachao

Poem

🐰 I hop where gradients softly glow,
I tuck a preset in my paw below,
A textarea blooms — Enter sends the cheer,
Badges show custom or the server near,
Hop, type, send — new chats appear.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

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.
Title check ❓ Inconclusive The title 'refine playground create experience' is vague and does not clearly communicate the main changes. The PR modifies styling (CSS), implements a preset system for AI provider settings, and refactors the chat UI/composer, but the title provides no specific insight into these substantial changes. Consider a more specific title that conveys the key technical changes, such as 'feat(a2ui): implement AI provider presets and refactor chat composer' or similar, to better reflect the scope of modifications.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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 unit tests (beta)
  • Create PR with unit tests

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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

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

⚠️ Outside diff range comments (1)
packages/genui/a2ui-playground/src/pages/AIChatPage.tsx (1)

1133-1140: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Decouple action-stream abort from providerSettings-triggered listener re-runs
In packages/genui/a2ui-playground/src/pages/AIChatPage.tsx, the window message listener effect depends on providerSettings, but its cleanup aborts actionAbortRef.current. Changing provider settings therefore cancels an in-flight action stream (despite the cleanup comment implying unmount/hot reload only).

Suggested fix
+  useEffect(() => {
+    return () => {
+      actionAbortRef.current?.abort();
+      actionAbortRef.current = null;
+    };
+  }, []);
+
   useEffect(() => {
@@
     window.addEventListener('message', handleMessage);
     return () => {
       window.removeEventListener('message', handleMessage);
-      // Cancel any in-flight action stream when this effect tears down
-      // (component unmount / hot reload) so its callbacks can't fire.
-      actionAbortRef.current?.abort();
-      actionAbortRef.current = null;
     };
   }, [buildConversationContext, providerSettings, recordTurn]);
🤖 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/src/pages/AIChatPage.tsx` around lines 1133 -
1140, The current effect that registers window.addEventListener('message',
handleMessage) also aborts actionAbortRef.current in its cleanup, causing
in-flight action streams to be canceled when providerSettings changes; split
responsibilities so removing the listener does not abort streams. Modify the
effect that installs handleMessage (the one referencing window.addEventListener
and handleMessage) to only add/remove the listener in its cleanup (do not touch
actionAbortRef), and move the abort semantics into a separate lifecycle cleanup
tied to component unmount (e.g., a useEffect with no deps that returns a cleanup
which checks actionAbortRef.current?.abort() and nulls it). Ensure references to
buildConversationContext/recordTurn remain correct where needed and that
actionAbortRef is only aborted on actual unmount/hot-reload.
🧹 Nitpick comments (3)
packages/genui/a2ui-playground/src/styles.css (3)

1081-1083: ⚡ Quick win

Reconsider min-height constraint for medium viewports.

Setting min-height: 460px on .previewPanelBody at the 980px breakpoint may cause layout issues on devices with limited vertical space (e.g., tablets in landscape orientation at 768px height). This rigid constraint could force unwanted scrolling or prevent proper content stacking.

Consider reducing this value or using a viewport-relative unit (min-height: 50vh) to adapt better to varying screen heights.

🤖 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/src/styles.css` around lines 1081 - 1083, The
fixed min-height on .previewPanelBody at the 980px breakpoint is too rigid and
can cause layout/scroll problems on shorter screens; update the CSS rule for
.previewPanelBody (the selector) to use a more adaptive constraint — e.g.,
reduce the fixed px value or replace min-height: 460px with a viewport-relative
unit like min-height: 50vh (or a smaller px value) and test on medium-height
viewports to ensure content stacks without forcing scroll.

1116-1119: ⚡ Quick win

Reconsider min-height constraint for mobile viewports.

At the 720px breakpoint (mobile devices), min-height: 420px for .previewPanelBody consumes approximately 50% of the viewport height on typical mobile screens (e.g., 844px tall). This rigid constraint may impair scrolling UX and content accessibility on smaller devices.

Consider reducing this value significantly or removing the min-height constraint entirely to allow natural content flow on mobile.

🤖 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/src/styles.css` around lines 1116 - 1119, The
.previewPanelBody rule currently sets min-height: 420px which is too tall for
mobile; update the CSS to override or remove this constraint at the mobile
breakpoint (around 720px) by adding a media query that targets max-width: 720px
and sets .previewPanelBody to a much smaller min-height (e.g., 0 or 200px) or to
min-height: auto so content can flow naturally and scrolling remains usable;
locate the .previewPanelBody rule and add the override within the mobile media
query to ensure desktop behavior remains unchanged.

345-347: 💤 Low value

Verify aspect-ratio interaction with explicit width/height constraints.

The phoneFrame now specifies both explicit width/height constraints via min() and an aspect-ratio. When both are present, the aspect-ratio may be ignored or cause unexpected layout behavior depending on the flex/sizing context. Additionally, the ratio 9 / 18.8 (≈0.479) is non-standard for phone displays.

Consider whether the aspect-ratio is necessary given the explicit dimensions, or remove the explicit height constraint to let aspect-ratio control it.

🤖 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/src/styles.css` around lines 345 - 347, The
.phoneFrame CSS sets explicit width and height via width: min(330px, 100%);
height: min(680px, 100%); and also aspect-ratio: 9 / 18.8, which can conflict;
fix by either removing the explicit height so aspect-ratio controls height (keep
width and aspect-ratio) or remove aspect-ratio and keep explicit width/height;
if keeping the ratio, replace 9 / 18.8 with a standard phone ratio (e.g., 9 / 18
or 9 / 19) and verify the rule in the .phoneFrame context (flex/container
sizing) to ensure it’s respected.
🤖 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/a2ui-playground/src/pages/AIChatPage.tsx`:
- Around line 594-603: The current save-to-localStorage effect writes the entire
providerSettings (including customApiKey) and the message-listener effect
depends on providerSettings causing actionAbortRef.current?.abort() to run on
every providerSettings change; fix by (1) sanitizing before persistence: in the
effect that writes PROVIDER_STORAGE_KEY, build a shallow copy of
providerSettings that deletes or omits customApiKey (e.g., sanitized = {
...providerSettings }; delete sanitized.customApiKey) and JSON.stringify that
sanitized object instead of providerSettings, and (2) decouple the message
listener from providerSettings: keep a mutable ref latestProviderSettingsRef and
update it in a separate small effect when providerSettings changes, then
register window.addEventListener('message', handleMessage) in an effect whose
dependency array does not include providerSettings (use buildConversationContext
and recordTurn refs if needed) so the cleanup only aborts actionAbortRef on
unmount, and have handleMessage/read handlers read the current settings from
latestProviderSettingsRef instead of closed-over providerSettings.

---

Outside diff comments:
In `@packages/genui/a2ui-playground/src/pages/AIChatPage.tsx`:
- Around line 1133-1140: The current effect that registers
window.addEventListener('message', handleMessage) also aborts
actionAbortRef.current in its cleanup, causing in-flight action streams to be
canceled when providerSettings changes; split responsibilities so removing the
listener does not abort streams. Modify the effect that installs handleMessage
(the one referencing window.addEventListener and handleMessage) to only
add/remove the listener in its cleanup (do not touch actionAbortRef), and move
the abort semantics into a separate lifecycle cleanup tied to component unmount
(e.g., a useEffect with no deps that returns a cleanup which checks
actionAbortRef.current?.abort() and nulls it). Ensure references to
buildConversationContext/recordTurn remain correct where needed and that
actionAbortRef is only aborted on actual unmount/hot-reload.

---

Nitpick comments:
In `@packages/genui/a2ui-playground/src/styles.css`:
- Around line 1081-1083: The fixed min-height on .previewPanelBody at the 980px
breakpoint is too rigid and can cause layout/scroll problems on shorter screens;
update the CSS rule for .previewPanelBody (the selector) to use a more adaptive
constraint — e.g., reduce the fixed px value or replace min-height: 460px with a
viewport-relative unit like min-height: 50vh (or a smaller px value) and test on
medium-height viewports to ensure content stacks without forcing scroll.
- Around line 1116-1119: The .previewPanelBody rule currently sets min-height:
420px which is too tall for mobile; update the CSS to override or remove this
constraint at the mobile breakpoint (around 720px) by adding a media query that
targets max-width: 720px and sets .previewPanelBody to a much smaller min-height
(e.g., 0 or 200px) or to min-height: auto so content can flow naturally and
scrolling remains usable; locate the .previewPanelBody rule and add the override
within the mobile media query to ensure desktop behavior remains unchanged.
- Around line 345-347: The .phoneFrame CSS sets explicit width and height via
width: min(330px, 100%); height: min(680px, 100%); and also aspect-ratio: 9 /
18.8, which can conflict; fix by either removing the explicit height so
aspect-ratio controls height (keep width and aspect-ratio) or remove
aspect-ratio and keep explicit width/height; if keeping the ratio, replace 9 /
18.8 with a standard phone ratio (e.g., 9 / 18 or 9 / 19) and verify the rule in
the .phoneFrame context (flex/container sizing) to ensure it’s respected.
🪄 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: 7086016a-b224-42a7-bb76-17b89ce6c321

📥 Commits

Reviewing files that changed from the base of the PR and between 2d64575 and c3f36fd.

📒 Files selected for processing (3)
  • packages/genui/a2ui-playground/src/pages/AIChatPage.css
  • packages/genui/a2ui-playground/src/pages/AIChatPage.tsx
  • packages/genui/a2ui-playground/src/styles.css

Comment thread packages/genui/a2ui-playground/src/pages/AIChatPage.tsx
@Sherry-hue Sherry-hue force-pushed the codex/a2ui-playground-ai-ui branch from c3f36fd to cd01e98 Compare May 22, 2026 06:36
@codecov
Copy link
Copy Markdown

codecov Bot commented May 22, 2026

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!

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
packages/genui/a2ui-playground/src/pages/AIChatPage.tsx (1)

1160-1167: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Action-stream effect teardown still aborts on provider edits

Line 1167 includes providerRequestOptions in the listener effect deps, so editing provider fields re-runs cleanup and aborts active action streams (Line 1164). This is still a user-visible interruption.

Proposed minimal fix
+  const latestProviderRequestOptionsRef = useRef<ProviderRequestOptions>(
+    providerRequestOptions,
+  );
+
+  useEffect(() => {
+    latestProviderRequestOptionsRef.current = providerRequestOptions;
+  }, [providerRequestOptions]);
+
   useEffect(() => {
     const handleMessage = (e: MessageEvent<unknown>) => {
@@
             body: JSON.stringify({
               surfaceId: payload.surfaceId,
               action,
               conversation: requestConversation,
-              ...providerRequestOptions,
+              ...latestProviderRequestOptionsRef.current,
             }),
             signal,
           });
@@
-  }, [buildConversationContext, providerRequestOptions, recordTurn]);
+  }, [buildConversationContext, recordTurn]);
🤖 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/src/pages/AIChatPage.tsx` around lines 1160 -
1167, The effect that registers the window 'message' listener (using
handleMessage) is currently depending on providerRequestOptions, so when
provider fields change the cleanup aborts any in-flight action stream via
actionAbortRef.current?.abort(); remove providerRequestOptions from the effect
dependency array and instead reference it via a stable ref (e.g.,
providerRequestOptionsRef.current) or derive any needed values inside
handleMessage from a ref so the effect only depends on stable identifiers
(buildConversationContext, recordTurn, handleMessage) — this prevents provider
edits from re-running the teardown and aborting active action streams while
preserving correct access to providerRequestOptions.
🧹 Nitpick comments (1)
packages/genui/a2ui-playground/src/pages/AIChatPage.css (1)

340-356: 💤 Low value

Consider accessibility of hidden-by-default actions.

The action buttons are hidden by default (opacity: 0) and only reveal on hover, active, or focus-within states. While focus-within helps keyboard users and the responsive design makes them permanently visible on smaller screens (line 1143-1146), some screen reader users or users with motor impairments might have difficulty discovering these controls on desktop. Consider whether the trade-off between visual cleanliness and discoverability is appropriate for your user base.

🤖 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/src/pages/AIChatPage.css` around lines 340 -
356, The action buttons (.conversationListItemActions) are visually hidden via
opacity:0 and only revealed on :hover/:focus-within which can make them hard to
discover for keyboard and screen-reader users; update the implementation so
actions remain keyboard-focusable and accessible even when visually hidden
(e.g., ensure interactive elements inside .conversationListItemActions have
tabindex/focusable attributes and ARIA labels, toggle aria-hidden only visually
rather than removing from the accessibility tree, or provide an sr-only
visible-for-screen-readers fallback) and keep the existing :focus-within reveal
behavior for sighted users; reference .conversationListItemActions,
.conversationListItem:hover, .conversationListItem-active and :focus-within when
making these changes.
🤖 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/a2ui-playground/src/pages/AIChatPage.tsx`:
- Around line 1170-1173: The Enter-to-send handler currently triggers send on
Enter (unless Shift) even during IME composition; modify the keyboard handler
(the inline (e: React.KeyboardEvent<HTMLTextAreaElement>) => { ... } that calls
handleSend()) to first check and skip when composition is active by testing
e.nativeEvent.isComposing (or e.nativeEvent as any).isComposing) and return
early if true, then proceed with the existing Enter + !shift check and call
handleSend(); this prevents submitting while composing CJK input.

---

Duplicate comments:
In `@packages/genui/a2ui-playground/src/pages/AIChatPage.tsx`:
- Around line 1160-1167: The effect that registers the window 'message' listener
(using handleMessage) is currently depending on providerRequestOptions, so when
provider fields change the cleanup aborts any in-flight action stream via
actionAbortRef.current?.abort(); remove providerRequestOptions from the effect
dependency array and instead reference it via a stable ref (e.g.,
providerRequestOptionsRef.current) or derive any needed values inside
handleMessage from a ref so the effect only depends on stable identifiers
(buildConversationContext, recordTurn, handleMessage) — this prevents provider
edits from re-running the teardown and aborting active action streams while
preserving correct access to providerRequestOptions.

---

Nitpick comments:
In `@packages/genui/a2ui-playground/src/pages/AIChatPage.css`:
- Around line 340-356: The action buttons (.conversationListItemActions) are
visually hidden via opacity:0 and only revealed on :hover/:focus-within which
can make them hard to discover for keyboard and screen-reader users; update the
implementation so actions remain keyboard-focusable and accessible even when
visually hidden (e.g., ensure interactive elements inside
.conversationListItemActions have tabindex/focusable attributes and ARIA labels,
toggle aria-hidden only visually rather than removing from the accessibility
tree, or provide an sr-only visible-for-screen-readers fallback) and keep the
existing :focus-within reveal behavior for sighted users; reference
.conversationListItemActions, .conversationListItem:hover,
.conversationListItem-active and :focus-within when making these changes.
🪄 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: 5e29c74d-b053-4330-9f39-a755caf6ae85

📥 Commits

Reviewing files that changed from the base of the PR and between c3f36fd and cd01e98.

📒 Files selected for processing (3)
  • packages/genui/a2ui-playground/src/pages/AIChatPage.css
  • packages/genui/a2ui-playground/src/pages/AIChatPage.tsx
  • packages/genui/a2ui-playground/src/styles.css

Comment thread packages/genui/a2ui-playground/src/pages/AIChatPage.tsx
@Sherry-hue Sherry-hue force-pushed the codex/a2ui-playground-ai-ui branch 2 times, most recently from 248f9dc to 36eb352 Compare May 22, 2026 06:49
@relativeci
Copy link
Copy Markdown

relativeci Bot commented May 22, 2026

React External

#1726 Bundle Size — 698.01KiB (0%).

17cfab9(current) vs 11ef105 main#1718(baseline)

Bundle metrics  no changes
                 Current
#1726
     Baseline
#1718
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
No change  Cache Invalidation 0% 0%
No change  Chunks 0 0
No change  Assets 3 3
No change  Modules 17 17
No change  Duplicate Modules 5 5
No change  Duplicate Code 8.59% 8.59%
No change  Packages 0 0
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#1726
     Baseline
#1718
No change  Other 698.01KiB 698.01KiB

Bundle analysis reportBranch Sherry-hue:codex/a2ui-playground...Project dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci Bot commented May 22, 2026

React Example with Element Template

#878 Bundle Size — 201.67KiB (0%).

17cfab9(current) vs 11ef105 main#870(baseline)

Bundle metrics  no changes
                 Current
#878
     Baseline
#870
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
Change  Cache Invalidation 0% 27.9%
No change  Chunks 0 0
No change  Assets 4 4
No change  Modules 99 99
No change  Duplicate Modules 30 30
No change  Duplicate Code 39.25% 39.25%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#878
     Baseline
#870
No change  IMG 145.76KiB 145.76KiB
No change  Other 55.91KiB 55.91KiB

Bundle analysis reportBranch Sherry-hue:codex/a2ui-playground...Project dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci Bot commented May 22, 2026

React Example

#8609 Bundle Size — 237.81KiB (0%).

17cfab9(current) vs 11ef105 main#8601(baseline)

Bundle metrics  no changes
                 Current
#8609
     Baseline
#8601
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
No change  Cache Invalidation 0% 0%
No change  Chunks 0 0
No change  Assets 4 4
No change  Modules 200 200
No change  Duplicate Modules 80 80
No change  Duplicate Code 44.68% 44.68%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#8609
     Baseline
#8601
No change  IMG 145.76KiB 145.76KiB
No change  Other 92.05KiB 92.05KiB

Bundle analysis reportBranch Sherry-hue:codex/a2ui-playground...Project dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci Bot commented May 22, 2026

React MTF Example

#1743 Bundle Size — 208.75KiB (0%).

17cfab9(current) vs 11ef105 main#1735(baseline)

Bundle metrics  no changes
                 Current
#1743
     Baseline
#1735
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
No change  Cache Invalidation 0% 0%
No change  Chunks 0 0
No change  Assets 3 3
No change  Modules 195 195
No change  Duplicate Modules 77 77
No change  Duplicate Code 44.17% 44.17%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#1743
     Baseline
#1735
No change  IMG 111.23KiB 111.23KiB
No change  Other 97.52KiB 97.52KiB

Bundle analysis reportBranch Sherry-hue:codex/a2ui-playground...Project dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci Bot commented May 22, 2026

Web Explorer

#10185 Bundle Size — 903.53KiB (0%).

17cfab9(current) vs 11ef105 main#10177(baseline)

Bundle metrics  no changes
                 Current
#10185
     Baseline
#10177
No change  Initial JS 45.06KiB 45.06KiB
No change  Initial CSS 2.22KiB 2.22KiB
No change  Cache Invalidation 0% 0%
No change  Chunks 9 9
No change  Assets 11 11
No change  Modules 232 232
No change  Duplicate Modules 11 11
No change  Duplicate Code 27.12% 27.12%
No change  Packages 10 10
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#10185
     Baseline
#10177
No change  JS 499.15KiB 499.15KiB
No change  Other 402.16KiB 402.16KiB
No change  CSS 2.22KiB 2.22KiB

Bundle analysis reportBranch Sherry-hue:codex/a2ui-playground...Project dashboard


Generated by RelativeCIDocumentationReport issue

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

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/a2ui-playground/src/pages/AIChatPage.css (1)

528-534: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix duplicate .chatProviderField styling (it’s used on <input> elements)

.chatProviderField is applied directly to <input>s in packages/genui/a2ui-playground/src/pages/AIChatPage.tsx (e.g., 1399, 1411, 1423), but packages/genui/a2ui-playground/src/pages/AIChatPage.css defines .chatProviderField twice (528-533 and 981-994). The earlier block sets display: flex / flex-direction: column, and the later “input-like” block (981-994) does not override display, so the flex styles still affect the inputs.

Either remove/rename the first .chatProviderField block (if it was meant for a wrapper) or update the later rule to explicitly set the intended display (block/inline-flex/etc.).

Also: chatProviderFieldUrl is referenced in TSX (1399) but there’s no corresponding CSS rule.

🤖 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/src/pages/AIChatPage.css` around lines 528 -
534, There are two conflicting .chatProviderField rules causing input elements
to inherit flex container styles; either delete or rename the first
.chatProviderField block (the one with display:flex/flex-direction:column) if it
was intended for a wrapper, or update the later .chatProviderField rule (the
“input-like” block) to explicitly set the intended display (e.g., display:block
or display:inline-block) so inputs are not rendered as flex containers; also add
a CSS rule for .chatProviderFieldUrl (used in the TSX) with the appropriate
display/spacing styles to match other input styles.
🤖 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/a2ui-playground/src/pages/AIChatPage.css`:
- Around line 528-534: There are two conflicting .chatProviderField rules
causing input elements to inherit flex container styles; either delete or rename
the first .chatProviderField block (the one with
display:flex/flex-direction:column) if it was intended for a wrapper, or update
the later .chatProviderField rule (the “input-like” block) to explicitly set the
intended display (e.g., display:block or display:inline-block) so inputs are not
rendered as flex containers; also add a CSS rule for .chatProviderFieldUrl (used
in the TSX) with the appropriate display/spacing styles to match other input
styles.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 58c54b69-416f-43ae-aeb3-2cce37c35bf3

📥 Commits

Reviewing files that changed from the base of the PR and between cd01e98 and 36eb352.

📒 Files selected for processing (3)
  • packages/genui/a2ui-playground/src/pages/AIChatPage.css
  • packages/genui/a2ui-playground/src/pages/AIChatPage.tsx
  • packages/genui/a2ui-playground/src/styles.css

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 22, 2026

Merging this PR will improve performance by 17.62%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 1 improved benchmark
✅ 80 untouched benchmarks
⏩ 26 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
transform 1000 view elements 47.3 ms 40.2 ms +17.62%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing Sherry-hue:codex/a2ui-playground-ai-ui (17cfab9) with main (11ef105)

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.

@Sherry-hue Sherry-hue force-pushed the codex/a2ui-playground-ai-ui branch from 36eb352 to ff0d7bf Compare May 22, 2026 09:25
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

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

⚠️ Outside diff range comments (1)
packages/genui/a2ui-playground/src/pages/AIChatPage.css (1)

528-533: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix conflicting duplicate .chatProviderField CSS rules

packages/genui/a2ui-playground/src/pages/AIChatPage.css defines .chatProviderField twice with conflicting display values:

  • Lines 528-533: display: flex; flex-direction: column; gap: 4px;
  • Lines 981-995 (and related :focus): display: block; height: 34px; ...

Because the selector is identical, the later rule overrides the earlier one for all elements sharing this class. Scope or rename these selectors so each UI section gets the intended layout (e.g., separate “panel” vs “composer footer” field classes).

🤖 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/src/pages/AIChatPage.css` around lines 528 -
533, There are two conflicting rules for the identical CSS selector
.chatProviderField (one setting display:flex/column/gap and another setting
display:block/height/etc.); rename or scope one of them (for example rename the
column layout to .chatProviderFieldPanel or the block layout to
.chatProviderFieldFooter) and update the matching className usages in the
JSX/HTML that render those specific UI sections (e.g., change className
references that correspond to the panel vs composer footer to the new class) so
each UI section gets the intended layout without one rule overriding the other.
🤖 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/a2ui-playground/src/pages/AIChatPage.tsx`:
- Line 1001: The code is currently forwarding raw user-supplied API keys via
providerRequestOptionsRef.current to the hosted A2UI proxy; update the logic
that builds providerRequestOptions (the place spreading
providerRequestOptionsRef.current in AIChatPage.tsx and the same block around
the custom-provider flow at the later lines) to either (A) detect the
hosted/default playground endpoint and explicitly block/omit any user-supplied
secret from providerRequestOptions before sending, or (B) require an explicit
user consent flow (a modal/checkbox) that must be accepted before including the
raw API key — implement one of these: strip any key fields from
providerRequestOptionsRef.current when endpoint === DEFAULT_HOSTED_ENDPOINT (or
equivalent constant) or gate submission on a persisted consent flag and only
include the key when consent is true; apply this change in both the earlier
spread site (providerRequestOptionsRef.current) and the corresponding
custom-provider handling at lines referenced (1422-1433).
- Around line 1386-1458: The composer controls (textarea with class chatInput,
the three inputs with classes chatProviderField/chatProviderFieldUrl, and the
select chatProviderSelect powered by providerSettings/PROVIDER_PRESETS and
compactProviderLabel) lack proper accessible names; add explicit labels or
aria-label/aria-labelledby attributes for each control (e.g., associate a
<label> with an id for the textarea and each input or add aria-labels like
"Compose prompt", "Provider base URL", "Provider model", "Provider API key", and
"Provider preset") and replace reliance on placeholder/title for the select so
screen readers receive a robust name; ensure ids used by labels match the
inputs' id attributes and keep disabled/isGenerating logic unchanged.

---

Outside diff comments:
In `@packages/genui/a2ui-playground/src/pages/AIChatPage.css`:
- Around line 528-533: There are two conflicting rules for the identical CSS
selector .chatProviderField (one setting display:flex/column/gap and another
setting display:block/height/etc.); rename or scope one of them (for example
rename the column layout to .chatProviderFieldPanel or the block layout to
.chatProviderFieldFooter) and update the matching className usages in the
JSX/HTML that render those specific UI sections (e.g., change className
references that correspond to the panel vs composer footer to the new class) so
each UI section gets the intended layout without one rule overriding the other.
🪄 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: 20e8a8bd-67d4-4a60-b4ee-5d1c766ef5dd

📥 Commits

Reviewing files that changed from the base of the PR and between 36eb352 and ff0d7bf.

📒 Files selected for processing (3)
  • packages/genui/a2ui-playground/src/pages/AIChatPage.css
  • packages/genui/a2ui-playground/src/pages/AIChatPage.tsx
  • packages/genui/a2ui-playground/src/styles.css

Comment thread packages/genui/a2ui-playground/src/pages/AIChatPage.tsx Outdated
Comment thread packages/genui/a2ui-playground/src/pages/AIChatPage.tsx
@Sherry-hue Sherry-hue force-pushed the codex/a2ui-playground-ai-ui branch from ff0d7bf to 1b74fe9 Compare May 22, 2026 10:18
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

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

⚠️ Outside diff range comments (1)
packages/genui/a2ui-playground/src/styles.css (1)

676-683: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Add a mobile-safe width rule for the preview panel.

width: 520px + flex-shrink: 0 can force horizontal overflow on narrow screens because there’s no responsive override for .previewPanel.

💡 Suggested fix
 .previewPanel {
-  width: 520px;
+  width: min(520px, 100%);
+  min-width: 0;
   flex-shrink: 0;
   display: flex;
   flex-direction: column;
   background: var(--geist-surface);
   border-left: 1px solid var(--geist-border);
 }
 
 `@media` (max-width: 980px) {
+  .previewPanel {
+    width: 100%;
+  }
+
   .tabNav {
     gap: 0;
   }

Also applies to: 1070-1131

🤖 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/src/styles.css` around lines 676 - 683, The
.previewPanel rule forces a 520px fixed width with flex-shrink: 0 which causes
horizontal overflow on small screens; update the rule to be responsive by adding
max-width: 100% (to cap the width on narrow viewports) and either remove or
override flex-shrink: 0 to flex-shrink: 1 for small screens (or add a
small-screen media query that sets max-width: 100% and flex-shrink: 1). Apply
the same change to the other .previewPanel occurrences noted in the diff.
🤖 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/a2ui-playground/src/pages/AIChatPage.css`:
- Around line 340-356: The action buttons are visually hidden with opacity:0 but
still receive pointer events; update the CSS for .conversationListItemActions to
add pointer-events: none (and optionally visibility: hidden) when hidden, and
set pointer-events: auto (and visibility: visible) in the hover/active/focus
rules (.conversationListItem:hover .conversationListItemActions,
.conversationListItem-active .conversationListItemActions,
.conversationListItem:focus-within .conversationListItemActions) so they are not
clickable when invisible; apply the same changes to the other duplicate rule
block that controls these actions.

---

Outside diff comments:
In `@packages/genui/a2ui-playground/src/styles.css`:
- Around line 676-683: The .previewPanel rule forces a 520px fixed width with
flex-shrink: 0 which causes horizontal overflow on small screens; update the
rule to be responsive by adding max-width: 100% (to cap the width on narrow
viewports) and either remove or override flex-shrink: 0 to flex-shrink: 1 for
small screens (or add a small-screen media query that sets max-width: 100% and
flex-shrink: 1). Apply the same change to the other .previewPanel occurrences
noted in the diff.
🪄 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: e3dc5a5e-406e-4b5e-8fa3-7e9ee4ebcfd2

📥 Commits

Reviewing files that changed from the base of the PR and between ff0d7bf and 1b74fe9.

📒 Files selected for processing (3)
  • packages/genui/a2ui-playground/src/pages/AIChatPage.css
  • packages/genui/a2ui-playground/src/pages/AIChatPage.tsx
  • packages/genui/a2ui-playground/src/styles.css

Comment thread packages/genui/a2ui-playground/src/pages/AIChatPage.css
@Sherry-hue Sherry-hue force-pushed the codex/a2ui-playground-ai-ui branch from 1b74fe9 to 17cfab9 Compare May 22, 2026 10:27
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.

1 participant