From df7460af41b15ed5a93d789ea65677756b9eab3d Mon Sep 17 00:00:00 2001 From: ppw-stack <58170323+ppw-stack@users.noreply.github.com> Date: Fri, 21 Aug 2026 10:34:31 +0800 Subject: [PATCH] fix(ui): keep dialog title and footer inside the panel (#15707) DialogContent used an implicit grid column, which sizes to min-content: an unbreakable token such as a long filename in the title widened the column past the panel, so the title overflowed and the justify-end footer buttons rendered outside the visible surface. Pin the column to minmax(0,1fr) and let long titles wrap. --- src/renderer/src/components/ui/dialog.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/renderer/src/components/ui/dialog.tsx b/src/renderer/src/components/ui/dialog.tsx index 8b1badf9ab3..f4e85276b51 100644 --- a/src/renderer/src/components/ui/dialog.tsx +++ b/src/renderer/src/components/ui/dialog.tsx @@ -63,8 +63,11 @@ function DialogContent({ // A translucent surface, solid 14% border, dual shadow, and 2xl backdrop // blur match the dropdown-menu recipe (which already works) and read // clearly in both light and dark mode. + // grid-cols-[minmax(0,1fr)]: default grid column sizes to min-content, so an + // unbreakable token (long filename in the title) widens the column past the + // panel and pushes justify-end footers outside the visible surface. className={cn( - 'fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border border-black/14 bg-background/96 p-6 text-foreground shadow-[0_20px_60px_rgba(0,0,0,0.28),inset_0_1px_0_rgba(255,255,255,0.08)] backdrop-blur-2xl duration-200 outline-none dark:border-white/14 dark:bg-[rgba(23,23,23,0.96)] dark:shadow-[0_24px_72px_rgba(0,0,0,0.55),inset_0_1px_0_rgba(255,255,255,0.06)] 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 sm:max-w-lg', + 'fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] grid-cols-[minmax(0,1fr)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border border-black/14 bg-background/96 p-6 text-foreground shadow-[0_20px_60px_rgba(0,0,0,0.28),inset_0_1px_0_rgba(255,255,255,0.08)] backdrop-blur-2xl duration-200 outline-none dark:border-white/14 dark:bg-[rgba(23,23,23,0.96)] dark:shadow-[0_24px_72px_rgba(0,0,0,0.55),inset_0_1px_0_rgba(255,255,255,0.06)] 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 sm:max-w-lg', className )} {...props} @@ -126,7 +129,7 @@ function DialogTitle({ className, ...props }: React.ComponentProps )