fix(ui): cap large dialogs at 720px and extra-large dialogs at 880px (#64206)

This commit is contained in:
usrnk1
2026-11-16 12:20:44 +01:00
committed by GitHub
Unverified
parent 4c3e17b9d8
commit 8bb7fab26e
4 changed files with 7 additions and 7 deletions
@@ -1154,7 +1154,7 @@ test("the location dialog separates added projects from server projects and tags
await expect(options.nth(0)).toHaveCSS("height", "28px")
await expect(dialog.locator(".palette-menu-search [data-component='text-input-v2']")).toHaveCSS("height", "28px")
await expect(dialog.locator(".new-session-location-hints")).toHaveCount(0)
await expect(dialog.locator("..")).toHaveCSS("width", "880px")
await expect(dialog.locator("..")).toHaveCSS("width", "720px")
await expect(options.nth(0)).toHaveCSS("display", "flex")
await expect(names.nth(0).locator(".command-palette-title")).toHaveCSS("font-size", "13px")
await expect(names.nth(0).locator(".command-palette-title")).toHaveCSS("white-space", "nowrap")
+2 -2
View File
@@ -171,14 +171,14 @@
&:is([data-size="large"], [data-size="x-large"]) [data-slot="dialog-container"] {
--dialog-height: min(calc(100vh - 96px), 600px);
width: min(calc(100vw - 32px), 880px);
width: min(calc(100vw - 32px), 720px);
background: var(--v2-background-bg-base);
border-radius: 12px;
}
&[data-size="x-large"] [data-slot="dialog-container"] {
--dialog-height: min(calc(100vh - 96px), 680px);
width: min(calc(100vw - 32px), 1040px);
width: min(calc(100vw - 32px), 880px);
}
&[data-fit] [data-slot="dialog-container"] {
@@ -16,8 +16,8 @@ Compose with \`DialogHeader\`, \`DialogTitle\`, \`DialogTitleGroup\`, \`DialogBo
### API
- \`Dialog\`: \`size\`, \`variant\`, \`fit\`.
- \`normal\`: 480px wide, for confirmations, sign-ins and small forms.
- \`large\`: 880×600, for palettes, pickers and lists.
- \`x-large\`: 1040×680, for long documents and settings-like panels.
- \`large\`: 720×600, for palettes, pickers and lists.
- \`x-large\`: 880×680, for long documents and settings-like panels.
- Sizes clamp to the window. \`fit\` makes the height follow the content up to the size's height; large sizes keep their top edge, so only the bottom edge moves.
- Dialogs don't set their own container width or height: pick the size that fits.
- \`DialogHeader\`: row container with optional \`closeLabel\` and \`hideClose\`.
+2 -2
View File
@@ -21,8 +21,8 @@ const TEXT_FIELD = [
export interface DialogProps extends ParentProps {
/**
* normal: 480px wide, for confirmations and small forms. large: 880×600, for palettes, pickers and lists.
* x-large: 1040×680, for long documents and settings-like panels. Each clamps to the window.
* normal: 480px wide, for confirmations and small forms. large: 720×600, for palettes, pickers and lists.
* x-large: 880×680, for long documents and settings-like panels. Each clamps to the window.
*/
size?: "normal" | "large" | "x-large"
/** Height follows the content, up to the size's height. Large sizes grow down from a fixed top edge. */