Skip to content

fix(site): add chat input skeleton to prevent layout shift on agent detail - #23439

Merged
DanielleMaywood merged 1 commit into
mainfrom
dm/fix-agent-detail-skeleton-layout-shift
Mar 23, 2026
Merged

DanielleMaywood merged 1 commit into
mainfrom
dm/fix-agent-detail-skeleton-layout-shift

Conversation

@DanielleMaywood

Copy link
Copy Markdown
Collaborator

🤖 This PR was written by Coder Agent on behalf of Danielle Maywood 🤖

Problem

When loading a chat with an agent, the AgentDetailSkeleton (the <Suspense> fallback while the lazy-loaded AgentDetail JS chunk downloads) rendered a top bar skeleton and conversation skeleton but no chat input area at the bottom.

Once the chunk loaded, AgentDetailLoadingView rendered the same skeleton plus the real AgentChatInput, causing visible layout shift as the input box appeared and pushed the conversation content upward.

Fix

Added a ChatInputSkeleton component that mirrors the dimensions and structure of the real AgentChatInput:

  • Same shrink-0 wrapper with matching padding and scrollbar-gutter
  • Same max-w-3xl centered container
  • Same rounded-2xl border/background styling
  • Same min-h-[60px] sm:min-h-24 textarea area height
  • Skeleton placeholders for the model selector and send button

This ensures the layout is stable from the very first paint through chunk load and data fetch.

…etail

The AgentDetailSkeleton (Suspense fallback) rendered a top bar and
conversation skeleton but no chat input area. When the lazy-loaded
AgentDetail chunk arrived, AgentDetailLoadingView rendered the real
AgentChatInput at the bottom, causing a visible layout shift.

Add a ChatInputSkeleton that mirrors the dimensions of the real input
(rounded-2xl container, min-h-[60px]/sm:min-h-24 textarea area, and
bottom toolbar placeholders) so the layout is stable from first paint.
@github-actions github-actions Bot added the community Pull Requests and issues created by the community. label Mar 23, 2026
@DanielleMaywood
DanielleMaywood marked this pull request as ready for review March 23, 2026 12:19

@mafredri mafredri left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Generated by Coder Agent

Skeleton dimensions verified line-by-line against AgentChatInput.tsx and AgentDetailView.tsx. Classes match, placement inside the flex column is correct. No findings from the full review panel.

🤖 LGTM

@DanielleMaywood
DanielleMaywood merged commit 522288c into main Mar 23, 2026
34 checks passed
@DanielleMaywood
DanielleMaywood deleted the dm/fix-agent-detail-skeleton-layout-shift branch March 23, 2026 14:41
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

community Pull Requests and issues created by the community.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants