Skip to content

Commit b22dc6b

Browse files
Copilotsawka
andcommitted
Adopt VSCode-style config preview layout
Co-authored-by: sawka <2722291+sawka@users.noreply.github.com> Agent-Logs-Url: https://github.com/wavetermdev/waveterm/sessions/685441fd-13c8-46a7-87f4-17d6c572e848
1 parent 2b4022e commit b22dc6b

2 files changed

Lines changed: 253 additions & 196 deletions

File tree

frontend/app/configui/configwidgets.tsx

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,22 @@ function formatDefaultSelectLabel(defaultText?: string): string {
101101
return `Default (${defaultText})`;
102102
}
103103

104-
export function ConfigSection({ title, description, children }: { title: string; description?: string; children: ReactNode }) {
104+
export function ConfigSection({
105+
title,
106+
description,
107+
children,
108+
}: {
109+
title: string;
110+
description?: string;
111+
children: ReactNode;
112+
}) {
105113
return (
106-
<section className="rounded-xl border border-border bg-panel/70 p-5 shadow-sm">
107-
<div className="mb-4 flex flex-col gap-1">
108-
<h2 className="text-lg font-semibold text-foreground">{title}</h2>
114+
<section className="flex flex-col gap-2">
115+
<div className="flex flex-col gap-1">
116+
<h2 className="text-4xl font-semibold tracking-tight text-foreground">{title}</h2>
109117
{description && <p className="text-sm text-muted">{description}</p>}
110118
</div>
111-
<div className="grid gap-4">{children}</div>
119+
<div className="flex flex-col">{children}</div>
112120
</section>
113121
);
114122
}
@@ -130,8 +138,8 @@ function ConfigFieldFrame({
130138
const messageClassName = messageTone === "error" ? "text-error" : "text-muted";
131139

132140
return (
133-
<div className="grid gap-3 rounded-lg border border-border/80 bg-background/40 p-4 md:grid-cols-[minmax(0,240px)_minmax(0,1fr)]">
134-
<div className="flex flex-col gap-1">
141+
<div className="border-b border-border/70 py-6 first:pt-0 last:border-b-0 last:pb-0">
142+
<div className="flex max-w-4xl flex-col gap-3">
135143
<div className="flex flex-wrap items-center gap-2">
136144
<label htmlFor={fieldId} className="text-sm font-medium text-foreground">
137145
{label}
@@ -148,11 +156,9 @@ function ConfigFieldFrame({
148156
</span>
149157
</div>
150158
<div className="font-mono text-[11px] text-accent">{configKey}</div>
151-
{description && <p className="text-xs leading-5 text-muted">{description}</p>}
152-
</div>
153-
<div className="flex flex-col gap-2">
154-
<div className="flex flex-wrap items-start gap-2">
155-
<div className="min-w-0 flex-1">{children}</div>
159+
{description && <p className="max-w-3xl text-sm leading-7 text-muted">{description}</p>}
160+
<div className="flex flex-wrap items-start gap-2 pt-1">
161+
<div className="min-w-0 flex-1 max-w-xl">{children}</div>
156162
{showUseDefault && (
157163
<button
158164
type="button"

0 commit comments

Comments
 (0)