feat(a2ui-playground): mobile tab bar + chrome compaction#2753
Conversation
|
|
Caution Review failedFailed to post review comments 📝 WalkthroughWalkthroughAdds a reusable MobileTabBar and integrates mobile tab state into AIChatPage and DemosPage; responsive CSS at max-width:720px hides inactive panes, collapses sidebars/headers into compact strips, and exposes active tab via ChangesMobile Tab UI System
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 |
There was a problem hiding this comment.
Pull request overview
Adds a mobile (≤720px) layout for the A2UI playground that swaps between Edit and Preview panes via a bottom tab bar, and compacts surrounding chrome (header, conversations strip, scenarios strip, code toolbar, send button) so the preview is no longer pushed off-screen.
Changes:
- New
MobileTabBarcomponent withrole=tablistrendered by bothAIChatPageandDemosPage, withdata-active-tabdriving CSS-only pane switching. - CSS rules under
@media (max-width: 720px)hide the inactive pane/resize handle and convert sidebar/conversation panel into 52px horizontal strips. - Drops the brand wordmark and
chatHeaderon mobile; loosenschatSendBtnfrom full-width to a 38px pill.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/genui/a2ui-playground/src/components/MobileTabBar.tsx | New tablist component with Edit/Preview buttons. |
| packages/genui/a2ui-playground/src/pages/AIChatPage.tsx | Adds activeMobileTab state and renders MobileTabBar. |
| packages/genui/a2ui-playground/src/pages/AIChatPage.css | Mobile tab-mode rules, conversation strip, send button pill, header drop. |
| packages/genui/a2ui-playground/src/pages/DemosPage.tsx | Adds activeMobileTab state and renders MobileTabBar. |
| packages/genui/a2ui-playground/src/pages/DemosPage.css | Mobile tab-mode rules for sidebar/scenarios/code toolbar. |
| packages/genui/a2ui-playground/src/styles.css | Global .mobileTabBar/.mobileTab styles and ≤720px visibility. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1bdef03 to
abe44fc
Compare
|
Actionable comments posted: 0 |
2 similar comments
|
Actionable comments posted: 0 |
|
Actionable comments posted: 0 |
Adds a bottom tab bar (Chat/Code <-> Preview) so each pane is full screen on phones, and tightens the chrome that's eating vertical space around the input/code areas. Desktop layout is untouched. Tab bar: - New <MobileTabBar /> renders Edit + Preview tabs with role=tablist, accent-underline active state, icon + label. Always rendered, CSS shows it only at <=720px via the new shared .mobileTabBar rules. - AIChatPage + DemosPage each hold an activeMobileTab state and apply it as data-active-tab on their page root. CSS hides the non-active pane and the PanelResizeHandle. Tab switching is pure CSS — state (chat draft, scroll position, code edits) is preserved. Chrome compaction (<=720px): - "Lynx GenUI Playground" wordmark drops on phones (was truncating to "Lynx GenUI Playg..."). Logo alone carries the brand. - Send button no longer forced to width: 100%; stays a 38px pill next to the model selector. - Conversation panel collapses into a 52px horizontal strip: + New Chat as a 36px icon button, conversations as one-line chips with the desktop active-bar indicator and Edit/Del revealed only on the active chip (matching desktop hover behavior). - Scenarios sidebar collapses the same way: back-icon on the left, scenarios as one-line chips scrolling horizontally on the right; SCENARIOS heading dropped (redundant when chips are the only content in the strip). - "Create / Online Agent / Describe the UI..." page header dropped on mobile — the input area itself communicates the same thing and this band was eating ~120px. - A2UI Messages title gets white-space: nowrap (was wrapping to two lines), JSON badge hidden, toolbar buttons tighter, code panel flex: 1 so the editor fills the freed vertical space.
The Preview panel's auto-fullscreen effect was firing on demo selection at any viewport ≤980px. Since the new bottom tab bar (Chat/Code <-> Preview) kicks in at ≤720px, the auto-fullscreen would override it on phones: tapping the Preview tab landed the user in a fullscreen overlay with only an X to escape, bypassing the tab system entirely. Narrow the auto-fullscreen range to 721–980px so the tablet/narrow- desktop case still gets the focus boost, while phones let the tab bar drive the layout.
de40a78 to
15a0d59
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Merging this PR will not alter performance
Comparing Footnotes
|
Summary
Reworks the A2UI playground for phones (≤720px) so the preview isn't permanently pushed below the fold. Each page now has two full-screen panes — Chat/Code and Preview — toggled by a bottom tab bar. Everything else around the input/code area gets tightened. Desktop layout is untouched.
Tab bar
<MobileTabBar />renders Edit + Preview tabs withrole=tablist, accent-underline active state, icon + label. Always rendered; CSS shows it only at≤720pxvia.mobileTabBarrules instyles.css.AIChatPageandDemosPageeach hold anactiveMobileTabstate and apply it asdata-active-tabon their page root. CSS hides the non-active pane and thePanelResizeHandle. Tab switching is pure CSS — state (chat draft, scroll position, code edits, simulation speed) is preserved across tabs.Chrome compaction (
≤720px)Lynx GenUI Playgroundwordmark drops on phones (was truncating toLynx GenUI Playg…). Logo alone carries the brand.width: 100%; stays a compact 38px pill next to the model selector.+ New Chatas a 36px icon button, conversations as single-line chips with the desktop active-bar indicator.Edit/Delrevealed only on the active chip (matches desktop hover behavior — was force-shown on every card before).SCENARIOSheading dropped (redundant when chips are the only content).Create/Online Agent/Describe the UI…) dropped on mobile — the input area itself communicates the same thing and this band was eating ~120px.A2UI Messagestitle getswhite-space: nowrap(was wrapping to two lines), JSON badge hidden, toolbar buttons tighter, code panelflex: 1so the editor fills the freed space.Test plan
+icon button + horizontal chip list.Edit/Delonly visible on the active chip.Open on phonesheet trigger from feat(a2ui-playground): container queries + mobile share sheet #2731 still works.Summary by CodeRabbit
New Features
Style