Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Studio: keep a row's control by its title when a description sits under it (#15349)

Michael Hanf7a96162e701
diff --git a/studio/frontend/src/components/app-sidebar.tsx b/studio/frontend/src/components/app-sidebar.tsx
index df2b08f7f5a..77abdc00502 100644
--- a/studio/frontend/src/components/app-sidebar.tsx
+++ b/studio/frontend/src/components/app-sidebar.tsx
@@ -6950,6 +6950,7 @@ export function AppSidebar() {
</span>
</label>
<Switch
+ className="mt-[var(--ui-title-cap-inset)]"
id="delete-files-on-delete"
checked={deleteFilesOnDelete}
onCheckedChange={setDeleteFilesOnDelete}
diff --git a/studio/frontend/src/features/chat/chat-mcp-servers-dialog.tsx b/studio/frontend/src/features/chat/chat-mcp-servers-dialog.tsx
index f54db1cf333..cba95a4003a 100644
--- a/studio/frontend/src/features/chat/chat-mcp-servers-dialog.tsx
+++ b/studio/frontend/src/features/chat/chat-mcp-servers-dialog.tsx
@@ -1088,6 +1088,7 @@ export function ChatMcpServersDialog({
</span>
</div>
<Switch
+ className="mt-[var(--ui-title-cap-inset)]"
id="mcp-oauth"
checked={form.useOauth}
disabled={formPending}
diff --git a/studio/frontend/src/features/chat/chat-providers-dialog.tsx b/studio/frontend/src/features/chat/chat-providers-dialog.tsx
index e786f9dddcf..871dfdde122 100644
--- a/studio/frontend/src/features/chat/chat-providers-dialog.tsx
+++ b/studio/frontend/src/features/chat/chat-providers-dialog.tsx
@@ -1498,7 +1498,7 @@ export function ChatProvidersSettings({
<div className="flex max-w-[calc(760px*var(--ui-space-scale,1))] flex-col gap-3">
<section className="overflow-hidden rounded-xl border border-border/70 bg-muted/[0.12]">
<div className="divide-y divide-border/60">
- <div className="grid grid-cols-[minmax(140px,0.8fr)_minmax(0,1.2fr)] items-center gap-4 px-4 py-3 @max-[520px]:grid-cols-1">
+ <div className="grid grid-cols-[minmax(140px,0.8fr)_minmax(0,1.2fr)] items-start gap-4 px-4 py-3 @max-[520px]:grid-cols-1">
<div className="flex min-w-0 flex-col gap-0.5">
<Label
htmlFor="provider-preset"
@@ -1527,7 +1527,7 @@ export function ChatProvidersSettings({
>
<SelectTrigger
id="provider-preset"
- className="h-9 w-full text-sm"
+ className="mt-[var(--ui-title-cap-inset)] h-9 w-full text-sm @max-[520px]:mt-0"
disabled={editingProviderId != null}
>
<SelectValue placeholder="Choose a connection" />
@@ -1589,7 +1589,7 @@ export function ChatProvidersSettings({
</div>
{showApiKeyField ? (
- <div className="grid grid-cols-[minmax(140px,0.8fr)_minmax(0,1.2fr)] items-center gap-4 px-4 py-3 @max-[520px]:grid-cols-1">
+ <div className="grid grid-cols-[minmax(140px,0.8fr)_minmax(0,1.2fr)] items-start gap-4 px-4 py-3 @max-[520px]:grid-cols-1">
<div className="flex min-w-0 flex-col gap-0.5">
<Label
htmlFor="provider-api-key"
@@ -1603,7 +1603,7 @@ export function ChatProvidersSettings({
: "Saved securely after you connect."}
</p>
</div>
- <div className="relative min-w-0">
+ <div className="relative mt-[var(--ui-title-cap-inset)] min-w-0 @max-[520px]:mt-0">
<Input
id="provider-api-key"
type={showApiKey ? "text" : "password"}
@@ -1679,7 +1679,7 @@ export function ChatProvidersSettings({
) : null}
{shouldShowProviderApiType(providerType) ? (
- <div className="grid grid-cols-[minmax(140px,0.8fr)_minmax(0,1.2fr)] items-center gap-4 px-4 py-3 @max-[520px]:grid-cols-1">
+ <div className="grid grid-cols-[minmax(140px,0.8fr)_minmax(0,1.2fr)] items-start gap-4 px-4 py-3 @max-[520px]:grid-cols-1">
<div className="flex min-w-0 flex-col gap-0.5">
<Label htmlFor="provider-api-type" className="text-sm font-medium">
API type
@@ -1695,7 +1695,10 @@ export function ChatProvidersSettings({
if (value !== "chat_completions") setReasoningConfig(null);
}}
>
- <SelectTrigger id="provider-api-type" className="h-9 w-full text-sm">
+ <SelectTrigger
+ id="provider-api-type"
+ className="mt-[var(--ui-title-cap-inset)] h-9 w-full text-sm @max-[520px]:mt-0"
+ >
<SelectValue />
</SelectTrigger>
<SelectContent>
@@ -1708,7 +1711,7 @@ export function ChatProvidersSettings({
) : null}
{isCustomProvider &&
selectedProviderContract?.base_url_editable !== false ? (
- <div className="grid grid-cols-[minmax(140px,0.8fr)_minmax(0,1.2fr)] items-center gap-4 px-4 py-3 @max-[520px]:grid-cols-1">
+ <div className="grid grid-cols-[minmax(140px,0.8fr)_minmax(0,1.2fr)] items-start gap-4 px-4 py-3 @max-[520px]:grid-cols-1">
<div className="flex min-w-0 flex-col gap-0.5">
<Label
htmlFor="provider-base-url"
@@ -1728,7 +1731,7 @@ export function ChatProvidersSettings({
value={baseUrlDraft}
onChange={(event) => setBaseUrlDraft(event.target.value)}
placeholder={customProviderBaseUrlPlaceholder(providerType)}
- className="h-9 text-sm"
+ className="mt-[var(--ui-title-cap-inset)] h-9 text-sm @max-[520px]:mt-0"
/>
</div>
) : null}
@@ -1751,7 +1754,7 @@ export function ChatProvidersSettings({
32,768 for a model without one.
</p>
</div>
- <div className="flex min-w-0 flex-col gap-1.5">
+ <div className="mt-[var(--ui-title-cap-inset)] flex min-w-0 flex-col gap-1.5 @max-[520px]:mt-0">
{/* Text, not type=number: that blanks "131,072" and silently clears the override. */}
<Input
id="provider-max-output-tokens"
@@ -1779,7 +1782,7 @@ export function ChatProvidersSettings({
) : null}
{providerType === "llama_cpp" ? (
- <div className="flex items-center justify-between gap-4 px-4 py-3">
+ <div className="flex items-start justify-between gap-4 px-4 py-3">
<div className="space-y-1">
<Label
htmlFor="provider-auto-reload-models"
@@ -1796,6 +1799,7 @@ export function ChatProvidersSettings({
</p>
</div>
<Switch
+ className="mt-[var(--ui-title-cap-inset)]"
id="provider-auto-reload-models"
checked={autoReloadModels}
onCheckedChange={setAutoReloadModels}
@@ -1804,7 +1808,7 @@ export function ChatProvidersSettings({
</div>
) : null}
{showShareToggle ? (
- <div className="flex items-center justify-between gap-4 px-4 py-3">
+ <div className="flex items-start justify-between gap-4 px-4 py-3">
<div className="space-y-1">
<Label
htmlFor="provider-shared"
@@ -1823,6 +1827,7 @@ export function ChatProvidersSettings({
</p>
</div>
<Switch
+ className="mt-[var(--ui-title-cap-inset)]"
id="provider-shared"
checked={sharedDraft}
onCheckedChange={setSharedDraft}
@@ -1864,7 +1869,7 @@ export function ChatProvidersSettings({
Choose the request format your endpoint supports.
</p>
</div>
- <div className="flex min-w-0 flex-col gap-1.5">
+ <div className="mt-[var(--ui-title-cap-inset)] flex min-w-0 flex-col gap-1.5 @max-[520px]:mt-0">
<Select
value={reasoningConfig.style}
onValueChange={(style) => setReasoningConfig({
@@ -1995,7 +2000,7 @@ export function ChatProvidersSettings({
}}
>
<div
- className={`flex flex-wrap items-center justify-between gap-3 px-4 py-3 ${showModelsBody ? "border-border/60 border-b" : ""}`}
+ className={`flex flex-wrap items-start justify-between gap-3 px-4 py-3 ${showModelsBody ? "border-border/60 border-b" : ""}`}
>
<div className="flex min-w-0 flex-col gap-0.5">
<Label className="text-sm font-medium">Models</Label>
@@ -2003,30 +2008,32 @@ export function ChatProvidersSettings({
{modelStatusLabel}
</p>
</div>
- <Button
- type="button"
- variant="outline"
- size="sm"
- className={
- availableModels.length > 0
- ? "h-7 shrink-0 border-transparent bg-transparent px-2 text-xs text-muted-foreground shadow-none hover:bg-muted/45 hover:text-foreground"
- : "shrink-0"
- }
- disabled={loadModelsDisabled}
- title={loadModelsTitle}
- onClick={() => void loadModels()}
- >
- {modelsLoading ? (
- <>
- <Spinner className="mr-2 size-3.5" />
- Loading…
- </>
- ) : availableModels.length > 0 ? (
- "Reload models"
- ) : (
- "Load available models"
- )}
- </Button>
+ <div data-title-line-control={true} className="shrink-0">
+ <Button
+ type="button"
+ variant="outline"
+ size="sm"
+ className={
+ availableModels.length > 0
+ ? "h-7 shrink-0 border-transparent bg-transparent px-2 text-xs text-muted-foreground shadow-none hover:bg-muted/45 hover:text-foreground"
+ : "shrink-0"
+ }
+ disabled={loadModelsDisabled}
+ title={loadModelsTitle}
+ onClick={() => void loadModels()}
+ >
+ {modelsLoading ? (
+ <>
+ <Spinner className="mr-2 size-3.5" />
+ Loading…
+ </>
+ ) : availableModels.length > 0 ? (
+ "Reload models"
+ ) : (
+ "Load available models"
+ )}
+ </Button>
+ </div>
</div>
{isCustomProvider && !supportsRemoteModelCatalog(providerType) ? (
<div className="space-y-3 px-4 py-4">
diff --git a/studio/frontend/src/features/chat/chat-settings-sheet.tsx b/studio/frontend/src/features/chat/chat-settings-sheet.tsx
index 6134885de78..47b267bf518 100644
--- a/studio/frontend/src/features/chat/chat-settings-sheet.tsx
+++ b/studio/frontend/src/features/chat/chat-settings-sheet.tsx
@@ -2053,7 +2053,12 @@ function ConfirmToolCallsToggle() {
const permissionMode = useChatRuntimeStore((s) => s.permissionMode);
return (
- <div className="flex min-h-8 items-center justify-between gap-3">
+ <div
+ className={cn(
+ "flex min-h-8 justify-between gap-3",
+ permissionMode === "full" ? "items-start" : "items-center",
+ )}
+ >
<div className="flex min-w-0 flex-col gap-0.5">
<div className="flex min-w-0 items-center gap-1.5">
<span className="min-w-0 text-ui-13 font-medium leading-[1.25] tracking-nav text-nav-fg">
@@ -2075,7 +2080,11 @@ function ConfirmToolCallsToggle() {
) : null}
</div>
<Switch
- className="panel-switch shrink-0"
+ // Cap top of the 13px title at leading 1.25 (Inter: 0.26em).
+ className={cn(
+ "panel-switch shrink-0",
+ permissionMode === "full" && "mt-[calc(var(--text-ui-13)*0.26)]",
+ )}
checked={permissionMode === "ask"}
onCheckedChange={(checked) => {
if (checked) {
diff --git a/studio/frontend/src/features/chat/components/chat-skills-dialog.tsx b/studio/frontend/src/features/chat/components/chat-skills-dialog.tsx
index 7c5c606301f..3a7db852213 100644
--- a/studio/frontend/src/features/chat/components/chat-skills-dialog.tsx
+++ b/studio/frontend/src/features/chat/components/chat-skills-dialog.tsx
@@ -958,7 +958,7 @@ function SkillRow({
{skill.valid ? null : <Badge variant="destructive">{t("skills.invalid")}</Badge>}
</div>
<Switch
- className="pointer-events-auto translate-y-[0.11em] text-ui-14"
+ className="pointer-events-auto self-start mt-[calc(var(--text-ui-14)*0.3865)] text-ui-14"
checked={usable && skill.enabled}
disabled={!usable || changing}
aria-label={t(skill.enabled ? "skills.disable" : "skills.enable", { name: skill.name })}
diff --git a/studio/frontend/src/features/chat/components/deep-research-composer-button.tsx b/studio/frontend/src/features/chat/components/deep-research-composer-button.tsx
index b8e8f5b33c3..513b1f92049 100644
--- a/studio/frontend/src/features/chat/components/deep-research-composer-button.tsx
+++ b/studio/frontend/src/features/chat/components/deep-research-composer-button.tsx
@@ -219,6 +219,7 @@ function McpSourceList({
) : null}
</span>
<Switch
+ className="mt-[var(--ui-title-cap-inset)]"
checked={values.some((value) => matches(tool, value))}
disabled={
!values.some((value) => matches(tool, value)) &&
@@ -412,7 +413,7 @@ function DeepResearchWebsiteAccessContent({
</div>
<label
htmlFor="research-no-time-limit"
- className="flex shrink-0 cursor-pointer items-center gap-2 pt-0.5 text-sm text-muted-foreground"
+ className="mt-[var(--ui-title-cap-inset)] flex shrink-0 cursor-pointer items-center gap-2 text-sm text-muted-foreground"
>
No limit
<Switch
diff --git a/studio/frontend/src/features/chat/components/delete-chat-files-switch.tsx b/studio/frontend/src/features/chat/components/delete-chat-files-switch.tsx
index c52b77bf2e0..47f18038c1f 100644
--- a/studio/frontend/src/features/chat/components/delete-chat-files-switch.tsx
+++ b/studio/frontend/src/features/chat/components/delete-chat-files-switch.tsx
@@ -31,6 +31,7 @@ export function DeleteChatFilesSwitch({
</span>
</label>
<Switch
+ className="mt-[var(--ui-title-cap-inset)]"
id={id}
checked={checked}
onCheckedChange={onCheckedChange}
diff --git a/studio/frontend/src/features/chat/mcp-image-mappings.tsx b/studio/frontend/src/features/chat/mcp-image-mappings.tsx
index aceaa078260..f59db0fdee7 100644
--- a/studio/frontend/src/features/chat/mcp-image-mappings.tsx
+++ b/studio/frontend/src/features/chat/mcp-image-mappings.tsx
@@ -87,6 +87,7 @@ export function McpImageMappings({
</span>
</span>
<Switch
+ className="mt-[var(--ui-title-cap-inset)]"
id="mcp-image-attachments"
checked={enabled}
disabled={disabled}
diff --git a/studio/frontend/src/features/export/components/reap-card.tsx b/studio/frontend/src/features/export/components/reap-card.tsx
index fa243969a1d..959dc006d91 100644
--- a/studio/frontend/src/features/export/components/reap-card.tsx
+++ b/studio/frontend/src/features/export/components/reap-card.tsx
@@ -31,7 +31,7 @@ export function ReapCard({
onChange({ ...settings, ...patch });
return (
<div className="space-y-3 rounded-lg border p-3">
- <div className="flex items-center justify-between gap-3">
+ <div className="flex items-start justify-between gap-3">
<div className="space-y-0.5">
<div className="text-sm font-medium">Prune experts (REAP)</div>
<div className="text-xs text-muted-foreground">
@@ -41,6 +41,7 @@ export function ReapCard({
</div>
</div>
<Switch
+ className="mt-[var(--ui-title-cap-inset)]"
aria-label="Prune experts (REAP)"
checked={settings.enabled}
onCheckedChange={(enabled) => set({ enabled })}
diff --git a/studio/frontend/src/features/export/export-page.tsx b/studio/frontend/src/features/export/export-page.tsx
index 4f734246796..429635f67b7 100644
--- a/studio/frontend/src/features/export/export-page.tsx
+++ b/studio/frontend/src/features/export/export-page.tsx
@@ -2023,7 +2023,7 @@ export function ExportPage() {
onChange={setQuantLevels}
sizes={quantSizeLabels}
/>
- <div className="flex items-center justify-between gap-3 rounded-lg border p-3">
+ <div className="flex items-start justify-between gap-3 rounded-lg border p-3">
<div className="space-y-0.5">
<div className="text-sm font-medium">
Importance matrix (imatrix)
@@ -2035,6 +2035,7 @@ export function ExportPage() {
</div>
</div>
<Switch
+ className="mt-[var(--ui-title-cap-inset)]"
aria-label="Importance matrix (imatrix)"
checked={effectiveImatrix}
onCheckedChange={setUseImatrix}
@@ -2074,7 +2075,7 @@ export function ExportPage() {
</p>
</div>
)}
- <div className="flex items-center justify-between gap-3 rounded-lg border p-3">
+ <div className="flex items-start justify-between gap-3 rounded-lg border p-3">
<div className="space-y-0.5">
<div className="text-sm font-medium">
Also convert to Q4NX (AMD NPU)
@@ -2088,6 +2089,7 @@ export function ExportPage() {
</div>
</div>
<Switch
+ className="mt-[var(--ui-title-cap-inset)]"
aria-label="Also convert to Q4NX (AMD NPU)"
checked={effectiveNpuQ4nx}
onCheckedChange={setNpuQ4nx}
diff --git a/studio/frontend/src/features/images/images-page.tsx b/studio/frontend/src/features/images/images-page.tsx
index d31eff44486..eb873ef6827 100644
--- a/studio/frontend/src/features/images/images-page.tsx
+++ b/studio/frontend/src/features/images/images-page.tsx
@@ -6001,18 +6001,21 @@ export function ImagesPage({
</div>
{workflow === "create" && (
- <MediaGenerationPresetControl
- kind="image"
- presets={imagePresets.presets}
- activePreset={imagePresets.activePreset}
- ready={imagePresets.presetsReady}
- hasUnsavedChanges={imagePresets.hasUnsavedChanges}
- onSelect={imagePresets.selectPreset}
- onSave={imagePresets.savePreset}
- onDelete={imagePresets.deletePreset}
- onImportFromImage={() => importFileRef.current?.click()}
- onPasteParameters={() => setPasteOpen(true)}
- />
+ // Top edge on the heading's cap top (text-xl, leading-none; Hellix: 0.122em).
+ <div className="mt-[calc(var(--text-xl)*0.122)]">
+ <MediaGenerationPresetControl
+ kind="image"
+ presets={imagePresets.presets}
+ activePreset={imagePresets.activePreset}
+ ready={imagePresets.presetsReady}
+ hasUnsavedChanges={imagePresets.hasUnsavedChanges}
+ onSelect={imagePresets.selectPreset}
+ onSave={imagePresets.savePreset}
+ onDelete={imagePresets.deletePreset}
+ onImportFromImage={() => importFileRef.current?.click()}
+ onPasteParameters={() => setPasteOpen(true)}
+ />
+ </div>
)}
<PasteParametersDialog
open={pasteOpen}
diff --git a/studio/frontend/src/features/profile/components/stats/profile-stats-content.tsx b/studio/frontend/src/features/profile/components/stats/profile-stats-content.tsx
index a3c01112534..020a95be47f 100644
--- a/studio/frontend/src/features/profile/components/stats/profile-stats-content.tsx
+++ b/studio/frontend/src/features/profile/components/stats/profile-stats-content.tsx
@@ -55,7 +55,12 @@ export function ProfileStatsContent() {
{t("settings.profile.stats.subtitle")}
</p>
</div>
- {hasUsage ? <ExportUsageButton /> : null}
+ {hasUsage ? (
+ // Top edge on the h2's cap top (text-base at leading 1.5; Hellix: 0.372em).
+ <div className="mt-[calc(var(--text-base)*0.372)] shrink-0">
+ <ExportUsageButton />
+ </div>
+ ) : null}
</header>
<StatsHighlights stats={stats} />
diff --git a/studio/frontend/src/features/profile/components/stats/stat-primitives.tsx b/studio/frontend/src/features/profile/components/stats/stat-primitives.tsx
index ee539abc4af..8200dcdbc71 100644
--- a/studio/frontend/src/features/profile/components/stats/stat-primitives.tsx
+++ b/studio/frontend/src/features/profile/components/stats/stat-primitives.tsx
@@ -35,7 +35,17 @@ export function StatsCard({
<p className="text-xs text-muted-foreground">{description}</p>
) : null}
</div>
- {action ? <div className="max-w-full shrink-0">{action}</div> : null}
+ {action ? (
+ <div
+ className={cn(
+ "max-w-full shrink-0",
+ // Top edge on the h3's cap top (text-sm at its default leading; Hellix: 0.336em).
+ description && "mt-[calc(var(--text-sm)*0.336)]",
+ )}
+ >
+ {action}
+ </div>
+ ) : null}
</header>
) : null}
{children}
diff --git a/studio/frontend/src/features/rag/components/linked-folders-manager.tsx b/studio/frontend/src/features/rag/components/linked-folders-manager.tsx
index 5b6f9134131..03b8f9a67e2 100644
--- a/studio/frontend/src/features/rag/components/linked-folders-manager.tsx
+++ b/studio/frontend/src/features/rag/components/linked-folders-manager.tsx
@@ -366,7 +366,7 @@ export function LinkedFoldersManager({
type="button"
size="sm"
variant="outline"
- className="shrink-0"
+ className="mt-[var(--ui-title-cap-inset)] shrink-0"
disabled={!manager.desktopSupported || manager.mutating}
onClick={() => void manager.link()}
title={
diff --git a/studio/frontend/src/features/rag/components/retrieval-settings-section.tsx b/studio/frontend/src/features/rag/components/retrieval-settings-section.tsx
index c015bd773c8..ee5cd06fdeb 100644
--- a/studio/frontend/src/features/rag/components/retrieval-settings-section.tsx
+++ b/studio/frontend/src/features/rag/components/retrieval-settings-section.tsx
@@ -193,7 +193,7 @@ export function RetrievalSettingsSection() {
checked={ragOcrScanned}
onCheckedChange={setRagOcrScanned}
aria-label="OCR scanned pages"
- className="panel-switch mt-0.5"
+ className="panel-switch mt-[calc(var(--text-ui-13)*0.2615)]"
/>
</div>
@@ -215,7 +215,7 @@ export function RetrievalSettingsSection() {
checked={ragCaptionFigures}
onCheckedChange={setRagCaptionFigures}
aria-label="Describe figures and charts"
- className="panel-switch mt-0.5"
+ className="panel-switch mt-[calc(var(--text-ui-13)*0.2615)]"
/>
</div>
</div>
diff --git a/studio/frontend/src/features/recipe-studio/dialogs/config-dialog.tsx b/studio/frontend/src/features/recipe-studio/dialogs/config-dialog.tsx
index b244b8328a1..4487f95853e 100644
--- a/studio/frontend/src/features/recipe-studio/dialogs/config-dialog.tsx
+++ b/studio/frontend/src/features/recipe-studio/dialogs/config-dialog.tsx
@@ -78,7 +78,7 @@ export function ConfigDialog({
className={readOnly ? "pointer-events-none min-w-0 opacity-75" : "min-w-0"}
>
{showDropToggle && (
- <div className="mb-2 flex items-center corner-squircle justify-between gap-3 rounded-xl border border-border/60 px-3 pt-2 pb-4">
+ <div className="mb-2 flex items-start corner-squircle justify-between gap-3 rounded-xl border border-border/60 px-3 pt-2 pb-4">
<div className="min-w-0">
<p className="text-sm font-semibold">Keep out of final dataset</p>
<p className="break-words text-xs text-muted-foreground">
@@ -86,6 +86,7 @@ export function ConfigDialog({
</p>
</div>
<Switch
+ className="mt-[var(--ui-title-cap-inset)]"
checked={config.drop ?? false}
disabled={readOnly}
onCheckedChange={(value) => onUpdate(config.id, { drop: value })}
diff --git a/studio/frontend/src/features/recipe-studio/dialogs/preview-dialog.tsx b/studio/frontend/src/features/recipe-studio/dialogs/preview-dialog.tsx
index 232342cc0b3..54eb60f6a1c 100644
--- a/studio/frontend/src/features/recipe-studio/dialogs/preview-dialog.tsx
+++ b/studio/frontend/src/features/recipe-studio/dialogs/preview-dialog.tsx
@@ -430,7 +430,7 @@ function RunDialogBody({
title="Batching"
description="Use batches when you want to split a larger run into smaller pieces."
>
- <div className="flex items-center justify-between gap-3 text-sm">
+ <div className="flex items-start justify-between gap-3 text-sm">
<div className="space-y-0.5">
<span className="font-medium">Enable batching</span>
<p className="text-xs text-muted-foreground">
@@ -438,6 +438,7 @@ function RunDialogBody({
</p>
</div>
<Switch
+ className="mt-[var(--ui-title-cap-inset)]"
checked={settings.batchEnabled}
onCheckedChange={(checked) =>
onSettingsChange({ batchEnabled: Boolean(checked) })
@@ -523,7 +524,7 @@ function RunDialogBody({
)
}
/>
- <div className="flex items-center justify-between gap-3 rounded-lg border border-border/60 bg-background/60 px-3 py-2 text-sm text-foreground">
+ <div className="flex items-start justify-between gap-3 rounded-lg border border-border/60 bg-background/60 px-3 py-2 text-sm text-foreground">
<div className="space-y-0.5">
<p className="font-medium">Merge batches into one file</p>
<p className="text-xs text-muted-foreground">
@@ -531,6 +532,7 @@ function RunDialogBody({
</p>
</div>
<Switch
+ className="mt-[var(--ui-title-cap-inset)]"
checked={settings.mergeBatches}
onCheckedChange={(checked) =>
onSettingsChange({ mergeBatches: Boolean(checked) })
@@ -622,7 +624,7 @@ function RunDialogBody({
)
}
/>
- <div className="flex items-center justify-between gap-3 rounded-lg border border-border/60 bg-background/60 px-3 py-2 text-sm text-foreground md:col-span-2">
+ <div className="flex items-start justify-between gap-3 rounded-lg border border-border/60 bg-background/60 px-3 py-2 text-sm text-foreground md:col-span-2">
<div className="space-y-0.5">
<p className="font-medium">Keep running through failures</p>
<p className="text-xs text-muted-foreground">
@@ -631,6 +633,7 @@ function RunDialogBody({
</p>
</div>
<Switch
+ className="mt-[var(--ui-title-cap-inset)]"
checked={settings.disableEarlyShutdown}
onCheckedChange={(checked) =>
onSettingsChange({
diff --git a/studio/frontend/src/features/recipe-studio/dialogs/processors-dialog.tsx b/studio/frontend/src/features/recipe-studio/dialogs/processors-dialog.tsx
index 78ac4f6cafb..35fd02c3d4d 100644
--- a/studio/frontend/src/features/recipe-studio/dialogs/processors-dialog.tsx
+++ b/studio/frontend/src/features/recipe-studio/dialogs/processors-dialog.tsx
@@ -75,7 +75,7 @@ export function ProcessorsDialog({
<DialogTitle>Processors</DialogTitle>
</VisuallyHidden.Root>
<div className="space-y-4">
- <div className="flex items-center justify-between gap-3 corner-squircle rounded-lg border border-border/60 px-3 py-2">
+ <div className="flex items-start justify-between gap-3 corner-squircle rounded-lg border border-border/60 px-3 py-2">
<div>
<p className="text-sm font-semibold">Schema transform</p>
<p className="text-xs text-muted-foreground">
@@ -83,6 +83,7 @@ export function ProcessorsDialog({
</p>
</div>
<Switch
+ className="mt-[var(--ui-title-cap-inset)]"
checked={Boolean(schemaProcessor)}
onCheckedChange={setSchemaEnabled}
/>
diff --git a/studio/frontend/src/features/recipe-studio/dialogs/tool-profile/tool-profile-dialog.tsx b/studio/frontend/src/features/recipe-studio/dialogs/tool-profile/tool-profile-dialog.tsx
index faefbc2b846..f7c10da7384 100644
--- a/studio/frontend/src/features/recipe-studio/dialogs/tool-profile/tool-profile-dialog.tsx
+++ b/studio/frontend/src/features/recipe-studio/dialogs/tool-profile/tool-profile-dialog.tsx
@@ -666,6 +666,7 @@ export function ToolProfileDialog({
</p>
</div>
<Button
+ className="mt-[var(--ui-title-cap-inset)]"
type="button"
size="xs"
variant="outline"
diff --git a/studio/frontend/src/features/settings/components/cache-storage-rows.tsx b/studio/frontend/src/features/settings/components/cache-storage-rows.tsx
index 7f04f0f19b0..9a5d307a24b 100644
--- a/studio/frontend/src/features/settings/components/cache-storage-rows.tsx
+++ b/studio/frontend/src/features/settings/components/cache-storage-rows.tsx
@@ -274,7 +274,7 @@ export function CacheStorageRows({ cache }: { cache: CacheStorage }) {
entries.map((entry) => (
<div
key={entry.key}
- className="flex flex-wrap items-center justify-between gap-2 border-t border-border/60 py-2.5"
+ className="flex flex-wrap items-start justify-between gap-2 border-t border-border/60 py-2.5"
>
<div className="flex min-w-0 flex-col gap-0.5">
<span className="text-sm text-foreground">
@@ -299,7 +299,7 @@ export function CacheStorageRows({ cache }: { cache: CacheStorage }) {
</span>
) : null}
</div>
- <div className="flex items-center gap-3">
+ <div data-title-line-control={true} className="flex gap-3">
<span className="text-xs tabular-nums text-muted-foreground">
{formatCacheSize(entry.sizeBytes)}
</span>
diff --git a/studio/frontend/src/features/settings/components/decision-api-section.tsx b/studio/frontend/src/features/settings/components/decision-api-section.tsx
index 249bd97a42a..242a7d999ef 100644
--- a/studio/frontend/src/features/settings/components/decision-api-section.tsx
+++ b/studio/frontend/src/features/settings/components/decision-api-section.tsx
@@ -380,7 +380,13 @@ export function DecisionApiSection({
{settings ? (
<Tooltip>
<TooltipTrigger asChild={true}>
- <span className="shrink-0">
+ <span
+ className={cn(
+ "shrink-0",
+ // Top edge on the h2's cap top (text-base at leading 1.5; Hellix: 0.372em).
+ showHeading && "mt-[calc(var(--text-base)*0.372)]",
+ )}
+ >
<Button
size="sm"
className="shrink-0 gap-1.5"
diff --git a/studio/frontend/src/features/settings/components/lan-access-section.tsx b/studio/frontend/src/features/settings/components/lan-access-section.tsx
index 6c7be65b71b..c594e9b0efe 100644
--- a/studio/frontend/src/features/settings/components/lan-access-section.tsx
+++ b/studio/frontend/src/features/settings/components/lan-access-section.tsx
@@ -96,6 +96,35 @@ function AccessStatus({ status }: { status: LanAccessStatus | null }) {
);
}
+function KeylessScopeBadge({
+ scope,
+}: {
+ scope?: LanAccessStatus["keylessScope"];
+}) {
+ const on = scope === "inference" || scope === "full";
+ return (
+ <span
+ role="status"
+ className={cn(
+ "inline-flex items-center gap-1.5 rounded-full bg-muted px-2.5 py-1 text-xs font-medium",
+ on ? "text-foreground" : "text-muted-foreground",
+ )}
+ >
+ <span
+ className={cn(
+ "size-1.5 rounded-full",
+ on ? "bg-emerald-500" : "bg-muted-foreground/60",
+ )}
+ />
+ {scope === "inference"
+ ? "Inference"
+ : scope === "full"
+ ? "Local full"
+ : "Off"}
+ </span>
+ );
+}
+
function LanUrlQrButton({ url }: { url: string }) {
return (
<Dialog>
@@ -404,7 +433,7 @@ export function LanAccessSection() {
data-settings-label="LAN access"
className="overflow-hidden rounded-xl border border-border/70"
>
- <div className="flex items-center justify-between gap-4 bg-muted/30 p-4">
+ <div className="flex items-start justify-between gap-4 bg-muted/30 p-4">
<div className="flex min-w-0 items-start gap-3">
<div className="flex size-8 shrink-0 items-center justify-center icon-disc">
<HugeiconsIcon
@@ -429,7 +458,8 @@ export function LanAccessSection() {
type="button"
size="sm"
variant={stopAction ? "outline" : "dark"}
- className="shrink-0"
+ // Top edge on the h2's cap top (text-base at leading 1.5; Hellix: 0.372em).
+ className="mt-[calc(var(--text-base)*0.372)] shrink-0"
onClick={stopAction ? stop : start}
disabled={actionDisabled}
>
@@ -628,13 +658,7 @@ export function LanAccessSection() {
label="Keyless API status"
description={keylessLanAccessDescription(status)}
>
- <span className="text-xs font-medium text-muted-foreground">
- {status?.keylessScope === "inference"
- ? "Inference"
- : status?.keylessScope === "full"
- ? "Local full"
- : "Off"}
- </span>
+ <KeylessScopeBadge scope={status?.keylessScope} />
</SettingsRow>
<SettingsRow
label="Start automatically"
diff --git a/studio/frontend/src/features/settings/components/remote-access-section.tsx b/studio/frontend/src/features/settings/components/remote-access-section.tsx
index 90c25d04a1c..d7765467f06 100644
--- a/studio/frontend/src/features/settings/components/remote-access-section.tsx
+++ b/studio/frontend/src/features/settings/components/remote-access-section.tsx
@@ -325,7 +325,7 @@ export function RemoteAccessSection() {
data-settings-label="Remote access"
className="overflow-hidden rounded-xl border border-border/70"
>
- <div className="flex items-center justify-between gap-4 bg-muted/30 p-4">
+ <div className="flex items-start justify-between gap-4 bg-muted/30 p-4">
<div className="flex min-w-0 items-start gap-3">
<div className="flex size-8 shrink-0 items-center justify-center icon-disc">
<HugeiconsIcon
@@ -350,7 +350,8 @@ export function RemoteAccessSection() {
type="button"
size="sm"
variant={stopAction ? "outline" : "dark"}
- className="shrink-0"
+ // Top edge on the h2's cap top (text-base at leading 1.5; Hellix: 0.372em).
+ className="mt-[calc(var(--text-base)*0.372)] shrink-0"
onClick={stopAction ? stop : start}
disabled={actionDisabled}
>
diff --git a/studio/frontend/src/features/settings/components/settings-row.tsx b/studio/frontend/src/features/settings/components/settings-row.tsx
index e04e16b199c..12f33e4e709 100644
--- a/studio/frontend/src/features/settings/components/settings-row.tsx
+++ b/studio/frontend/src/features/settings/components/settings-row.tsx
@@ -36,14 +36,13 @@ export function SettingsRow({
data-settings-label={label}
className={cn(
// Controls are fixed-width, so wrap to avoid starving the label.
- "flex flex-wrap items-center justify-end gap-x-6 gap-y-2 py-3",
+ "flex flex-wrap justify-end gap-x-6 gap-y-2 py-3",
+ description ? "items-start" : "items-center",
destructive && "border-t border-border/60 mt-2 pt-4",
className,
)}
>
- <div
- className="flex min-w-[calc(11rem*var(--ui-space-scale,1))] flex-1 basis-0 items-center gap-2.5"
- >
+ <div className="flex min-w-[calc(11rem*var(--ui-space-scale,1))] flex-1 basis-0 items-center gap-2.5">
{icon ? (
<span className="flex shrink-0 items-center text-foreground">
{icon}
@@ -87,9 +86,20 @@ export function SettingsRow({
</div>
</div>
{children ? (
- <div className="flex max-w-full shrink-0 items-center">{children}</div>
+ <div
+ // Aligned to the title line by index.css; an items-center here would override it.
+ data-title-line-control={description ? true : undefined}
+ className={cn(
+ "flex max-w-full shrink-0",
+ !description && "items-center",
+ )}
+ >
+ {children}
+ </div>
+ ) : null}
+ {below ? (
+ <div className="flex basis-full justify-end">{below}</div>
) : null}
- {below ? <div className="flex basis-full justify-end">{below}</div> : null}
</div>
);
}
diff --git a/studio/frontend/src/features/settings/components/settings-section.tsx b/studio/frontend/src/features/settings/components/settings-section.tsx
index bbce4fbb224..6f17b8af138 100644
--- a/studio/frontend/src/features/settings/components/settings-section.tsx
+++ b/studio/frontend/src/features/settings/components/settings-section.tsx
@@ -36,11 +36,23 @@ export function SettingsSection({
{hideHeading ? null : (
<div className="mb-1 flex flex-col gap-0.5">
{action ? (
- <div className="flex items-center justify-between gap-3">
+ <div
+ className={cn(
+ "flex justify-between gap-3",
+ description ? "items-start" : "items-center",
+ )}
+ >
<h2 className="settings-heading text-base font-semibold font-heading">
{title}
</h2>
- {action}
+ {description ? (
+ // Top edge on the h2's cap top (text-base at leading 1.5; Hellix: 0.372em).
+ <div className="mt-[calc(var(--text-base)*0.372)] shrink-0">
+ {action}
+ </div>
+ ) : (
+ action
+ )}
</div>
) : (
<h2 className="settings-heading text-base font-semibold font-heading">
diff --git a/studio/frontend/src/features/settings/components/storage-overview.tsx b/studio/frontend/src/features/settings/components/storage-overview.tsx
index e69e949d6ec..fc27e299574 100644
--- a/studio/frontend/src/features/settings/components/storage-overview.tsx
+++ b/studio/frontend/src/features/settings/components/storage-overview.tsx
@@ -125,7 +125,12 @@ export function SettingsCardRow({
data-settings-label={label}
className="flex flex-col border-border/60 py-3.5 not-first:border-t"
>
- <div className="flex flex-wrap items-center justify-between gap-x-6 gap-y-2">
+ <div
+ className={cn(
+ "flex flex-wrap justify-between gap-x-6 gap-y-2",
+ description ? "items-start" : "items-center",
+ )}
+ >
<div className="flex min-w-0 flex-1 basis-60 flex-col gap-1">
<span className="text-sm font-medium text-foreground">
{label}
@@ -156,7 +161,15 @@ export function SettingsCardRow({
) : null}
</div>
{children ? (
- <div className="flex shrink-0 items-center gap-2">{children}</div>
+ <div
+ data-title-line-control={description ? true : undefined}
+ className={cn(
+ "flex shrink-0 gap-2",
+ !description && "items-center",
+ )}
+ >
+ {children}
+ </div>
) : null}
</div>
</div>
diff --git a/studio/frontend/src/features/settings/tabs/data-tab.tsx b/studio/frontend/src/features/settings/tabs/data-tab.tsx
index d88107da194..a9f2d8a73f9 100644
--- a/studio/frontend/src/features/settings/tabs/data-tab.tsx
+++ b/studio/frontend/src/features/settings/tabs/data-tab.tsx
@@ -673,7 +673,7 @@ export function DataTab({ searchEntry }: { searchEntry?: string }) {
<Button
variant="outline"
size="sm"
- className="shrink-0"
+ className="mt-[var(--ui-title-cap-inset)] shrink-0"
onClick={handleExportArchived}
disabled={archivedExporting}
>
diff --git a/studio/frontend/src/features/settings/tabs/resources-tab.tsx b/studio/frontend/src/features/settings/tabs/resources-tab.tsx
index e05a72a148b..a953499fea1 100644
--- a/studio/frontend/src/features/settings/tabs/resources-tab.tsx
+++ b/studio/frontend/src/features/settings/tabs/resources-tab.tsx
@@ -638,7 +638,8 @@ export function ResourcesTab() {
{t("settings.resources.description")}
</p>
</div>
- <div className="flex min-w-0 flex-wrap items-center gap-2">
+ {/* Top edge on the h1's cap top (text-xl at leading 1.4; Hellix: 0.322em). */}
+ <div className="mt-[calc(var(--text-xl)*0.322)] flex min-w-0 flex-wrap items-center gap-2">
<Button
variant={isOpen ? "secondary" : "outline"}
size="sm"
diff --git a/studio/frontend/src/features/studio/sections/charts/chart-settings-sheet.tsx b/studio/frontend/src/features/studio/sections/charts/chart-settings-sheet.tsx
index f0f030dace6..8174e0f43d7 100644
--- a/studio/frontend/src/features/studio/sections/charts/chart-settings-sheet.tsx
+++ b/studio/frontend/src/features/studio/sections/charts/chart-settings-sheet.tsx
@@ -65,7 +65,13 @@ function SettingRow({
<p className="mt-1 text-xs text-muted-foreground">{description}</p>
) : null}
</div>
- <div className="shrink-0">{control}</div>
+ <div
+ className={
+ description ? "mt-[var(--ui-title-cap-inset)] shrink-0" : "shrink-0"
+ }
+ >
+ {control}
+ </div>
</div>
);
}
diff --git a/studio/frontend/src/features/studio/wizard/training-wizard.tsx b/studio/frontend/src/features/studio/wizard/training-wizard.tsx
index 2b024005f39..87f807ac770 100644
--- a/studio/frontend/src/features/studio/wizard/training-wizard.tsx
+++ b/studio/frontend/src/features/studio/wizard/training-wizard.tsx
@@ -70,8 +70,20 @@ function SectionBox({
className="@container/train-card elevated-card flex flex-col gap-7 bg-card p-5 pb-7"
>
{title && (
- <div className="flex flex-col items-stretch gap-3 @md/train-card:flex-row @md/train-card:items-center @md/train-card:justify-between">
- <div className="flex min-w-0 items-center gap-3">
+ <div
+ className={cn(
+ "flex flex-col items-stretch gap-3 @md/train-card:flex-row @md/train-card:justify-between",
+ description
+ ? "@md/train-card:items-start"
+ : "@md/train-card:items-center",
+ )}
+ >
+ <div
+ className={cn(
+ "flex min-w-0 gap-3",
+ description ? "items-start" : "items-center",
+ )}
+ >
{icon && (
<span
className="train-section-chip inline-flex size-9 shrink-0 items-center justify-center rounded-full"
@@ -100,7 +112,14 @@ function SectionBox({
</div>
</div>
{titleAction && (
- <div className="w-full min-w-0 @md/train-card:w-auto @md/train-card:shrink-0">
+ <div
+ className={cn(
+ "w-full min-w-0 @md/train-card:w-auto @md/train-card:shrink-0",
+ // Top edge on the h2's cap top (13.5px at leading 18px; Hellix: 0.289em).
+ description &&
+ "@md/train-card:mt-[calc(var(--text-ui-13p5)*0.289)]",
+ )}
+ >
{titleAction}
</div>
)}
diff --git a/studio/frontend/src/features/video/video-page.tsx b/studio/frontend/src/features/video/video-page.tsx
index ef5b44bb484..14bd6948dbb 100644
--- a/studio/frontend/src/features/video/video-page.tsx
+++ b/studio/frontend/src/features/video/video-page.tsx
@@ -3852,16 +3852,19 @@ function VideoGenerator({
</p>
</div>
- <MediaGenerationPresetControl
- kind="video"
- presets={videoPresets.presets}
- activePreset={videoPresets.activePreset}
- ready={videoPresets.presetsReady}
- hasUnsavedChanges={videoPresets.hasUnsavedChanges}
- onSelect={videoPresets.selectPreset}
- onSave={videoPresets.savePreset}
- onDelete={videoPresets.deletePreset}
- />
+ {/* Top edge on the heading's cap top (text-xl, leading-none; Hellix: 0.122em). */}
+ <div className="mt-[calc(var(--text-xl)*0.122)]">
+ <MediaGenerationPresetControl
+ kind="video"
+ presets={videoPresets.presets}
+ activePreset={videoPresets.activePreset}
+ ready={videoPresets.presetsReady}
+ hasUnsavedChanges={videoPresets.hasUnsavedChanges}
+ onSelect={videoPresets.selectPreset}
+ onSave={videoPresets.savePreset}
+ onDelete={videoPresets.deletePreset}
+ />
+ </div>
</div>
<Field label="Prompt" hint={status?.prompt_hint || undefined}>
diff --git a/studio/frontend/src/index.css b/studio/frontend/src/index.css
index 1f3636fed8a..9706e577a5d 100644
--- a/studio/frontend/src/index.css
+++ b/studio/frontend/src/index.css
@@ -416,6 +416,8 @@
--ui-icon-size-sm: calc(0.875rem * var(--ui-font-scale, 1));
/* Info "i" beside a settings label, a notch under the label text. */
--ui-icon-size-hint: calc(0.75rem * var(--ui-font-scale, 1));
+ /* Gap from a text-sm title's line top to its cap top (Inter at leading 1.43: 0.35em). */
+ --ui-title-cap-inset: calc(0.875rem * 0.35 * var(--ui-font-scale, 1));
/* Model picker header controls. Padding and gaps follow --ui-space-scale,
icons and label follow --ui-font-scale, so reserve each separately. The
trigger is 2.25rem of padding and gaps, two icons, then the label, plus
@@ -2714,6 +2716,17 @@ html[data-chat-font] .aui-root {
color: color-mix(in oklab, var(--muted-foreground), var(--background) 7%);
}
+ /* The control beside a title + description: its top edge meets the top of the title's letters. */
+ [data-title-line-control] {
+ display: flex;
+ align-items: flex-start;
+ padding-top: var(--ui-title-cap-inset);
+ }
+ /* Plain text (a status like "Off") lines up letter to letter instead, from the line top. */
+ [data-title-line-control]:not(:has(button, input, select, textarea, [role])) {
+ padding-top: 0;
+ }
+
/* Disabled ones (native, aria-disabled, Radix data-disabled) keep the default cursor. */
button:not(:disabled):not([aria-disabled="true"]),
summary,
diff --git a/studio/frontend/tests/settings-row-control-alignment.test.ts b/studio/frontend/tests/settings-row-control-alignment.test.ts
new file mode 100644
index 00000000000..5e67c6e6056
--- /dev/null
+++ b/studio/frontend/tests/settings-row-control-alignment.test.ts
@@ -0,0 +1,37 @@
+import assert from "node:assert/strict";
+import test from "node:test";
+
+import { readSrcAsync } from "./helpers/kit.ts";
+
+const ALIGN_BY_DESCRIPTION = /description \? "items-start" : "items-center"/;
+const TITLE_LINE_CONTROL =
+ /data-title-line-control=\{description \? true : undefined\}\s*className=\{cn\(\s*"flex [^"]*",\s*!description && "items-center",?\s*\)\}/;
+
+for (const path of [
+ "features/settings/components/settings-row.tsx",
+ "features/settings/components/storage-overview.tsx",
+]) {
+ test(`${path}: a row with a description keeps its control by the title`, async () => {
+ const source = await readSrcAsync(path);
+ assert.match(source, ALIGN_BY_DESCRIPTION);
+ assert.match(source, TITLE_LINE_CONTROL);
+ });
+}
+
+test("every control's top edge meets the title's cap top, whatever the control", async () => {
+ const css = await readSrcAsync("index.css");
+ assert.match(
+ css,
+ /--ui-title-cap-inset: calc\(0\.875rem \* 0\.35 \* var\(--ui-font-scale, 1\)\);/,
+ );
+ assert.match(
+ css,
+ /\[data-title-line-control\] \{\s*display: flex;\s*align-items: flex-start;\s*padding-top: var\(--ui-title-cap-inset\);\s*\}/,
+ );
+ // A per-control-type rule misclassified a dropdown whose trigger replaced Button's data-slot.
+ assert.doesNotMatch(css, /\[data-title-line-control\]:has\(/);
+ assert.match(
+ css,
+ /\[data-title-line-control\]:not\(:has\(button, input, select, textarea, \[role\]\)\) \{\s*padding-top: 0;\s*\}/,
+ );
+});