Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions site/src/pages/AgentsPage/AgentChatPageView.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,22 @@ const buildStoreWithMessages = (
return store;
};

const embeddedViewportStore = buildStoreWithMessages(
buildLongConversation(AGENT_ID, 40),
);

/** Embedded chats stay within a block parent and scroll the transcript. */
export const EmbeddedViewport: Story = {
decorators: [
(Story) => (
<div style={{ height: 412, overflow: "hidden", width: 900 }}>
<Story />
</div>
),
],
render: () => <StoryAgentChatPageView store={embeddedViewportStore} />,
};

const otherUserActionMessages: TypesGen.ChatMessage[] = [
buildMessage(1, "user", "Please review this plan."),
buildMessageWithContent(2, "assistant", [
Expand Down
2 changes: 1 addition & 1 deletion site/src/pages/AgentsPage/AgentChatPageView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ export const AgentChatPageView: FC<AgentChatPageViewProps> = ({
<DesktopPanelContext value={desktopPanelCtx}>
<div
className={cn(
"relative flex min-h-0 min-w-0 flex-1 sm:[--agents-chat-panel-min-width:360px]",
"relative flex h-full min-h-0 min-w-0 flex-1 sm:[--agents-chat-panel-min-width:360px]",
shouldShowSidebar && !visualExpanded && "flex-row",
)}
>
Expand Down
10 changes: 8 additions & 2 deletions site/src/pages/AgentsPage/AgentEmbedPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,18 @@ const AgentEmbedPage: FC = () => {
embedSessionMutation.reset();
};

if (auth.isSignedIn) {
// DashboardProvider requires permissions. They arrive with the user
// when the server embeds metadata, but load separately behind a dev
// proxy or when metadata is missing, so wait for both.
if (auth.isSignedIn && auth.permissions) {
return (
<EmbedContext value={{ isEmbedded: true }}>
<DashboardProvider>
<ProxyProvider>
<Outlet context={outletContext} />
{/* Match AgentsPageLayout's flex column so the chat stays bounded under block-level #root. */}
<div className="flex h-full min-h-0 min-w-0 flex-col">
<Outlet context={outletContext} />
</div>
</ProxyProvider>
</DashboardProvider>
</EmbedContext>
Expand Down
Loading