fix(site/src): show chat instead of the right panel on small viewports - #28387
Conversation
The task list sidebar (TasksSidebar) had a fixed width up to 320px and never collapsed automatically. On narrow viewports it consumed most of the available width, leaving the chat/apps PanelGroup almost no room. Combined with missing min-w-0 on flex ancestors, the layout overflowed instead of shrinking, which let the right-hand apps panel dominate the screen while the chat panel on the left was squeezed to a sliver. - Auto-collapse TasksSidebar below the md breakpoint (matches the existing useIsBelowMdViewport hook used elsewhere); users can still expand it manually. - Add min-w-0 to the TaskPage main column and TaskTopbar header so they shrink to the available width instead of forcing overflow. - Allow the topbar's action buttons to wrap instead of overflowing on narrow screens.
Below the lg breakpoint, the AgentChatPage shows either chat or the right panel (Summary/Git/Terminal/etc.) full-width at a time, driven by the right panel's open/closed state. That state is a persisted user preference (localStorage), so a panel left open on a wide window used to keep hiding chat the moment the window narrowed, with only a small back arrow to recover. Add a useIsBelowLgViewport hook and use it to suppress the right panel the moment the viewport crosses into the narrow range, so chat is shown by default. The suppression is transient rather than persisted: widening back past the breakpoint, or explicitly opening a tab while already narrow, both restore the real preference instead of losing it, matching how the left TasksSidebar reacts to viewport changes instead of overwriting the user's choice.
Extract the narrow-viewport suppression into an exported useRightPanelNarrowSuppression hook that adjusts state during render instead of an effect, and give it renderHook coverage. Move the lg viewport hook into its own file to mirror useIsBelowMdViewport. Add mobile-viewport stories for the suppressed right panel and the auto-collapsed tasks sidebar.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c136525cdb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Exercise the explicit panel toggle in the narrow-viewport story so a clearSuppression regression fails the interaction test, and type the matchMedia mock with satisfies so DOM signature drift is caught.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d644928f11
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…pers Derive one canonical showSidebarPanel value from the persisted preference and the narrow suppression, narrow the setter to a plain boolean so the raw-vs-effective updater bug cannot be reintroduced, share the media-query subscription between breakpoint hooks, and extract a reusable matchMedia test helper.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e77b9b1b16
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…essed Gate visualExpanded and the RightPanel isExpanded prop on the panel being shown, so a panel expanded on a wide viewport no longer covers chat after the window narrows (or after an explicit close). The shared matchMedia stub now delegates unconfigured queries to the real implementation so story environments keep truthful responsive behavior, and a story covers expand-then-narrow via a simulated breakpoint crossing.
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
ibetitsmike
left a comment
There was a problem hiding this comment.
Reviewed the fix and drove it through the Codex review loop: three rounds of findings fixed (interaction coverage for the panel toggle, typed matchMedia mock, shared media-query subscription, and gating the expanded panel on suppression, proven red-green), with a clean Codex verdict on f5f0615 and all checks green.
Shux acted on Mike's (@ibetitsmike) behalf.
On small viewports, the agent chat page showed the wrong panel. The right panel filled the screen and hid the chat.
before:
before.mov
after:
after.mov
Changes
lgbreakpoint, the page shows one panel at a time. A right panel left open on a wide window used to hide the chat when the window narrowed. The page now shows the chat.Tests
useRightPanelNarrowSuppressionhook cover mount, both breakpoint crossings, and the explicit override.Decision log
max-lg:hiddenon the chat made that stale state hide the chat on narrow windows.🤖 This PR was created by Coder Agents on behalf of @bpmct.