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: one text and control width for every settings row (#15905)

Michael Han7377ca2504d4
diff --git a/studio/frontend/src/features/settings/components/llama-backend-section.tsx b/studio/frontend/src/features/settings/components/llama-backend-section.tsx
index a859b4a9d7d..67c0347a5ee 100644
--- a/studio/frontend/src/features/settings/components/llama-backend-section.tsx
+++ b/studio/frontend/src/features/settings/components/llama-backend-section.tsx
@@ -117,6 +117,7 @@ function LlamaCppPathRow({ onChanged }: { onChanged: () => void }) {
"settings.resources.llamaBackend.customPath.description",
)}
hint={t("settings.resources.llamaBackend.customPath.hint")}
+ wideControl={true}
className="max-[840px]:flex-col max-[840px]:items-stretch max-[840px]:gap-2"
below={
detail || settings?.source === "studio" ? (
diff --git a/studio/frontend/src/features/settings/components/settings-row.tsx b/studio/frontend/src/features/settings/components/settings-row.tsx
index ca2ffc1df53..760cc30d7df 100644
--- a/studio/frontend/src/features/settings/components/settings-row.tsx
+++ b/studio/frontend/src/features/settings/components/settings-row.tsx
@@ -21,6 +21,7 @@ export function SettingsRow({
destructive,
className,
below,
+ wideControl = false,
}: {
label: string;
description?: ReactNode;
@@ -32,6 +33,8 @@ export function SettingsRow({
destructive?: boolean;
className?: string;
below?: ReactNode;
+ /** Lets a control that shows a value it must not clip (a folder path) pass the shared cap. */
+ wideControl?: boolean;
}) {
return (
<div
@@ -50,7 +53,7 @@ export function SettingsRow({
{icon}
</span>
) : null}
- <div className="flex min-w-0 w-full max-w-lg flex-col gap-0.5">
+ <div className="flex min-w-0 w-full max-w-[calc(32rem*var(--ui-space-scale,1))] flex-col gap-0.5">
<span className="text-sm font-medium text-foreground">
{label}
{hint ? (
@@ -94,6 +97,8 @@ export function SettingsRow({
className={cn(
"flex max-w-full shrink-0",
!description && "items-center",
+ !wideControl &&
+ "max-w-[min(100%,calc(20rem*var(--ui-space-scale,1)))] [&>*]:max-w-full",
)}
>
{children}
diff --git a/studio/frontend/src/features/settings/components/storage-overview.tsx b/studio/frontend/src/features/settings/components/storage-overview.tsx
index a4cba333dc4..425e1758457 100644
--- a/studio/frontend/src/features/settings/components/storage-overview.tsx
+++ b/studio/frontend/src/features/settings/components/storage-overview.tsx
@@ -167,7 +167,7 @@ export function SettingsCardRow({
description ? "items-start" : "items-center",
)}
>
- <div className="flex min-w-0 flex-1 basis-60 flex-col gap-1">
+ <div className="flex min-w-0 max-w-[calc(32rem*var(--ui-space-scale,1))] flex-1 basis-60 flex-col gap-1">
<span className="text-sm font-medium text-foreground">
{label}
{hint ? (
diff --git a/studio/frontend/src/features/settings/tabs/accounts-tab.tsx b/studio/frontend/src/features/settings/tabs/accounts-tab.tsx
index 70ed2eaa232..45a4f36aa36 100644
--- a/studio/frontend/src/features/settings/tabs/accounts-tab.tsx
+++ b/studio/frontend/src/features/settings/tabs/accounts-tab.tsx
@@ -208,7 +208,7 @@ function OwnerAccountsTab() {
>
{t("settings.accounts.title")}
</h1>
- <p className="max-w-lg text-xs text-muted-foreground">
+ <p className="text-xs text-muted-foreground">
{t("settings.accounts.description")}
</p>
</header>
diff --git a/studio/frontend/src/features/settings/tabs/debugging-tab.tsx b/studio/frontend/src/features/settings/tabs/debugging-tab.tsx
index 37c18c78b52..b8b2fa8eb25 100644
--- a/studio/frontend/src/features/settings/tabs/debugging-tab.tsx
+++ b/studio/frontend/src/features/settings/tabs/debugging-tab.tsx
@@ -585,7 +585,7 @@ export function DebuggingTab() {
title={t("settings.debugging.logSection")}
description={t("settings.debugging.sourceHint")}
>
- <SettingsRow label={t("settings.debugging.source")}>
+ <SettingsRow label={t("settings.debugging.source")} wideControl={true}>
<Select
value={sourceId ?? ""}
onValueChange={(value) => setSourceId(value || null)}
@@ -629,7 +629,7 @@ export function DebuggingTab() {
</SelectContent>
</Select>
</SettingsRow>
- <SettingsRow label={t("settings.debugging.mode")}>
+ <SettingsRow label={t("settings.debugging.mode")} wideControl={true}>
<div className="flex items-center gap-2">
<div
role="radiogroup"
diff --git a/studio/frontend/tests/settings-row-control-alignment.test.ts b/studio/frontend/tests/settings-row-control-alignment.test.ts
index 5e67c6e6056..b3f1edde6e9 100644
--- a/studio/frontend/tests/settings-row-control-alignment.test.ts
+++ b/studio/frontend/tests/settings-row-control-alignment.test.ts
@@ -5,7 +5,7 @@ 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*\)\}/;
+ /data-title-line-control=\{description \? true : undefined\}\s*className=\{cn\(\s*"flex [^"]*",\s*!description && "items-center",?(?:\s*![\w]+ &&\s*"[^"]*",?)?\s*\)\}/;
for (const path of [
"features/settings/components/settings-row.tsx",
diff --git a/studio/frontend/tests/settings-row-text-width.test.ts b/studio/frontend/tests/settings-row-text-width.test.ts
index 9f998f8c97f..f9263f69bea 100644
--- a/studio/frontend/tests/settings-row-text-width.test.ts
+++ b/studio/frontend/tests/settings-row-text-width.test.ts
@@ -4,7 +4,7 @@ import test from "node:test";
import { readSrcAsync } from "./helpers/kit.ts";
const BOUNDED_TEXT_COLUMN =
- /<div className="[^"]*w-full[^"]*max-w-lg[^"]*flex-col[^"]*">\s*<span className="text-sm font-medium text-foreground">/;
+ /<div className="[^"]*w-full[^"]*max-w-\[calc\(32rem\*var\(--ui-space-scale,1\)\)\][^"]*flex-col[^"]*">\s*<span className="text-sm font-medium text-foreground">/;
test("settings row titles and descriptions share a bounded text column", async () => {
const source = await readSrcAsync(
@@ -14,6 +14,20 @@ test("settings row titles and descriptions share a bounded text column", async (
assert.match(source, BOUNDED_TEXT_COLUMN);
});
+test("a settings row's control is capped too, unless the row opts out for a value it must not clip", async () => {
+ const source = await readSrcAsync(
+ "features/settings/components/settings-row.tsx",
+ );
+ assert.match(
+ source,
+ /!wideControl &&\s*"max-w-\[min\(100%,calc\(20rem\*var\(--ui-space-scale,1\)\)\)\] \[&>\*\]:max-w-full"/,
+ );
+ const llama = await readSrcAsync(
+ "features/settings/components/llama-backend-section.tsx",
+ );
+ assert.match(llama, /customPath\.hint"\)\}\s*wideControl=\{true\}/);
+});
+
test("a settings row's info icon sits inline on the label's baseline, like a glyph", async () => {
const source = await readSrcAsync(
"features/settings/components/settings-row.tsx",