diff --git a/src/editor/lsp/Popups.module.css b/src/editor/lsp/Popups.module.css index 2c068e9d0..5663ef328 100644 --- a/src/editor/lsp/Popups.module.css +++ b/src/editor/lsp/Popups.module.css @@ -319,7 +319,13 @@ white-space: pre; } +.previewDialog [data-dialog-body] { + display: flex; + flex-direction: column; + overflow: hidden; +} .previewSummary { + flex: none; padding: 10px 14px 6px; font-size: var(--fs-ui); color: var(--fg-muted); @@ -328,7 +334,8 @@ list-style: none; margin: 0; padding: 0 0 8px; - max-height: 320px; + flex: 1 1 auto; + min-height: 0; overflow: auto; } .previewRow { @@ -358,6 +365,7 @@ } .previewWarning { + flex: none; display: flex; align-items: flex-start; gap: 6px; diff --git a/src/editor/lsp/Popups.tsx b/src/editor/lsp/Popups.tsx index 451b95a5a..8f1228009 100644 --- a/src/editor/lsp/Popups.tsx +++ b/src/editor/lsp/Popups.tsx @@ -532,15 +532,42 @@ function DefinitionPopup({ popup }: { popup: Extract }) { const root = useProject((s) => s.project?.root ?? ""); const { summary } = popup; + const [initialSize] = useState(loadPreviewSize); return ( {basename(e.path)} - {relativePath(root, e.path)} + + {relativePath(root, e.path)} + {e.operation === "rename" && e.to && → {basename(e.to)}} {e.operation && e.operation !== "rename" && {e.operation}} diff --git a/src/editor/refactor/HierarchyDialog.module.css b/src/editor/refactor/HierarchyDialog.module.css index 67aabcd9b..1c922715f 100644 --- a/src/editor/refactor/HierarchyDialog.module.css +++ b/src/editor/refactor/HierarchyDialog.module.css @@ -1,4 +1,12 @@ +.dialog [data-dialog-body] { + display: flex; + flex-direction: column; + overflow: hidden; +} + .body { + flex: 1; + min-height: 0; display: flex; flex-direction: column; gap: 10px; @@ -8,6 +16,7 @@ } .field { + flex: none; display: flex; flex-direction: column; gap: 6px; @@ -23,6 +32,7 @@ flex-direction: column; border: 1px solid var(--border); border-radius: 4px; + flex: 1 1 auto; min-height: 0; } @@ -42,7 +52,8 @@ } .rows { - max-height: 280px; + flex: 1 1 auto; + min-height: 0; overflow: auto; } @@ -62,11 +73,13 @@ } .hint { + flex: none; color: var(--fg-subtle); font-size: var(--fs-small); } .error { + flex: none; color: var(--danger); font-size: var(--fs-small); overflow-wrap: anywhere; diff --git a/src/editor/refactor/HierarchyDialog.tsx b/src/editor/refactor/HierarchyDialog.tsx index 97a0601cc..51fa2eb17 100644 --- a/src/editor/refactor/HierarchyDialog.tsx +++ b/src/editor/refactor/HierarchyDialog.tsx @@ -58,7 +58,11 @@ function HierarchyDialogInner({ request }: { request: HierarchyRequest }) { open onClose={close} title={titleOf(kind)} + className={styles.dialog} width={560} + minHeight={300} + maxHeight={560} + resizable="both" buttons={[ { label: "Preview", role: "extra", disabled: !ready, onClick: () => void submit(true) }, { label: "Refactor", role: "default", disabled: !ready, onClick: () => void submit(false) },