fix(webui): maximize the DialogContent itself; fixed children are trapped by its translate

This commit is contained in:
m4
2026-08-08 22:53:45 +08:00
parent cd87138a82
commit 0e34383aed
+8 -8
View File
@@ -506,7 +506,13 @@ export const WorkspaceFileDialog = React.memo<{
>
<DialogContent
aria-describedby={undefined}
className="flex h-[80vh] max-h-[80vh] min-w-[60vw] flex-col p-6"
className={
isMaximized
? // Override the centered-dialog positioning (fixed 50%/50% +
// translate) so the whole dialog fills the browser window.
"fixed left-0 top-0 flex h-screen max-h-none w-screen max-w-none translate-x-0 translate-y-0 flex-col rounded-none p-6 sm:max-w-none"
: "flex h-[80vh] max-h-[80vh] min-w-[60vw] flex-col p-6"
}
onEscapeKeyDown={(e) => {
// While maximized, Esc only collapses the panel (handled by the
// keydown listener) — it must not close the whole dialog.
@@ -514,13 +520,7 @@ export const WorkspaceFileDialog = React.memo<{
}}
>
<DialogTitle className="sr-only">{path}</DialogTitle>
<div
className={
isMaximized
? "fixed inset-0 z-50 flex flex-col bg-background p-4"
: "flex min-h-0 flex-1 flex-col"
}
>
<div className="flex min-h-0 flex-1 flex-col">
<div className="mb-4 flex items-center justify-between gap-3 border-b border-border pb-4">
<div className="flex min-w-0 items-center gap-2">
<FileText