Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
MUL-8664 fix(views): ellipsize overlong labels in runtime and model pickers (#10008)
Leedada82fa6d9e
diff --git a/packages/views/agents/components/model-dropdown.test.tsx b/packages/views/agents/components/model-dropdown.test.tsxindex dc88be1380..c7a112774f 100644--- a/packages/views/agents/components/model-dropdown.test.tsx+++ b/packages/views/agents/components/model-dropdown.test.tsx@@ -88,6 +88,18 @@ describe("ModelDropdown", () => {discoveryKey += 1;});+ it("keeps an overlong model id ellipsized inside the trigger instead of overflowing", () => {+ // Regression: the trigger label sits in a flex row; without min-w-0 the+ // flex item refuses to shrink below its content width, so hex-encoded+ // model ids (e.g. Claude Code custom models) stretched the picker panel.+ const longModel = `anthropic/claude-ccr-h${"3656e6f76612f646565707365656b".repeat(8)}`;+ const { container } = renderDropdown({ value: longModel });+ const trigger = container.querySelector('[data-slot="popover-trigger"]');+ const label = trigger?.querySelector("span.truncate");+ expect(label?.textContent).toBe(longModel);+ expect(label?.className).toContain("min-w-0");+ });+it("offers the gpt-5.6 Codex models and submits their canonical IDs", async () => {const onAutomaticChange = vi.fn();const { container, onChange } = renderDropdown({ onAutomaticChange });diff --git a/packages/views/agents/components/model-dropdown.tsx b/packages/views/agents/components/model-dropdown.tsxindex e420d210f7..29ae91d3ae 100644--- a/packages/views/agents/components/model-dropdown.tsx+++ b/packages/views/agents/components/model-dropdown.tsx@@ -176,7 +176,7 @@ export function ModelDropdown({two pickers sit side-by-side; inline-in-flex vs block-line-box height calc would otherwise leave them ~1px misaligned. */}<div className="flex items-center gap-2">- <span className="truncate font-medium">{triggerLabel}</span>+ <span className="min-w-0 truncate font-medium">{triggerLabel}</span></div>{value && (<div className="truncate text-caption text-muted-foreground">@@ -292,7 +292,7 @@ export function ModelDropdown({className="flex w-full items-center gap-2 rounded-md px-3 py-2 text-left text-body text-primary transition-colors hover:bg-accent/50"><Plus className="h-4 w-4 shrink-0" />- <span className="truncate">+ <span className="min-w-0 truncate">{t(($) => $.pickers.model_custom_use, { value: trimmedSearch })}</span></button>diff --git a/packages/views/agents/components/runtime-picker.test.tsx b/packages/views/agents/components/runtime-picker.test.tsxindex 1ecb7561ae..bcae0bd7b4 100644--- a/packages/views/agents/components/runtime-picker.test.tsx+++ b/packages/views/agents/components/runtime-picker.test.tsx@@ -81,6 +81,17 @@ describe("RuntimePicker (creation studio)", () => {beforeEach(() => cleanup());afterEach(() => cleanup());+ it("keeps an overlong runtime name ellipsized inside the trigger instead of overflowing", () => {+ // Same flex-row truncation contract as ModelDropdown: the label needs+ // min-w-0 or it overflows the picker when names grow long.+ const longName = `Claude (${"very-long-host-name-".repeat(12)}.local)`;+ const runtimes = [makeRuntime({ id: "rt-long", name: longName })];+ const { container } = renderPicker({ runtimes, selectedRuntimeId: "rt-long" });+ const label = trigger(container).querySelector("span.truncate");+ expect(label?.textContent).toBe(longName);+ expect(label?.className).toContain("min-w-0");+ });+it("opens the runtime list on click", () => {const { container } = renderPicker();fireEvent.click(trigger(container));diff --git a/packages/views/agents/components/runtime-picker.tsx b/packages/views/agents/components/runtime-picker.tsxindex 38fd782396..2d31b7c71f 100644--- a/packages/views/agents/components/runtime-picker.tsx+++ b/packages/views/agents/components/runtime-picker.tsx@@ -176,7 +176,7 @@ export function RuntimePicker({)}<div className="min-w-0 flex-1"><div className="flex items-center gap-2">- <span className="truncate font-medium">+ <span className="min-w-0 truncate font-medium">{runtimesLoading? t(($) => $.create_dialog.runtime_loading): selectedRuntime@@ -234,7 +234,7 @@ export function RuntimePicker({grouping stays consistent instead of collapsing to a flatlist. */}<div className="flex items-center justify-between gap-2 px-2 pb-0.5 pt-2 text-micro font-medium text-muted-foreground">- <span className="truncate">{machine.title}</span>+ <span className="min-w-0 truncate">{machine.title}</span><span className="shrink-0 tabular-nums">{t(($) => $.create_dialog.runtime_group_online, {online: machine.onlineCount,diff --git a/packages/views/runtimes/components/mika-runtime-choice.test.tsx b/packages/views/runtimes/components/mika-runtime-choice.test.tsxindex e0e86a492c..3431f87032 100644--- a/packages/views/runtimes/components/mika-runtime-choice.test.tsx+++ b/packages/views/runtimes/components/mika-runtime-choice.test.tsx@@ -62,3 +62,14 @@ describe("MikaRuntimeChoice list layout", () => {expect(onChange).not.toHaveBeenCalled();});});++describe("MikaRuntimeChoice layout", () => {+ // Regression: the Mika setup dialog's content is a CSS grid. A grid item+ // without min-w-0 grows to its content width, so an overlong model id+ // (e.g. a hex-encoded Claude Code custom model) stretched the dialog+ // instead of being ellipsized by the pickers.+ it("lets its root shrink inside a grid parent so long labels can truncate", () => {+ const { container } = renderChoice({ layout: "dropdown" });+ expect(container.firstElementChild?.className).toContain("min-w-0");+ });+});diff --git a/packages/views/runtimes/components/mika-runtime-choice.tsx b/packages/views/runtimes/components/mika-runtime-choice.tsxindex 4c4f05478d..9eda58c69c 100644--- a/packages/views/runtimes/components/mika-runtime-choice.tsx+++ b/packages/views/runtimes/components/mika-runtime-choice.tsx@@ -57,7 +57,11 @@ export function MikaRuntimeChoice({};return (- <div className="flex flex-col gap-3">+ // min-w-0: DialogContent is a CSS grid, and a grid item's automatic+ // minimum width is its content width. Without this, an overlong runtime+ // or model name widens the grid column past the dialog and the pickers'+ // `truncate` never kicks in.+ <div className="flex min-w-0 flex-col gap-3">{layout === "list" ? (// Capped at ~4 rows so the install commands above stay reachable when// a member has many machines registered.