feat(a2ui): refine playground create experience#2690
Conversation
|
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds 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. ChangesAI Chat UI Redesign with Provider Configuration
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
There was a problem hiding this comment.
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 winDecouple action-stream abort from
providerSettings-triggered listener re-runs
Inpackages/genui/a2ui-playground/src/pages/AIChatPage.tsx, thewindowmessage listener effect depends onproviderSettings, but its cleanup abortsactionAbortRef.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 winReconsider min-height constraint for medium viewports.
Setting
min-height: 460pxon.previewPanelBodyat 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 winReconsider min-height constraint for mobile viewports.
At the 720px breakpoint (mobile devices),
min-height: 420pxfor.previewPanelBodyconsumes 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 valueVerify aspect-ratio interaction with explicit width/height constraints.
The
phoneFramenow specifies both explicitwidth/heightconstraints viamin()and anaspect-ratio. When both are present, the aspect-ratio may be ignored or cause unexpected layout behavior depending on the flex/sizing context. Additionally, the ratio9 / 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
📒 Files selected for processing (3)
packages/genui/a2ui-playground/src/pages/AIChatPage.csspackages/genui/a2ui-playground/src/pages/AIChatPage.tsxpackages/genui/a2ui-playground/src/styles.css
c3f36fd to
cd01e98
Compare
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
♻️ Duplicate comments (1)
packages/genui/a2ui-playground/src/pages/AIChatPage.tsx (1)
1160-1167:⚠️ Potential issue | 🟠 Major | ⚡ Quick winAction-stream effect teardown still aborts on provider edits
Line 1167 includes
providerRequestOptionsin 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 valueConsider 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. Whilefocus-withinhelps 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
📒 Files selected for processing (3)
packages/genui/a2ui-playground/src/pages/AIChatPage.csspackages/genui/a2ui-playground/src/pages/AIChatPage.tsxpackages/genui/a2ui-playground/src/styles.css
248f9dc to
36eb352
Compare
React External#1726 Bundle Size — 698.01KiB (0%).17cfab9(current) vs 11ef105 main#1718(baseline) Bundle metrics
|
| Current #1726 |
Baseline #1718 |
|
|---|---|---|
0B |
0B |
|
0B |
0B |
|
0% |
0% |
|
0 |
0 |
|
3 |
3 |
|
17 |
17 |
|
5 |
5 |
|
8.59% |
8.59% |
|
0 |
0 |
|
0 |
0 |
Bundle analysis report Branch Sherry-hue:codex/a2ui-playground... Project dashboard
Generated by RelativeCI Documentation Report issue
React Example with Element Template#878 Bundle Size — 201.67KiB (0%).17cfab9(current) vs 11ef105 main#870(baseline) Bundle metrics
|
| Current #878 |
Baseline #870 |
|
|---|---|---|
0B |
0B |
|
0B |
0B |
|
0% |
27.9% |
|
0 |
0 |
|
4 |
4 |
|
99 |
99 |
|
30 |
30 |
|
39.25% |
39.25% |
|
2 |
2 |
|
0 |
0 |
Bundle size by type no changes
| Current #878 |
Baseline #870 |
|
|---|---|---|
145.76KiB |
145.76KiB |
|
55.91KiB |
55.91KiB |
Bundle analysis report Branch Sherry-hue:codex/a2ui-playground... Project dashboard
Generated by RelativeCI Documentation Report issue
React Example#8609 Bundle Size — 237.81KiB (0%).17cfab9(current) vs 11ef105 main#8601(baseline) Bundle metrics
|
| Current #8609 |
Baseline #8601 |
|
|---|---|---|
0B |
0B |
|
0B |
0B |
|
0% |
0% |
|
0 |
0 |
|
4 |
4 |
|
200 |
200 |
|
80 |
80 |
|
44.68% |
44.68% |
|
2 |
2 |
|
0 |
0 |
Bundle size by type no changes
| Current #8609 |
Baseline #8601 |
|
|---|---|---|
145.76KiB |
145.76KiB |
|
92.05KiB |
92.05KiB |
Bundle analysis report Branch Sherry-hue:codex/a2ui-playground... Project dashboard
Generated by RelativeCI Documentation Report issue
React MTF Example#1743 Bundle Size — 208.75KiB (0%).17cfab9(current) vs 11ef105 main#1735(baseline) Bundle metrics
|
| Current #1743 |
Baseline #1735 |
|
|---|---|---|
0B |
0B |
|
0B |
0B |
|
0% |
0% |
|
0 |
0 |
|
3 |
3 |
|
195 |
195 |
|
77 |
77 |
|
44.17% |
44.17% |
|
2 |
2 |
|
0 |
0 |
Bundle size by type no changes
| Current #1743 |
Baseline #1735 |
|
|---|---|---|
111.23KiB |
111.23KiB |
|
97.52KiB |
97.52KiB |
Bundle analysis report Branch Sherry-hue:codex/a2ui-playground... Project dashboard
Generated by RelativeCI Documentation Report issue
Web Explorer#10185 Bundle Size — 903.53KiB (0%).17cfab9(current) vs 11ef105 main#10177(baseline) Bundle metrics
|
| Current #10185 |
Baseline #10177 |
|
|---|---|---|
45.06KiB |
45.06KiB |
|
2.22KiB |
2.22KiB |
|
0% |
0% |
|
9 |
9 |
|
11 |
11 |
|
232 |
232 |
|
11 |
11 |
|
27.12% |
27.12% |
|
10 |
10 |
|
0 |
0 |
Bundle size by type no changes
| Current #10185 |
Baseline #10177 |
|
|---|---|---|
499.15KiB |
499.15KiB |
|
402.16KiB |
402.16KiB |
|
2.22KiB |
2.22KiB |
Bundle analysis report Branch Sherry-hue:codex/a2ui-playground... Project dashboard
Generated by RelativeCI Documentation Report issue
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/a2ui-playground/src/pages/AIChatPage.css (1)
528-534:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winFix duplicate
.chatProviderFieldstyling (it’s used on<input>elements)
.chatProviderFieldis applied directly to<input>s inpackages/genui/a2ui-playground/src/pages/AIChatPage.tsx(e.g., 1399, 1411, 1423), butpackages/genui/a2ui-playground/src/pages/AIChatPage.cssdefines.chatProviderFieldtwice (528-533 and 981-994). The earlier block setsdisplay: flex/flex-direction: column, and the later “input-like” block (981-994) does not overridedisplay, so the flex styles still affect the inputs.Either remove/rename the first
.chatProviderFieldblock (if it was meant for a wrapper) or update the later rule to explicitly set the intended display (block/inline-flex/etc.).Also:
chatProviderFieldUrlis 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
📒 Files selected for processing (3)
packages/genui/a2ui-playground/src/pages/AIChatPage.csspackages/genui/a2ui-playground/src/pages/AIChatPage.tsxpackages/genui/a2ui-playground/src/styles.css
Merging this PR will improve performance by 17.62%
|
| 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)
Footnotes
-
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. ↩
36eb352 to
ff0d7bf
Compare
There was a problem hiding this comment.
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 winFix conflicting duplicate
.chatProviderFieldCSS rules
packages/genui/a2ui-playground/src/pages/AIChatPage.cssdefines.chatProviderFieldtwice with conflictingdisplayvalues:
- 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
📒 Files selected for processing (3)
packages/genui/a2ui-playground/src/pages/AIChatPage.csspackages/genui/a2ui-playground/src/pages/AIChatPage.tsxpackages/genui/a2ui-playground/src/styles.css
ff0d7bf to
1b74fe9
Compare
There was a problem hiding this comment.
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 winAdd a mobile-safe width rule for the preview panel.
width: 520px+flex-shrink: 0can 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
📒 Files selected for processing (3)
packages/genui/a2ui-playground/src/pages/AIChatPage.csspackages/genui/a2ui-playground/src/pages/AIChatPage.tsxpackages/genui/a2ui-playground/src/styles.css
1b74fe9 to
17cfab9
Compare
Summary by CodeRabbit
New Features
Style
Checklist