Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

fix(frontend): let sidebar inset shrink so copilot panels stay in the viewport (#13797)

Ubbe852991faaf42
diff --git a/autogpt_platform/frontend/src/components/ui/sidebar.tsx b/autogpt_platform/frontend/src/components/ui/sidebar.tsx
index 2ed417b932..3f0494e623 100644
--- a/autogpt_platform/frontend/src/components/ui/sidebar.tsx
+++ b/autogpt_platform/frontend/src/components/ui/sidebar.tsx
@@ -339,7 +339,11 @@ const SidebarInset = React.forwardRef<
<main
ref={ref}
className={cn(
- "relative flex w-full flex-1 flex-col bg-white dark:bg-neutral-950",
+ // min-w-0 lets the inset shrink to the space next to the sidebar;
+ // without it, min-width:auto sizes it to its content and fixed-width
+ // panels (e.g. the copilot artifact panel) push the page past the
+ // viewport instead of shrinking.
+ "relative flex w-full min-w-0 flex-1 flex-col bg-white dark:bg-neutral-950",
"md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",
className,
)}