The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(desktop): stop dialogs clipping popovers opened inside them
ethernetb846f0c0024f
diff --git a/apps/desktop/src/app/chat/composer/context-menu.tsx b/apps/desktop/src/app/chat/composer/context-menu.tsxindex e0c12803733..b63149e8b1c 100644--- a/apps/desktop/src/app/chat/composer/context-menu.tsx+++ b/apps/desktop/src/app/chat/composer/context-menu.tsx@@ -127,7 +127,7 @@ function PromptSnippetsDialog({ onInsertText, onOpenChange, open }: PromptSnippereturn (<Dialog onOpenChange={onOpenChange} open={open}>- <DialogContent className="max-w-md gap-3">+ <DialogContent className="max-w-md"><DialogHeader><DialogTitle>{c.snippetsTitle}</DialogTitle><DialogDescription>{c.snippetsDesc}</DialogDescription>diff --git a/apps/desktop/src/app/chat/composer/url-dialog.tsx b/apps/desktop/src/app/chat/composer/url-dialog.tsxindex 6b3dc21adb1..922ba96ea6c 100644--- a/apps/desktop/src/app/chat/composer/url-dialog.tsx+++ b/apps/desktop/src/app/chat/composer/url-dialog.tsx@@ -37,7 +37,7 @@ export function UrlDialog({return (<Dialog onOpenChange={onOpenChange} open={open}>- <DialogContent className="max-w-md gap-5">+ <DialogContent bodyClassName="gap-5" className="max-w-md"><DialogHeader><DialogTitle icon={Globe}>{c.attachUrlTitle}</DialogTitle><DialogDescription>{c.attachUrlDesc}</DialogDescription>diff --git a/apps/desktop/src/app/pet-generate/pet-generate-overlay.tsx b/apps/desktop/src/app/pet-generate/pet-generate-overlay.tsxindex 60b1ec3d00b..b2e602c5047 100644--- a/apps/desktop/src/app/pet-generate/pet-generate-overlay.tsx+++ b/apps/desktop/src/app/pet-generate/pet-generate-overlay.tsx@@ -81,9 +81,10 @@ export function PetGenerateOverlay() {aria-describedby={undefined}banner={banner}bannerTone={errored ? 'error' : 'info'}+ bodyClassName="gap-4 text-center"// Cap the width so a long banner (e.g. a provider refusal) wraps instead// of stretching the dialog out; the min-w floors each phase.- className={cn('gap-4 text-center', single ? 'min-w-[17rem] max-w-[20rem]' : 'min-w-[19rem] max-w-[22rem]')}+ className={cn(single ? 'min-w-[17rem] max-w-[20rem]' : 'min-w-[19rem] max-w-[22rem]')}fitContent>{open && <PetGenerateContent />}diff --git a/apps/desktop/src/app/right-sidebar/files/remote-picker.tsx b/apps/desktop/src/app/right-sidebar/files/remote-picker.tsxindex 3374348e20f..a42bb9a2102 100644--- a/apps/desktop/src/app/right-sidebar/files/remote-picker.tsx+++ b/apps/desktop/src/app/right-sidebar/files/remote-picker.tsx@@ -121,7 +121,7 @@ export function RemoteFolderPicker() {return (<Dialog onOpenChange={open => !open && close()} open={Boolean(pending)}>- <DialogContent className="flex h-[min(36rem,calc(100vh-4rem))] max-w-lg flex-col gap-0 overflow-hidden p-0">+ <DialogContent bodyClassName="flex min-h-0 flex-col gap-0 overflow-hidden p-0" className="h-[min(36rem,calc(100vh-4rem))] max-w-lg"><div className="shrink-0 border-b border-border/70 px-4 py-3"><DialogTitle className="text-sm">{pending?.title || r.remotePickerTitle}</DialogTitle><DialogDescription className="mt-1 text-xs">{r.remotePickerDescription}</DialogDescription>diff --git a/apps/desktop/src/app/settings/memory/provider-config-modal.tsx b/apps/desktop/src/app/settings/memory/provider-config-modal.tsxindex 0799ea8938a..228e78f737c 100644--- a/apps/desktop/src/app/settings/memory/provider-config-modal.tsx+++ b/apps/desktop/src/app/settings/memory/provider-config-modal.tsx@@ -91,7 +91,7 @@ export function ProviderConfigModal({return (<Dialog onOpenChange={onOpenChange} open={open}>- <DialogContent className="max-w-2xl dt-portal-scrollbar">+ <DialogContent bodyClassName="dt-portal-scrollbar" className="max-w-2xl"><DialogHeader><DialogTitle icon={SlidersHorizontal}>{config.label} — full configuration</DialogTitle><DialogDescription>diff --git a/apps/desktop/src/app/skills/hub.tsx b/apps/desktop/src/app/skills/hub.tsxindex 1af1b672d26..1762b6c7b5a 100644--- a/apps/desktop/src/app/skills/hub.tsx+++ b/apps/desktop/src/app/skills/hub.tsx@@ -391,7 +391,7 @@ export function SkillsHub({ query }: SkillsHubProps) {)}<Dialog onOpenChange={open => !open && setDetail(null)} open={detail !== null}>- <DialogContent className="max-h-[80vh] max-w-2xl overflow-hidden">+ <DialogContent bodyClassName="overflow-hidden" className="max-h-[80vh] max-w-2xl">{detail && (<><DialogHeader>diff --git a/apps/desktop/src/app/updates-overlay.tsx b/apps/desktop/src/app/updates-overlay.tsxindex 2ad94f8ab38..ec5009f5a7c 100644--- a/apps/desktop/src/app/updates-overlay.tsx+++ b/apps/desktop/src/app/updates-overlay.tsx@@ -104,7 +104,7 @@ export function UpdatesOverlay() {{/* This dialog has no inputs, so Radix's default autofocus would land onthe close button and trigger its tooltip immediately on open. */}<DialogContent- className="max-w-sm overflow-hidden p-0 gap-0"+ bodyClassName="overflow-hidden p-0 gap-0" className="max-w-sm"onOpenAutoFocus={preventCloseButtonAutoFocus}showCloseButton={phase !== 'applying'}>diff --git a/apps/desktop/src/components/chat/zoomable-image.tsx b/apps/desktop/src/components/chat/zoomable-image.tsxindex 1ec201fd6d3..fa4d04a7c20 100644--- a/apps/desktop/src/components/chat/zoomable-image.tsx+++ b/apps/desktop/src/components/chat/zoomable-image.tsx@@ -79,7 +79,7 @@ export function ImageLightbox({return (<Dialog onOpenChange={onOpenChange} open={open}><DialogContent- className="block w-auto max-h-[calc(100vh-12rem)] max-w-[calc(100vw-12rem)] overflow-visible border-0 bg-transparent p-0 shadow-none"+ bodyClassName="block overflow-visible p-0" className="w-auto max-h-[calc(100vh-12rem)] max-w-[calc(100vw-12rem)] border-0 bg-transparent shadow-none"showCloseButton={false}><div className="group/lightbox relative inline-block">diff --git a/apps/desktop/src/components/model-picker.tsx b/apps/desktop/src/components/model-picker.tsxindex c013bf9b4c3..b835b6d88cd 100644--- a/apps/desktop/src/components/model-picker.tsx+++ b/apps/desktop/src/components/model-picker.tsx@@ -94,7 +94,10 @@ export function ModelPickerDialog({return (<Dialog onOpenChange={onOpenChange} open={open}>- <DialogContent className={cn('max-h-[85vh] max-w-2xl gap-0 overflow-hidden p-0', contentClassName)}>+ <DialogContent+ bodyClassName="gap-0 overflow-hidden p-0"+ className={cn('max-h-[85vh] max-w-2xl', contentClassName)}+ ><DialogHeader className="border-b border-border px-4 py-3"><DialogTitle>{copy.title}</DialogTitle><DialogDescription className="font-mono text-xs leading-relaxed">diff --git a/apps/desktop/src/components/model-visibility-dialog.tsx b/apps/desktop/src/components/model-visibility-dialog.tsxindex 64ee23ad203..418ee9f3d7c 100644--- a/apps/desktop/src/components/model-visibility-dialog.tsx+++ b/apps/desktop/src/components/model-visibility-dialog.tsx@@ -78,7 +78,7 @@ export function ModelVisibilityDialog({return (<Dialog onOpenChange={onOpenChange} open={open}>- <DialogContent className="max-w-xs gap-0 overflow-hidden p-0">+ <DialogContent bodyClassName="gap-0 overflow-hidden p-0" className="max-w-xs"><DialogHeader className="px-3 pb-1 pt-3"><DialogTitle className="text-[0.8125rem]">{copy.title}</DialogTitle></DialogHeader>diff --git a/apps/desktop/src/components/ui/dialog.tsx b/apps/desktop/src/components/ui/dialog.tsxindex 61b6ee63498..0a9414dd6b5 100644--- a/apps/desktop/src/components/ui/dialog.tsx+++ b/apps/desktop/src/components/ui/dialog.tsx@@ -62,6 +62,7 @@ export function preventCloseButtonAutoFocus(event: Event) {function DialogContent({className,+ bodyClassName,children,showCloseButton = true,fitContent = false,@@ -75,6 +76,10 @@ function DialogContent({// default fixed `max-w-lg`. For content that has no intrinsic width (grids,// full-width inputs) pair it with a `min-w-*` in `className`.fitContent?: boolean+ // Layout and scroll classes for the inner body box: padding, gap, display,+ // overflow. `className` styles the OUTER shell: position, size, border, and+ // background. The note on the shell below explains this split.+ bodyClassName?: string// A dialog-level notice rendered as a banner flush to the bottom edge (tinted,// inherited bottom radius) so it reads as part of the dialog, not a floating// alert. Falsy → no banner. Tone picks the colour.@@ -123,7 +128,10 @@ function DialogContent({<DialogOverlay /><DialogPrimitive.ContentclassName={cn(- 'fixed left-1/2 top-1/2 z-(--z-modal) pointer-events-auto flex max-h-[85vh] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl bg-(--ui-chat-bubble-background) text-[length:var(--conversation-text-font-size)] text-foreground shadow-nous duration-200 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95',+ // The same split as the plain variant. The shell must not clip,+ // because it crops the popovers that portal into it. The banner+ // below has its own `overflow-hidden`, which rounds its corners.+ 'fixed left-1/2 top-1/2 z-(--z-modal) pointer-events-auto flex max-h-[85vh] -translate-x-1/2 -translate-y-1/2 flex-col rounded-xl bg-(--ui-chat-bubble-background) text-[length:var(--conversation-text-font-size)] text-foreground shadow-nous duration-200 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95',widthClass,className,// Callers often pass `gap-*` for the no-banner grid layout — suppress@@ -138,13 +146,15 @@ function DialogContent({<DialogPortalContainerContext.Provider value={contentNode}>{/* Scroll lives on an inner box so this shell keeps a painted bottom radius. */}<div className="relative z-10 overflow-hidden rounded-xl border border-b-0 border-(--stroke-nous) bg-(--ui-chat-bubble-background)">- <div className="grid max-h-[calc(85vh-5rem)] min-h-0 gap-3 overflow-y-auto p-4">{children}</div>+ <div className={cn('grid max-h-[calc(85vh-5rem)] min-h-0 gap-3 overflow-y-auto p-4', bodyClassName)}>+ {children}+ </div></div><divclassName={cn(// Overlap by one corner radius so the white bottom lobes read clearly// over the tint instead of meeting it on a straight seam.- 'relative z-0 -mt-[var(--radius-xl)] px-4 pb-2.5 pt-[calc(var(--radius-xl)+0.625rem)] text-center text-[length:var(--conversation-tool-font-size)] leading-relaxed shadow-[inset_0_7px_7px_-4px_rgb(0_0_0/0.28)]',+ 'relative z-0 -mt-[var(--radius-xl)] overflow-hidden rounded-b-xl px-4 pb-2.5 pt-[calc(var(--radius-xl)+0.625rem)] text-center text-[length:var(--conversation-tool-font-size)] leading-relaxed shadow-[inset_0_7px_7px_-4px_rgb(0_0_0/0.28)]',DIALOG_BANNER_TONES[bannerTone])}data-slot="dialog-banner"@@ -164,10 +174,13 @@ function DialogContent({<DialogOverlay /><DialogPrimitive.ContentclassName={cn(- // Cap height at 85vh and let long content scroll inside the dialog- // instead of overflowing off-screen (long cron titles, tool detail- // dumps, etc.). Individual dialogs can still override via className.- 'fixed left-1/2 top-1/2 z-(--z-modal) pointer-events-auto grid max-h-[85vh] -translate-x-1/2 -translate-y-1/2 gap-3 overflow-y-auto rounded-xl border border-(--stroke-nous) bg-(--ui-chat-bubble-background) p-4 text-[length:var(--conversation-text-font-size)] text-foreground shadow-nous duration-200 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95',+ // The SHELL: position, size, and skin. It has no overflow of its own,+ // and that is deliberate. It is the portal container for the popovers+ // that open inside the dialog (see DialogPortalContainerContext), and+ // a clipping ancestor crops them. The body box below owns the scroll,+ // so a tall dialog scrolls and a Select or Popover can still paint+ // past the edge of that box.+ 'fixed left-1/2 top-1/2 z-(--z-modal) pointer-events-auto flex max-h-[85vh] -translate-x-1/2 -translate-y-1/2 flex-col rounded-xl border border-(--stroke-nous) bg-(--ui-chat-bubble-background) text-[length:var(--conversation-text-font-size)] text-foreground shadow-nous duration-200 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95',widthClass,className)}@@ -177,7 +190,12 @@ function DialogContent({{...props}><DialogPortalContainerContext.Provider value={contentNode}>- {children}+ {/* The BODY: layout and scroll. `min-h-0` lets this box shrink inside+ the max-height of the shell. The overflow then scrolls here+ instead of pushing the shell past the viewport. */}+ <div className={cn('grid min-h-0 gap-3 overflow-y-auto rounded-[inherit] p-4', bodyClassName)}>+ {children}+ </div>{closeButton}</DialogPortalContainerContext.Provider></DialogPrimitive.Content>diff --git a/apps/desktop/src/components/ui/zoomable.tsx b/apps/desktop/src/components/ui/zoomable.tsxindex 67a3ea847c6..4800cc3e0f4 100644--- a/apps/desktop/src/components/ui/zoomable.tsx+++ b/apps/desktop/src/components/ui/zoomable.tsx@@ -80,7 +80,7 @@ function ZoomPanViewer({return (<Dialog onOpenChange={onOpenChange} open={open}><DialogContent- className="flex h-[85vh] w-[90vw] max-w-[90vw] flex-col gap-0 overflow-hidden p-0"+ bodyClassName="flex min-h-0 flex-col gap-0 overflow-hidden p-0" className="h-[85vh] w-[90vw] max-w-[90vw]"showCloseButton={false}><div