Repository navigation
fix(site): prevent layout shift when agent chat right panel loads - #22983
Merged
Merged
Conversation
The agent chat loading skeleton rendered as a single full-width column without reserving space for the right panel. When chat data loaded and the right panel appeared (based on localStorage state), the layout shifted horizontally. Fix this at all three skeleton layers: 1. AgentDetailSkeleton (Suspense fallback): reads panel open/width state from localStorage directly and renders a placeholder div matching RightPanel's sizing CSS. 2. AgentDetailLoadingView (chat query loading): receives showRightPanel prop from parent and renders an actual RightPanel with skeleton content inside. 3. AgentDetailView (loaded): receives showSidebarPanel and onSetShowSidebarPanel props from parent instead of managing the state internally. The right panel open/closed state is lifted to AgentDetail so the loading and loaded views share the same layout, and RIGHT_PANEL_OPEN_KEY is co-located with its only consumer.
…eton The chat conversation skeleton and right panel skeleton markup was duplicated identically between AgentDetailSkeleton (Suspense fallback) and AgentDetailLoadingView (query loading state). Extract both into shared exported components in AgentsSkeletons.tsx and import them from AgentDetailView.tsx, eliminating the duplication.
The original AgentDetailLoadingView had h-full on its single wrapper div. When we split it into outer (flex-row for right panel) and inner (flex-col) divs, h-full was dropped. Without it the flex-col-reverse chat area has no full-height context, causing the skeleton to float up instead of anchoring at the bottom.
The outer wrapper also needs h-full so it fills the parent height. Without it, flex-1 alone has no effect when the parent isn't a flex container (e.g. in Storybook), causing the flex-col-reverse chat area to collapse and the skeleton to shift upward.
Same issue as AgentDetailLoadingView — splitting the original single div into outer + inner wrappers dropped h-full from both, causing the flex-col-reverse chat area to lose its full-height context and shift the skeleton upward.
DanielleMaywood
marked this pull request as ready for review
March 12, 2026 13:06
kylecarbs
approved these changes
Mar 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The agent chat loading skeleton rendered as a single full-width column without reserving space for the right panel. When chat data loaded and the right panel appeared (based on localStorage state), the layout shifted horizontally.
Fix
Ensure all three skeleton/loading layers reserve the same horizontal space for the right panel:
AgentDetailSkeleton(Suspense fallback for lazy chunk): Readsagents.right-panel-openandagents.right-panel-widthfrom localStorage directly and renders a placeholder div matchingRightPanel's sizing CSS.AgentDetailLoadingView(chat query loading): ReceivesshowRightPanelprop from parent and renders an actual<RightPanel>with skeleton content inside.AgentDetailView(loaded): ReceivesshowSidebarPanel/onSetShowSidebarPanelprops from parent instead of managing the state internally.Refactors
AgentDetailso loading and loaded views share the same layout without duplicating localStorage reads.RIGHT_PANEL_OPEN_KEYfromAgentDetailView.tsxtoAgentDetail.tsx, co-locating it with its only consumer.