From b846f0c0024f1933887efaee3e5d6ee49c8d65ba Mon Sep 17 00:00:00 2001 From: ethernet Date: Fri, 31 Jul 2026 15:15:36 -0400 Subject: [PATCH] fix(desktop): stop dialogs clipping popovers opened inside them MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DialogContent published itself as the portal container for popovers opened inside a dialog (so focus stays in the dialog and dismissal doesn't close it), but that same element carried `overflow-y-auto`. Every Select/Popover/ DropdownMenu in a dialog was therefore born inside a scroll box and got cropped at the dialog's edge — most visibly the worktree dialog's base-branch combobox, where the branch list was cut off entirely and only the search field showed. Split the box in two: the shell keeps position/size/skin and no longer clips (it stays the portal container), while a new inner body div owns layout and scrolling. Popovers remain DOM descendants of the dialog, so focus and dismissal behave exactly as before, but they can now paint past the dialog's bounds. The banner variant had the same `overflow-hidden` on its shell; its clip moves to the banner itself, which keeps the rounded bottom edge. Callers that passed layout/scroll classes (grid, gap-*, p-*, overflow-*) now pass them via the new `bodyClassName`; `className` keeps sizing and skin. --- .../src/app/chat/composer/context-menu.tsx | 2 +- .../src/app/chat/composer/url-dialog.tsx | 2 +- .../app/pet-generate/pet-generate-overlay.tsx | 3 +- .../app/right-sidebar/files/remote-picker.tsx | 2 +- .../settings/memory/provider-config-modal.tsx | 2 +- apps/desktop/src/app/skills/hub.tsx | 2 +- apps/desktop/src/app/updates-overlay.tsx | 2 +- .../src/components/chat/zoomable-image.tsx | 2 +- apps/desktop/src/components/model-picker.tsx | 5 ++- .../components/model-visibility-dialog.tsx | 2 +- apps/desktop/src/components/ui/dialog.tsx | 34 ++++++++++++++----- apps/desktop/src/components/ui/zoomable.tsx | 2 +- 12 files changed, 41 insertions(+), 19 deletions(-) diff --git a/apps/desktop/src/app/chat/composer/context-menu.tsx b/apps/desktop/src/app/chat/composer/context-menu.tsx index e0c1280373..b63149e8b1 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 }: PromptSnippe return ( - + {c.snippetsTitle} {c.snippetsDesc} diff --git a/apps/desktop/src/app/chat/composer/url-dialog.tsx b/apps/desktop/src/app/chat/composer/url-dialog.tsx index 6b3dc21adb..922ba96ea6 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 ( - + {c.attachUrlTitle} {c.attachUrlDesc} diff --git a/apps/desktop/src/app/pet-generate/pet-generate-overlay.tsx b/apps/desktop/src/app/pet-generate/pet-generate-overlay.tsx index 60b1ec3d00..b2e602c504 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 && } diff --git a/apps/desktop/src/app/right-sidebar/files/remote-picker.tsx b/apps/desktop/src/app/right-sidebar/files/remote-picker.tsx index 3374348e20..a42bb9a210 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 ( !open && close()} open={Boolean(pending)}> - +
{pending?.title || r.remotePickerTitle} {r.remotePickerDescription} diff --git a/apps/desktop/src/app/settings/memory/provider-config-modal.tsx b/apps/desktop/src/app/settings/memory/provider-config-modal.tsx index 0799ea8938..228e78f737 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 ( - + {config.label} — full configuration diff --git a/apps/desktop/src/app/skills/hub.tsx b/apps/desktop/src/app/skills/hub.tsx index 1af1b672d2..1762b6c7b5 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) { )} !open && setDetail(null)} open={detail !== null}> - + {detail && ( <> diff --git a/apps/desktop/src/app/updates-overlay.tsx b/apps/desktop/src/app/updates-overlay.tsx index 2ad94f8ab3..ec5009f5a7 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 on the close button and trigger its tooltip immediately on open. */} diff --git a/apps/desktop/src/components/chat/zoomable-image.tsx b/apps/desktop/src/components/chat/zoomable-image.tsx index 1ec201fd6d..fa4d04a7c2 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 (
diff --git a/apps/desktop/src/components/model-picker.tsx b/apps/desktop/src/components/model-picker.tsx index c013bf9b4c..b835b6d88c 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 ( - + {copy.title} diff --git a/apps/desktop/src/components/model-visibility-dialog.tsx b/apps/desktop/src/components/model-visibility-dialog.tsx index 64ee23ad20..418ee9f3d7 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 ( - + {copy.title} diff --git a/apps/desktop/src/components/ui/dialog.tsx b/apps/desktop/src/components/ui/dialog.tsx index 61b6ee6349..0a9414dd6b 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({ {/* Scroll lives on an inner box so this shell keeps a painted bottom radius. */}
-
{children}
+
+ {children} +
- {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. */} +
+ {children} +
{closeButton}
diff --git a/apps/desktop/src/components/ui/zoomable.tsx b/apps/desktop/src/components/ui/zoomable.tsx index 67a3ea847c..4800cc3e0f 100644 --- a/apps/desktop/src/components/ui/zoomable.tsx +++ b/apps/desktop/src/components/ui/zoomable.tsx @@ -80,7 +80,7 @@ function ZoomPanViewer({ return (