mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-29 03:24:54 +00:00
fix(app): match integrations dialog to palette width (#64882)
This commit is contained in:
parent
354afc493e
commit
40f7e4da2b
7 changed files with 17 additions and 21 deletions
|
|
@ -1308,7 +1308,7 @@ test("the location dialog separates added projects from server projects and tags
|
|||
await expect(options.nth(0)).toHaveCSS("height", "32px")
|
||||
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", "720px")
|
||||
await expect(dialog.locator("..")).toHaveCSS("width", "680px")
|
||||
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")
|
||||
|
|
|
|||
|
|
@ -107,10 +107,8 @@ export const DialogConnectProvider: Component<{
|
|||
|
||||
return (
|
||||
<Dialog
|
||||
size="normal"
|
||||
size="large"
|
||||
fit
|
||||
anchored
|
||||
containerClass="!bg-v2-background-bg-base"
|
||||
preventBackdropDismiss={view().preventBackdropDismiss}
|
||||
onCloseAutoFocus={(event) => {
|
||||
if (view().completed && props.selection && props.onDone) {
|
||||
|
|
@ -127,13 +125,11 @@ export const DialogConnectProvider: Component<{
|
|||
}}
|
||||
class="[font-family:var(--v2-font-family-sans)]"
|
||||
classList={{
|
||||
"[&_[data-slot=dialog-header]]:!px-4 [&_[data-slot=dialog-header]]:!pt-4 [&_[data-slot=dialog-close-button]]:!mt-0 [&_[data-slot=dialog-close-button]]:!-me-0.5": true,
|
||||
"[&_[data-slot=dialog-header]]:!px-4 [&_[data-slot=dialog-header]]:!pt-3.5 [&_[data-slot=dialog-close-button]]:!mt-0 [&_[data-slot=dialog-close-button]]:!-me-0.5": true,
|
||||
"[&_[data-slot=dialog-header]]:!pb-2": frame() !== "models",
|
||||
"[&_[data-slot=dialog-header-title]]:!text-[15px] [&_[data-slot=dialog-header-title]]:!tracking-[-0.13px]":
|
||||
frame() === "models",
|
||||
"search-dialog": frame() === "picker" || frame() === "accounts",
|
||||
"[&_[data-slot=dialog-description]]:!text-[13px] [&_[data-slot=dialog-description]]:!tracking-[-0.04px]":
|
||||
frame() === "picker",
|
||||
}}
|
||||
>
|
||||
<DialogHeader closeLabel={language.t("common.close")}>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,11 @@
|
|||
.manage-models-search {
|
||||
flex-shrink: 0;
|
||||
padding: 0 6px 8px;
|
||||
padding: 0 8px 8px;
|
||||
}
|
||||
|
||||
/* Reaches the dialog edges past the 8px inset, as in the integrations dialog. */
|
||||
.manage-models-search.search-dialog-search::after {
|
||||
margin-inline: -8px;
|
||||
}
|
||||
|
||||
.settings-manage-models-dialog .settings-panel.settings-models {
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ export const DialogManageModels: Component = () => {
|
|||
title={language.t("dialog.model.manage")}
|
||||
description={language.t("dialog.model.manage.description")}
|
||||
/>
|
||||
<Button variant="neutral" size="small" icon="plus" onClick={handleConnectProvider}>
|
||||
<Button variant="neutral" size="small" icon="plus" class="-me-0.5" onClick={handleConnectProvider}>
|
||||
{language.t("command.provider.connect")}
|
||||
</Button>
|
||||
</DialogHeader>
|
||||
|
|
@ -111,7 +111,7 @@ export const DialogManageModels: Component = () => {
|
|||
<TextInput
|
||||
type="search"
|
||||
appearance="base"
|
||||
class="!w-full self-stretch"
|
||||
class="!h-8 !w-full self-stretch"
|
||||
leadingIcon={<Icon name="magnifying-glass" />}
|
||||
value={list.filter()}
|
||||
onInput={(event) => list.onInput(event.currentTarget.value)}
|
||||
|
|
|
|||
|
|
@ -279,10 +279,8 @@
|
|||
|
||||
/* A list dialog with a compact header and a bare search, as in the integration and manage models dialogs. */
|
||||
[data-component="dialog-v2"] [data-slot="dialog-container"] [data-slot="dialog-content"].search-dialog {
|
||||
/* Trailing controls sit 10px from both the top and the end edge. */
|
||||
[data-slot="dialog-header"] {
|
||||
padding-block: 10px 6px;
|
||||
padding-inline: 14px 10px;
|
||||
padding: 14px 16px 8px;
|
||||
|
||||
[data-slot="dialog-close-button"] {
|
||||
margin-top: 0;
|
||||
|
|
@ -308,8 +306,9 @@
|
|||
}
|
||||
|
||||
[data-slot="dialog-description"] {
|
||||
font-size: 12px;
|
||||
font-size: 13px;
|
||||
line-height: var(--line-height-base);
|
||||
letter-spacing: -0.04px;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
&:is([data-anchored], [data-size="large"], [data-size="x-large"]) {
|
||||
&:is([data-size="large"], [data-size="x-large"]) {
|
||||
align-items: flex-start;
|
||||
|
||||
[data-slot="dialog-container"] {
|
||||
|
|
@ -171,7 +171,7 @@
|
|||
|
||||
&:is([data-size="large"], [data-size="x-large"]) [data-slot="dialog-container"] {
|
||||
--dialog-height: min(calc(100vh - 96px), 600px);
|
||||
width: min(calc(100vw - 32px), 720px);
|
||||
width: min(calc(100vw - 32px), 680px);
|
||||
background: var(--v2-background-bg-base);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,14 +21,12 @@ const TEXT_FIELD = [
|
|||
|
||||
export interface DialogProps extends ParentProps {
|
||||
/**
|
||||
* normal: 480px wide, for confirmations and small forms. large: 720×600, for palettes, pickers and lists.
|
||||
* normal: 480px wide, for confirmations and small forms. large: 680×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. */
|
||||
fit?: boolean
|
||||
/** Fit within the preset's height and keep its top edge as content changes. */
|
||||
anchored?: boolean
|
||||
variant?: "default" | "settings"
|
||||
class?: ComponentProps<"div">["class"]
|
||||
containerClass?: ComponentProps<"div">["class"]
|
||||
|
|
@ -115,7 +113,6 @@ export function Dialog(props: DialogProps) {
|
|||
"containerClass",
|
||||
"classList",
|
||||
"fit",
|
||||
"anchored",
|
||||
"children",
|
||||
"onCloseAutoFocus",
|
||||
"preventBackdropDismiss",
|
||||
|
|
@ -131,7 +128,6 @@ export function Dialog(props: DialogProps) {
|
|||
data-component="dialog-v2"
|
||||
data-variant={local.variant === "settings" ? "settings" : undefined}
|
||||
data-fit={local.fit ? true : undefined}
|
||||
data-anchored={local.anchored ? true : undefined}
|
||||
data-size={local.size || "normal"}
|
||||
>
|
||||
<div data-slot="dialog-container" class={local.containerClass}>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue