feat(a2ui): support playground provider settings#2687
Conversation
|
|
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 (2)
📝 WalkthroughWalkthroughAdds per-request provider overrides to AIChatPage with a Provider panel (API Key/Base URL/Model), persists baseURL/model to localStorage, threads trimmed non-empty overrides into chat and action-stream requests, updates hook dependencies, and adds responsive CSS for the provider UI. ChangesProvider Configuration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
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 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 |
c775318 to
d01ae2f
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
🧹 Nitpick comments (1)
packages/genui/a2ui-playground/src/pages/AIChatPage.tsx (1)
1224-1231: ⚡ Quick winLink the provider toggle to its controlled panel for accessibility.
Add
aria-controlson the toggle and anidon the panel so assistive tech can map the relationship.♿ Minimal patch
<button className='chatProviderToggle' type='button' aria-expanded={providerSettingsOpen} + aria-controls='provider-settings-panel' onClick={() => setProviderSettingsOpen((open) => !open)} > Provider </button> -{providerSettingsOpen ? ( - <div className='chatProviderPanel'> +{providerSettingsOpen ? ( + <div id='provider-settings-panel' className='chatProviderPanel'>Also applies to: 1234-1237
🤖 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 1224 - 1231, The provider toggle button (className 'chatProviderToggle', onClick toggling providerSettingsOpen) must include an aria-controls attribute whose value matches the id of the controlled panel element; add a unique id to the provider settings panel (e.g., "provider-settings-panel") and set aria-controls="provider-settings-panel" on the button so assistive tech can map the relationship; repeat the same change for the second toggle instance referenced around lines 1234–1237 to ensure both toggles point to the corresponding panel id.
🤖 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 253-266: The code is persisting sensitive apiKey into
localStorage; change readProviderSettings and the corresponding save/write
routine (referencing PROVIDER_SETTINGS_STORAGE_KEY and the functions
readProviderSettings / the save/write provider settings code) so that only
non-secret fields (baseURL and model) are stored and restored from localStorage,
while apiKey is not read from or written to localStorage and is kept only in
memory (or sessionStorage if ephemeral persistence across tabs is required).
Update readProviderSettings to return apiKey as an empty string and modify the
save routine to serialize only baseURL and model into localStorage.
---
Nitpick comments:
In `@packages/genui/a2ui-playground/src/pages/AIChatPage.tsx`:
- Around line 1224-1231: The provider toggle button (className
'chatProviderToggle', onClick toggling providerSettingsOpen) must include an
aria-controls attribute whose value matches the id of the controlled panel
element; add a unique id to the provider settings panel (e.g.,
"provider-settings-panel") and set aria-controls="provider-settings-panel" on
the button so assistive tech can map the relationship; repeat the same change
for the second toggle instance referenced around lines 1234–1237 to ensure both
toggles point to the corresponding panel id.
🪄 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: 91852705-1d30-42cb-bd1f-63686a079ba4
📒 Files selected for processing (2)
packages/genui/a2ui-playground/src/pages/AIChatPage.csspackages/genui/a2ui-playground/src/pages/AIChatPage.tsx
d01ae2f to
a35cdcb
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/genui/a2ui-playground/src/pages/AIChatPage.tsx (1)
1213-1215: 💤 Low valueOptional: add
aria-controlson the Provider toggle.The toggle correctly exposes
aria-expanded, but linking it to the panel viaaria-controls(and giving.chatProviderPanela matchingid) would improve screen-reader navigation between the trigger and the disclosed region.Also applies to: 1234-1241, 1244-1299
🤖 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 1213 - 1215, Add an aria-controls linkage between the provider toggle and its panel: give the panel element with className "chatProviderPanel" a stable id (e.g., "chat-provider-panel" or generated via React's useId) and add aria-controls="<that-id>" to the toggle element that already exposes aria-expanded; ensure ids are unique if multiple toggles (use useId or include an index/uuid) and update both occurrences referenced in this file so the toggle and the panel match.
🤖 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.
Nitpick comments:
In `@packages/genui/a2ui-playground/src/pages/AIChatPage.tsx`:
- Around line 1213-1215: Add an aria-controls linkage between the provider
toggle and its panel: give the panel element with className "chatProviderPanel"
a stable id (e.g., "chat-provider-panel" or generated via React's useId) and add
aria-controls="<that-id>" to the toggle element that already exposes
aria-expanded; ensure ids are unique if multiple toggles (use useId or include
an index/uuid) and update both occurrences referenced in this file so the toggle
and the panel match.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 8f770ec2-6db4-47f1-82e8-3a009c3541ca
📒 Files selected for processing (2)
packages/genui/a2ui-playground/src/pages/AIChatPage.csspackages/genui/a2ui-playground/src/pages/AIChatPage.tsx
Web Explorer#10152 Bundle Size — 903.53KiB (0%).7d38600(current) vs 0c8d6b4 main#10144(baseline) Bundle metrics
Bundle size by type
|
| Current #10152 |
Baseline #10144 |
|
|---|---|---|
499.15KiB |
499.15KiB |
|
402.16KiB |
402.16KiB |
|
2.22KiB |
2.22KiB |
Bundle analysis report Branch Sherry-hue:feat/a2ui-playground-... Project dashboard
Generated by RelativeCI Documentation Report issue
React External#1693 Bundle Size — 698.01KiB (0%).7d38600(current) vs 0c8d6b4 main#1685(baseline) Bundle metrics
|
| Current #1693 |
Baseline #1685 |
|
|---|---|---|
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:feat/a2ui-playground-... Project dashboard
Generated by RelativeCI Documentation Report issue
React Example#8577 Bundle Size — 237.81KiB (0%).7d38600(current) vs 0c8d6b4 main#8569(baseline) Bundle metrics
|
| Current #8577 |
Baseline #8569 |
|
|---|---|---|
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 #8577 |
Baseline #8569 |
|
|---|---|---|
145.76KiB |
145.76KiB |
|
92.05KiB |
92.05KiB |
Bundle analysis report Branch Sherry-hue:feat/a2ui-playground-... Project dashboard
Generated by RelativeCI Documentation Report issue
React MTF Example#1710 Bundle Size — 208.75KiB (0%).7d38600(current) vs 0c8d6b4 main#1702(baseline) Bundle metrics
|
| Current #1710 |
Baseline #1702 |
|
|---|---|---|
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 #1710 |
Baseline #1702 |
|
|---|---|---|
111.23KiB |
111.23KiB |
|
97.52KiB |
97.52KiB |
Bundle analysis report Branch Sherry-hue:feat/a2ui-playground-... Project dashboard
Generated by RelativeCI Documentation Report issue
React Example with Element Template#845 Bundle Size — 202.16KiB (0%).7d38600(current) vs 0c8d6b4 main#837(baseline) Bundle metrics
|
| Current #845 |
Baseline #837 |
|
|---|---|---|
0B |
0B |
|
0B |
0B |
|
0% |
0% |
|
0 |
0 |
|
4 |
4 |
|
100 |
100 |
|
30 |
30 |
|
39.22% |
39.22% |
|
2 |
2 |
|
0 |
0 |
Bundle size by type no changes
| Current #845 |
Baseline #837 |
|
|---|---|---|
145.76KiB |
145.76KiB |
|
56.41KiB |
56.41KiB |
Bundle analysis report Branch Sherry-hue:feat/a2ui-playground-... Project dashboard
Generated by RelativeCI Documentation Report issue
Merging this PR will degrade performance by 14.69%
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
a35cdcb to
7d38600
Compare
Summary by CodeRabbit
New Features
Style
Checklist
Notes
Validation