mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-20 18:57:17 +03:00
fix(ui): cap large dialogs at 720px and extra-large dialogs at 880px (#64206)
This commit is contained in:
committed by
GitHub
Unverified
parent
4c3e17b9d8
commit
8bb7fab26e
@@ -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")
|
||||
|
||||
@@ -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\`.
|
||||
|
||||
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user