Skip to content

fix(site/src/pages/AgentsPage): size embedded agent chat to viewport - #29602

Merged
bpmct merged 2 commits into
mainfrom
fix/agent-embed-chat-height
Sep 19, 2026
Merged

bpmct merged 2 commits into
mainfrom
fix/agent-embed-chat-height

Conversation

@bpmct

@bpmct bpmct commented Sep 19, 2026 •

Copy link
Copy Markdown
Member

Embedded agent chats in fixed-height iframes, including the chat panel on prototypes.cdr.dev, grew to the transcript height and left the composer clipped below the viewport.

The embed route rendered directly under block-level #root, so the chat view's flex-1 and min-h-0 did not constrain it. Add the missing full-height flex column around the route outlet, size the chat view to its parent, and add a 412px-tall Storybook state for visual regression coverage. The embed also waits for permissions before mounting DashboardProvider, preventing dev-proxy loads from crashing while the permissions query is still pending.

Screenshots

Live dogfood transcript content is redacted.

Before and after embedded agent chat

Individual screenshots

Before

Embedded agent chat before the fix

After

Embedded agent chat after the fix

Compiled bundle measurements

Context Bundle Document height Document scroll Outer view Message scroller Composer bottom
Direct, 900x740 Before 1686px 806px 1686px None 864px, 124px clipped
Direct, 900x740 After 740px 0px 740px 534px / 1417px 724px, 16px clear
Iframe, 900x412 Before 1686px 1134px 1686px None 536px, 124px clipped
Iframe, 900x412 After 412px 0px 412px 206px / 1417px 396px, 16px clear
Verification
  • Ran the real Vite frontend from origin/main and this branch against an authenticated dogfood session on separate ports.
  • Loaded the embed route directly at 900x740 and through a fixed-height iframe harness served from a different port.
  • Sampled document scrolling, outer view height, transcript scrolling, and composer position at 0.2s, 1s, 3s, and 8s.
  • Confirmed the standalone block-parent reproduction scrolls the document in the broken state and moves overflow into the transcript after adding a full-height child.
  • Added and visually inspected the EmbeddedViewport Storybook state.
  • pnpm test:storybook src/pages/AgentsPage/AgentChatPageView.stories.tsx: 66 passed.
  • pnpm check, pnpm lint, and pnpm lint:types passed. Biome reports one existing informational finding in OAuth2AppForm.test.tsx.
  • Repository pre-commit hook passed.
  • Repository pre-push hook passed with VITEST_MAX_WORKERS=1: 3656 passed, 2 skipped, and the production site build passed.

🤖 Generated with Coder Agents.

@bpmct
bpmct marked this pull request as ready for review September 19, 2026 05:42
@bpmct

bpmct commented Sep 19, 2026 •

Copy link
Copy Markdown
Member Author

Confirmed this fix against the real production-mode prototypes.cdr.dev webapp using prototype-purple-dashboard at 1440x900. The actual Agent chat pane is 398x753.

The deployed dogfood embed reproduces the issue. The document grows to the transcript height, no message scroller is created, and the composer extends below the chat pane. The branch embed stays bounded to the pane, moves overflow into the message scroller, and remains fully visible after typing.

State Time Document height Document scrollTop Message scroller Composer bottom Clearance
Dogfood before 1s 2446px 1594px None 840px 87px clipped
Dogfood before 3s 2446px 1594px None 840px 87px clipped
Dogfood before 8s 2446px 1594px None 840px 87px clipped
Dogfood before After typing 2446px 1635px None 799px 46px clipped
Branch after 1s 753px 0px 587px / 2280px 741px 12px clear
Branch after 3s 753px 0px 587px / 2280px 741px 12px clear
Branch after 8s 753px 0px 587px / 2280px 741px 12px clear
Branch after After typing 753px 0px 587px / 2280px 741px 12px clear

Before: deployed dogfood embed

Real prototypes UI before

After: PR branch embed

Real prototypes UI after

The screenshots use the real production prototypes page and its exact iframe position and dimensions. The headless browser could not authenticate the cross-origin workspace preview iframe, so I loaded each exact chat embed directly at 398x753, measured it, redacted the live transcript, and placed it at the real iframe coordinates in the full-page capture.

Follow-up commit 6da2119d39 also waits for permissions before mounting DashboardProvider, preventing Vite proxy loads from crashing while the permissions query is pending. On the 8091 preview host, the embed rendered with a 600px document height and the composer bottom at 538px.

Generated with Coder Agents on behalf of @bpmct

@bpmct
bpmct requested a review from kylecarbs September 19, 2026 16:42
@bpmct
bpmct merged commit 38a17ec into main Sep 19, 2026
30 checks passed
@bpmct
bpmct deleted the fix/agent-embed-chat-height branch September 19, 2026 23:18
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants