From 3146c8d920046eafdad6f1cf1633ba084a966f81 Mon Sep 17 00:00:00 2001 From: DuskyElf Date: Wed, 18 Nov 2026 21:36:01 +0530 Subject: [PATCH 1/5] fix(web): model picker hovers name the model and provider in full Long model names and the grey provider label truncate in the picker rows, and the docked Reasoning header only repeats the short label, so the provider instance and the model slug cannot be read from any picker surface. Rows now title their text block with the display name, sub-provider, provider instance and slug, repeats dropped, and a disabled row carries the same line in its reason tooltip, and the docked header titles itself with the selected model's name and slug. Titles are written on pointer entry because t3code/no-native-title-tooltip rejects the attribute on intrinsic elements; the header is keyed by its title so a pick under a resting pointer cannot keep the old name. Model and harness: DeepSeek V4.1 Flash, OpenCode in T3 Code. --- .../components/chat/ComposerModelEffort.tsx | 9 +- apps/web/src/components/chat/ModelListRow.tsx | 32 ++-- .../chat/ProviderModelPicker.browser.test.tsx | 163 ++++++++++++++++++ .../components/chat/ProviderModelPicker.tsx | 22 ++- .../src/components/chat/providerIconUtils.ts | 6 + 5 files changed, 216 insertions(+), 16 deletions(-) diff --git a/apps/web/src/components/chat/ComposerModelEffort.tsx b/apps/web/src/components/chat/ComposerModelEffort.tsx index 1d0227c0f648..5c112286c377 100644 --- a/apps/web/src/components/chat/ComposerModelEffort.tsx +++ b/apps/web/src/components/chat/ComposerModelEffort.tsx @@ -544,7 +544,14 @@ export function ComposerEffortColumn(props: { traits: TraitsSelectionInput | nul ? gt("Options", { $context: "heading for model options" }) : gt("Effort", { $context: "heading for reasoning effort levels" }))} - + {/* Keyed so the title cannot outlive the model it names. */} + { + event.currentTarget.title = picker.modelTitle; + }} + > {picker.modelLabel} diff --git a/apps/web/src/components/chat/ModelListRow.tsx b/apps/web/src/components/chat/ModelListRow.tsx index 74dae2dc2358..1290f97f9880 100644 --- a/apps/web/src/components/chat/ModelListRow.tsx +++ b/apps/web/src/components/chat/ModelListRow.tsx @@ -2,7 +2,7 @@ import { type ProviderDriverKind, type ProviderInstanceId } from "@t3tools/contr import { T, useGT } from "gt-react"; import { memo } from "react"; import { CheckIcon, StarIcon } from "lucide-react"; -import { getDisplayModelName } from "./providerIconUtils"; +import { getDisplayModelName, joinModelTitle } from "./providerIconUtils"; import { ComboboxItem } from "../ui/combobox"; import { Button } from "../ui/button"; import { Badge } from "../ui/badge"; @@ -41,6 +41,14 @@ export const ModelListRow = memo(function ModelListRow(props: { name: props.name, subProvider: props.subProvider, }; + const displayName = getDisplayModelName(model); + // The slug names the exact model, and no row text shows it. + const rowTitle = joinModelTitle( + displayName, + props.subProvider, + props.providerDisplayName, + props.slug, + ); const row = ( -
-
{ - const name = event.currentTarget; - name.title = name.scrollWidth > name.clientWidth ? getDisplayModelName(model) : ""; - }} - > - {getDisplayModelName(model)} +
{ + event.currentTarget.title = props.disabledReason ? "" : rowTitle; + }} + > +
+ {displayName} {/* The logo is decorative, so name the provider for screen readers. */} , {props.providerDisplayName}
@@ -147,7 +154,8 @@ export const ModelListRow = memo(function ModelListRow(props: { - {props.disabledReason} + {props.disabledReason} + {rowTitle} ); diff --git a/apps/web/src/components/chat/ProviderModelPicker.browser.test.tsx b/apps/web/src/components/chat/ProviderModelPicker.browser.test.tsx index 06bb36a34c07..e05b6ec5cc5d 100644 --- a/apps/web/src/components/chat/ProviderModelPicker.browser.test.tsx +++ b/apps/web/src/components/chat/ProviderModelPicker.browser.test.tsx @@ -14,6 +14,7 @@ import "~/index.css"; import { render } from "../../../test/render"; import { __setClientSettingsForTests } from "../../hooks/useSettings"; import { deriveProviderInstanceEntries } from "../../providerInstances"; +import { ComposerEffortColumn } from "./ComposerModelEffort"; import { ProviderModelPicker } from "./ProviderModelPicker"; it("keeps each registry image when adding a model from another ACP agent", async () => { @@ -177,6 +178,168 @@ it("keeps a docked picker open after a pick and hands focus to that model's effo await expect.element(search).not.toBeInTheDocument(); }); +it("names each row's model, provider, instance and slug on hover", async () => { + const instanceId = ProviderInstanceId.make("opencode-zen"); + const entries = deriveProviderInstanceEntries([ + { + instanceId, + driver: ProviderDriverKind.make("opencode"), + displayName: "OpenCode Zen", + enabled: true, + installed: true, + version: null, + status: "ready", + auth: { status: "authenticated" }, + checkedAt: "2026-01-01T00:00:00.000Z", + models: [], + slashCommands: [], + skills: [], + }, + ]); + const longName = "DeepSeek V4.1 Flash Free"; + const longSubProvider = "Alibaba Cloud International Model Studio"; + // The row shows the name with its sub-provider prefix stripped. + const shortName = "GLM-5.3"; + const shortSubProvider = "Pi"; + const options = new Map([ + [ + instanceId, + [ + { slug: "deepseek-v4.1-flash", name: longName, subProvider: longSubProvider }, + { + slug: "glm-5.3", + name: `${shortSubProvider} ${shortName}`, + subProvider: shortSubProvider, + }, + { slug: "retired-model", name: "Retired model", subProvider: "Legacy" }, + ], + ], + ]); + + await using screen = await render( + (slug === "retired-model" ? "Needs setup" : null)} + onInstanceModelChange={() => {}} + />, + ); + await screen.getByRole("button", { name: "Choose model" }).click(); + + const rowTitle = async (modelName: string, subProvider: string) => { + const option = page.getByRole("option", { name: new RegExp(modelName) }); + await expect.element(option).toBeVisible(); + const provider = option.getByText(subProvider); + await userEvent.hover(provider); + return vi.waitFor(() => { + const title = provider.element().closest("[title]")?.getAttribute("title"); + expect(title, "row hover title").toBeTruthy(); + return title!; + }); + }; + + // Clipped or not, every row names what it shows, so the hover reads the same everywhere. + expect(await rowTitle(longName, longSubProvider)).toBe( + `${longName} · ${longSubProvider} · OpenCode Zen · deepseek-v4.1-flash`, + ); + expect(await rowTitle(shortName, shortSubProvider)).toBe( + `${shortName} · ${shortSubProvider} · OpenCode Zen · glm-5.3`, + ); + + // A disabled row carries the same line in its reason tooltip instead of a native title. + const disabled = page.getByRole("option", { name: /Retired model/ }); + const reason = disabled.getByText("Legacy"); + await userEvent.hover(reason); + await expect.element(page.getByText("Needs setup")).toBeInTheDocument(); + await expect + .element(page.getByText("Retired model · Legacy · OpenCode Zen · retired-model")) + .toBeInTheDocument(); + expect(reason.element().closest("[title]")?.getAttribute("title") ?? "").toBe(""); +}); + +it("titles the docked effort column's header with the selected model and its slug", async () => { + const instanceId = ProviderInstanceId.make("claude"); + const entries = deriveProviderInstanceEntries([ + { + instanceId, + driver: ProviderDriverKind.make("claudeAgent"), + enabled: true, + installed: true, + version: null, + status: "ready", + auth: { status: "authenticated" }, + checkedAt: "2026-01-01T00:00:00.000Z", + models: [], + slashCommands: [], + skills: [], + }, + ]); + const options = new Map([ + [ + instanceId, + [ + { + slug: "opus-4.5", + name: "Claude Opus 5.5 Fast", + shortName: "Opus 5.5", + isUnavailable: true, + }, + { slug: "sonnet-4.5", name: "Claude Sonnet 5.5 Fast", shortName: "Sonnet 5.5" }, + ], + ], + ]); + + function Picker() { + const [model, setModel] = useState("opus-4.5"); + return ( + } + onInstanceModelChange={(_, selected) => setModel(selected)} + /> + ); + } + + await using screen = await render(); + await screen.getByRole("button", { name: "Choose model" }).click(); + + // The docked column sits in the popover's portal, outside the render container. + const effortHeader = (label: string) => { + const span = [...document.querySelectorAll("[data-model-picker-effort] span")].find( + (candidate) => candidate.textContent === label, + ); + expect(span, "effort column header").toBeDefined(); + return span!; + }; + + const header = await vi.waitFor(() => effortHeader("Opus 5.5")); + await userEvent.hover(header); + await vi.waitFor(() => + // An unavailable model keeps its marker; the slug follows it. + expect(header.getAttribute("title")).toBe("Claude Opus 5.5 Fast (Unavailable) · opus-4.5"), + ); + + // Picking another model replaces the header node, so the previous title cannot carry over. + await page.getByRole("option", { name: /Claude Sonnet 5.5 Fast/ }).click(); + const next = await vi.waitFor(() => effortHeader("Sonnet 5.5")); + expect(next.getAttribute("title")).toBeNull(); + await userEvent.hover(next); + await vi.waitFor(() => + expect(next.getAttribute("title")).toBe("Claude Sonnet 5.5 Fast · sonnet-4.5"), + ); +}); + it("lists a model reported twice by one provider once, with contiguous jump shortcuts", async () => { const instanceId = ProviderInstanceId.make("claude"); const entries = deriveProviderInstanceEntries([ diff --git a/apps/web/src/components/chat/ProviderModelPicker.tsx b/apps/web/src/components/chat/ProviderModelPicker.tsx index 254b1ffeac93..41d810c8a9e1 100644 --- a/apps/web/src/components/chat/ProviderModelPicker.tsx +++ b/apps/web/src/components/chat/ProviderModelPicker.tsx @@ -26,7 +26,12 @@ import { ModelPickerContent, resolveModelPickerSelectedModel } from "./ModelPick import { retainedModelWhileProviderLocked } from "./ProviderModelPicker.logic"; import { ChatGptSharingControl } from "./ChatGptSharingControl"; import { ProviderInstanceIcon } from "./ProviderInstanceIcon"; -import { ModelEsque, getDisplayModelName, getTriggerDisplayModelName } from "./providerIconUtils"; +import { + ModelEsque, + getDisplayModelName, + getTriggerDisplayModelName, + joinModelTitle, +} from "./providerIconUtils"; import { shouldShowInstanceBadge, type ProviderInstanceEntry } from "../../providerInstances"; import { ComposerControl, type ComposerControlSize } from "./ComposerControl"; import { takeOpenTarget, useComposerMenuProps } from "./composerEventScope"; @@ -86,7 +91,10 @@ function lockBackgroundScroll(popup: HTMLElement | null) { } /** What a docked effort column needs from its picker: the model it serves. */ -export const DockedPickerContext = createContext<{ modelLabel: string }>({ modelLabel: "" }); +export const DockedPickerContext = createContext<{ modelLabel: string; modelTitle: string }>({ + modelLabel: "", + modelTitle: "", +}); export const ProviderModelPicker = memo(function ProviderModelPicker(props: { environmentId: EnvironmentId | null; @@ -182,6 +190,14 @@ export const ProviderModelPicker = memo(function ProviderModelPicker(props: { const triggerLabel = selectedModel ? withUnavailable(getDisplayModelName(selectedModel), selectedModel.isUnavailable) : triggerTitle; + // The header shows the trigger's short form; its hover names the selected model and its slug. + // A model missing from the catalog has no full name, so the truncated id is all there is. + const modelTitle = selectedModel + ? joinModelTitle( + withUnavailable(selectedModel.name, selectedModel.isUnavailable), + selectedModel.slug, + ) + : triggerTitle.trim(); const showInstanceBadge = activeEntry !== null && shouldShowInstanceBadge(activeEntry, props.instanceEntries); @@ -470,7 +486,7 @@ export const ProviderModelPicker = memo(function ProviderModelPicker(props: { touchBackdrop > {props.effortColumn ? ( - +
{/* One fixed height, so a model with more options never resizes the popup. Short windows shrink it and keep the footer. */} diff --git a/apps/web/src/components/chat/providerIconUtils.ts b/apps/web/src/components/chat/providerIconUtils.ts index 565dc25c05f1..52de6c470534 100644 --- a/apps/web/src/components/chat/providerIconUtils.ts +++ b/apps/web/src/components/chat/providerIconUtils.ts @@ -35,6 +35,12 @@ export function getDisplayModelName( return stripLeadingQualifier(name, model.subProvider); } +/** Joins the parts that name a model on hover, dropping blanks and repeats. */ +export function joinModelTitle(...parts: ReadonlyArray): string { + const trimmed = parts.map((part) => part?.trim()).filter((part): part is string => Boolean(part)); + return [...new Set(trimmed)].join(" · "); +} + export function getTriggerDisplayModelName( model: ModelEsque, driverKind: ProviderDriverKind | null | undefined, From 5105f682e15be8c669e7f8aabcf068ff7ebc67b8 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Thu, 19 Nov 2026 02:07:44 +0000 Subject: [PATCH 2/5] fix(web): title model picker rows and the docked header only for clipped text Narrow the hover to the clipping defect: a row names its model and sub-provider when either is cut off, and the docked effort header names its model when the label is cut off. Drops the slug, provider instance, disabled-row tooltip line and joinModelTitle helper. Co-Authored-By: Claude Opus 5.5 --- .../components/chat/ComposerModelEffort.tsx | 7 +- apps/web/src/components/chat/ModelListRow.tsx | 21 ++- .../chat/ProviderModelPicker.browser.test.tsx | 129 ++---------------- .../components/chat/ProviderModelPicker.tsx | 22 +-- .../src/components/chat/providerIconUtils.ts | 6 - 5 files changed, 28 insertions(+), 157 deletions(-) diff --git a/apps/web/src/components/chat/ComposerModelEffort.tsx b/apps/web/src/components/chat/ComposerModelEffort.tsx index 5c112286c377..4ecc5fd769c7 100644 --- a/apps/web/src/components/chat/ComposerModelEffort.tsx +++ b/apps/web/src/components/chat/ComposerModelEffort.tsx @@ -544,12 +544,13 @@ export function ComposerEffortColumn(props: { traits: TraitsSelectionInput | nul ? gt("Options", { $context: "heading for model options" }) : gt("Effort", { $context: "heading for reasoning effort levels" }))} - {/* Keyed so the title cannot outlive the model it names. */} + {/* Keyed so a title set on hover cannot outlive the model it names. */} { - event.currentTarget.title = picker.modelTitle; + const label = event.currentTarget; + label.title = label.scrollWidth > label.clientWidth ? picker.modelLabel : ""; }} > {picker.modelLabel} diff --git a/apps/web/src/components/chat/ModelListRow.tsx b/apps/web/src/components/chat/ModelListRow.tsx index 1290f97f9880..189539ddce00 100644 --- a/apps/web/src/components/chat/ModelListRow.tsx +++ b/apps/web/src/components/chat/ModelListRow.tsx @@ -2,7 +2,7 @@ import { type ProviderDriverKind, type ProviderInstanceId } from "@t3tools/contr import { T, useGT } from "gt-react"; import { memo } from "react"; import { CheckIcon, StarIcon } from "lucide-react"; -import { getDisplayModelName, joinModelTitle } from "./providerIconUtils"; +import { getDisplayModelName } from "./providerIconUtils"; import { ComboboxItem } from "../ui/combobox"; import { Button } from "../ui/button"; import { Badge } from "../ui/badge"; @@ -42,13 +42,6 @@ export const ModelListRow = memo(function ModelListRow(props: { subProvider: props.subProvider, }; const displayName = getDisplayModelName(model); - // The slug names the exact model, and no row text shows it. - const rowTitle = joinModelTitle( - displayName, - props.subProvider, - props.providerDisplayName, - props.slug, - ); const row = (
{ - event.currentTarget.title = props.disabledReason ? "" : rowTitle; + const clipped = [...event.currentTarget.children].some( + (child) => child.scrollWidth > child.clientWidth, + ); + event.currentTarget.title = clipped + ? [displayName, props.subProvider].filter(Boolean).join(" · ") + : ""; }} >
@@ -154,8 +152,7 @@ export const ModelListRow = memo(function ModelListRow(props: { - {props.disabledReason} - {rowTitle} + {props.disabledReason} ); diff --git a/apps/web/src/components/chat/ProviderModelPicker.browser.test.tsx b/apps/web/src/components/chat/ProviderModelPicker.browser.test.tsx index e05b6ec5cc5d..cc1bf6ebe6da 100644 --- a/apps/web/src/components/chat/ProviderModelPicker.browser.test.tsx +++ b/apps/web/src/components/chat/ProviderModelPicker.browser.test.tsx @@ -14,7 +14,6 @@ import "~/index.css"; import { render } from "../../../test/render"; import { __setClientSettingsForTests } from "../../hooks/useSettings"; import { deriveProviderInstanceEntries } from "../../providerInstances"; -import { ComposerEffortColumn } from "./ComposerModelEffort"; import { ProviderModelPicker } from "./ProviderModelPicker"; it("keeps each registry image when adding a model from another ACP agent", async () => { @@ -178,7 +177,7 @@ it("keeps a docked picker open after a pick and hands focus to that model's effo await expect.element(search).not.toBeInTheDocument(); }); -it("names each row's model, provider, instance and slug on hover", async () => { +it("names a row in full on hover only when its name or sub-provider is cut off", async () => { const instanceId = ProviderInstanceId.make("opencode-zen"); const entries = deriveProviderInstanceEntries([ { @@ -196,22 +195,13 @@ it("names each row's model, provider, instance and slug on hover", async () => { skills: [], }, ]); - const longName = "DeepSeek V4.1 Flash Free"; const longSubProvider = "Alibaba Cloud International Model Studio"; - // The row shows the name with its sub-provider prefix stripped. - const shortName = "GLM-5.3"; - const shortSubProvider = "Pi"; const options = new Map([ [ instanceId, [ - { slug: "deepseek-v4.1-flash", name: longName, subProvider: longSubProvider }, - { - slug: "glm-5.3", - name: `${shortSubProvider} ${shortName}`, - subProvider: shortSubProvider, - }, - { slug: "retired-model", name: "Retired model", subProvider: "Legacy" }, + { slug: "glm-5.3", name: "GLM-5.3", subProvider: longSubProvider }, + { slug: "kimi", name: "Kimi", subProvider: "Pi" }, ], ], ]); @@ -220,124 +210,29 @@ it("names each row's model, provider, instance and slug on hover", async () => { (slug === "retired-model" ? "Needs setup" : null)} onInstanceModelChange={() => {}} />, ); await screen.getByRole("button", { name: "Choose model" }).click(); - const rowTitle = async (modelName: string, subProvider: string) => { + const hoverTitle = async (modelName: string, subProvider: string) => { const option = page.getByRole("option", { name: new RegExp(modelName) }); await expect.element(option).toBeVisible(); - const provider = option.getByText(subProvider); - await userEvent.hover(provider); - return vi.waitFor(() => { - const title = provider.element().closest("[title]")?.getAttribute("title"); - expect(title, "row hover title").toBeTruthy(); - return title!; - }); + const label = option.getByText(subProvider); + await userEvent.hover(label); + return label.element().parentElement?.getAttribute("title"); }; - // Clipped or not, every row names what it shows, so the hover reads the same everywhere. - expect(await rowTitle(longName, longSubProvider)).toBe( - `${longName} · ${longSubProvider} · OpenCode Zen · deepseek-v4.1-flash`, - ); - expect(await rowTitle(shortName, shortSubProvider)).toBe( - `${shortName} · ${shortSubProvider} · OpenCode Zen · glm-5.3`, - ); - - // A disabled row carries the same line in its reason tooltip instead of a native title. - const disabled = page.getByRole("option", { name: /Retired model/ }); - const reason = disabled.getByText("Legacy"); - await userEvent.hover(reason); - await expect.element(page.getByText("Needs setup")).toBeInTheDocument(); - await expect - .element(page.getByText("Retired model · Legacy · OpenCode Zen · retired-model")) - .toBeInTheDocument(); - expect(reason.element().closest("[title]")?.getAttribute("title") ?? "").toBe(""); -}); - -it("titles the docked effort column's header with the selected model and its slug", async () => { - const instanceId = ProviderInstanceId.make("claude"); - const entries = deriveProviderInstanceEntries([ - { - instanceId, - driver: ProviderDriverKind.make("claudeAgent"), - enabled: true, - installed: true, - version: null, - status: "ready", - auth: { status: "authenticated" }, - checkedAt: "2026-01-01T00:00:00.000Z", - models: [], - slashCommands: [], - skills: [], - }, - ]); - const options = new Map([ - [ - instanceId, - [ - { - slug: "opus-4.5", - name: "Claude Opus 5.5 Fast", - shortName: "Opus 5.5", - isUnavailable: true, - }, - { slug: "sonnet-4.5", name: "Claude Sonnet 5.5 Fast", shortName: "Sonnet 5.5" }, - ], - ], - ]); - - function Picker() { - const [model, setModel] = useState("opus-4.5"); - return ( - } - onInstanceModelChange={(_, selected) => setModel(selected)} - /> - ); - } - - await using screen = await render(); - await screen.getByRole("button", { name: "Choose model" }).click(); - - // The docked column sits in the popover's portal, outside the render container. - const effortHeader = (label: string) => { - const span = [...document.querySelectorAll("[data-model-picker-effort] span")].find( - (candidate) => candidate.textContent === label, - ); - expect(span, "effort column header").toBeDefined(); - return span!; - }; - - const header = await vi.waitFor(() => effortHeader("Opus 5.5")); - await userEvent.hover(header); - await vi.waitFor(() => - // An unavailable model keeps its marker; the slug follows it. - expect(header.getAttribute("title")).toBe("Claude Opus 5.5 Fast (Unavailable) · opus-4.5"), - ); - - // Picking another model replaces the header node, so the previous title cannot carry over. - await page.getByRole("option", { name: /Claude Sonnet 5.5 Fast/ }).click(); - const next = await vi.waitFor(() => effortHeader("Sonnet 5.5")); - expect(next.getAttribute("title")).toBeNull(); - await userEvent.hover(next); - await vi.waitFor(() => - expect(next.getAttribute("title")).toBe("Claude Sonnet 5.5 Fast · sonnet-4.5"), + // Only the sub-provider is clipped here, and main titled only a clipped model name. + await vi.waitFor(async () => + expect(await hoverTitle("GLM-5.3", longSubProvider)).toBe(`GLM-5.3 · ${longSubProvider}`), ); + expect(await hoverTitle("Kimi", "Pi")).toBe(""); }); it("lists a model reported twice by one provider once, with contiguous jump shortcuts", async () => { diff --git a/apps/web/src/components/chat/ProviderModelPicker.tsx b/apps/web/src/components/chat/ProviderModelPicker.tsx index 41d810c8a9e1..254b1ffeac93 100644 --- a/apps/web/src/components/chat/ProviderModelPicker.tsx +++ b/apps/web/src/components/chat/ProviderModelPicker.tsx @@ -26,12 +26,7 @@ import { ModelPickerContent, resolveModelPickerSelectedModel } from "./ModelPick import { retainedModelWhileProviderLocked } from "./ProviderModelPicker.logic"; import { ChatGptSharingControl } from "./ChatGptSharingControl"; import { ProviderInstanceIcon } from "./ProviderInstanceIcon"; -import { - ModelEsque, - getDisplayModelName, - getTriggerDisplayModelName, - joinModelTitle, -} from "./providerIconUtils"; +import { ModelEsque, getDisplayModelName, getTriggerDisplayModelName } from "./providerIconUtils"; import { shouldShowInstanceBadge, type ProviderInstanceEntry } from "../../providerInstances"; import { ComposerControl, type ComposerControlSize } from "./ComposerControl"; import { takeOpenTarget, useComposerMenuProps } from "./composerEventScope"; @@ -91,10 +86,7 @@ function lockBackgroundScroll(popup: HTMLElement | null) { } /** What a docked effort column needs from its picker: the model it serves. */ -export const DockedPickerContext = createContext<{ modelLabel: string; modelTitle: string }>({ - modelLabel: "", - modelTitle: "", -}); +export const DockedPickerContext = createContext<{ modelLabel: string }>({ modelLabel: "" }); export const ProviderModelPicker = memo(function ProviderModelPicker(props: { environmentId: EnvironmentId | null; @@ -190,14 +182,6 @@ export const ProviderModelPicker = memo(function ProviderModelPicker(props: { const triggerLabel = selectedModel ? withUnavailable(getDisplayModelName(selectedModel), selectedModel.isUnavailable) : triggerTitle; - // The header shows the trigger's short form; its hover names the selected model and its slug. - // A model missing from the catalog has no full name, so the truncated id is all there is. - const modelTitle = selectedModel - ? joinModelTitle( - withUnavailable(selectedModel.name, selectedModel.isUnavailable), - selectedModel.slug, - ) - : triggerTitle.trim(); const showInstanceBadge = activeEntry !== null && shouldShowInstanceBadge(activeEntry, props.instanceEntries); @@ -486,7 +470,7 @@ export const ProviderModelPicker = memo(function ProviderModelPicker(props: { touchBackdrop > {props.effortColumn ? ( - +
{/* One fixed height, so a model with more options never resizes the popup. Short windows shrink it and keep the footer. */} diff --git a/apps/web/src/components/chat/providerIconUtils.ts b/apps/web/src/components/chat/providerIconUtils.ts index 52de6c470534..565dc25c05f1 100644 --- a/apps/web/src/components/chat/providerIconUtils.ts +++ b/apps/web/src/components/chat/providerIconUtils.ts @@ -35,12 +35,6 @@ export function getDisplayModelName( return stripLeadingQualifier(name, model.subProvider); } -/** Joins the parts that name a model on hover, dropping blanks and repeats. */ -export function joinModelTitle(...parts: ReadonlyArray): string { - const trimmed = parts.map((part) => part?.trim()).filter((part): part is string => Boolean(part)); - return [...new Set(trimmed)].join(" · "); -} - export function getTriggerDisplayModelName( model: ModelEsque, driverKind: ProviderDriverKind | null | undefined, From ef828e8ae49e43910909403b93703331880b6e6a Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Thu, 19 Nov 2026 03:12:09 +0000 Subject: [PATCH 3/5] fix(web): show clipped model picker names in the styled tooltip The row and docked-header hovers set the native title attribute from a pointer handler. That got around the no-native-title-tooltip rule, and Chromium draws native tooltips outside the page, so they never showed up in the browser. Both now use Tooltip, which opens only when the text is clipped. A disabled row keeps just its reason tooltip. Co-Authored-By: Claude Opus 5.5 --- .../components/chat/ComposerModelEffort.tsx | 32 +++++-- apps/web/src/components/chat/ModelListRow.tsx | 83 +++++++++++-------- .../chat/ProviderModelPicker.browser.test.tsx | 22 ++--- 3 files changed, 80 insertions(+), 57 deletions(-) diff --git a/apps/web/src/components/chat/ComposerModelEffort.tsx b/apps/web/src/components/chat/ComposerModelEffort.tsx index 4ecc5fd769c7..77d950015b1a 100644 --- a/apps/web/src/components/chat/ComposerModelEffort.tsx +++ b/apps/web/src/components/chat/ComposerModelEffort.tsx @@ -526,6 +526,8 @@ export function ComposerEffortColumn(props: { traits: TraitsSelectionInput | nul const gt = useGT(); const messages = useMessages(); const picker = use(DockedPickerContext); + const modelLabelRef = useRef(null); + const [modelTooltipOpen, setModelTooltipOpen] = useState(false); const visibility = props.traits ? getTraitsSectionVisibility({ ...props.traits, resolve: messages }) : null; @@ -544,17 +546,29 @@ export function ComposerEffortColumn(props: { traits: TraitsSelectionInput | nul ? gt("Options", { $context: "heading for model options" }) : gt("Effort", { $context: "heading for reasoning effort levels" }))} - {/* Keyed so a title set on hover cannot outlive the model it names. */} - { - const label = event.currentTarget; - label.title = label.scrollWidth > label.clientWidth ? picker.modelLabel : ""; + { + const label = modelLabelRef.current; + setModelTooltipOpen(open && !!label && label.scrollWidth > label.clientWidth); }} > - {picker.modelLabel} - + + } + > + {picker.modelLabel} + + + {picker.modelLabel} + +
{/* pt-2.5 puts the first level on the same line as the first model. */} diff --git a/apps/web/src/components/chat/ModelListRow.tsx b/apps/web/src/components/chat/ModelListRow.tsx index 189539ddce00..b61ca6629a2a 100644 --- a/apps/web/src/components/chat/ModelListRow.tsx +++ b/apps/web/src/components/chat/ModelListRow.tsx @@ -1,6 +1,6 @@ import { type ProviderDriverKind, type ProviderInstanceId } from "@t3tools/contracts"; import { T, useGT } from "gt-react"; -import { memo } from "react"; +import { memo, useRef, useState } from "react"; import { CheckIcon, StarIcon } from "lucide-react"; import { getDisplayModelName } from "./providerIconUtils"; import { ComboboxItem } from "../ui/combobox"; @@ -42,6 +42,8 @@ export const ModelListRow = memo(function ModelListRow(props: { subProvider: props.subProvider, }; const displayName = getDisplayModelName(model); + const textRef = useRef(null); + const [nameTooltipOpen, setNameTooltipOpen] = useState(false); const row = ( -
{ - const clipped = [...event.currentTarget.children].some( - (child) => child.scrollWidth > child.clientWidth, + { + const text = textRef.current; + setNameTooltipOpen( + open && + !!text && + [...text.children].some((child) => child.scrollWidth > child.clientWidth), ); - event.currentTarget.title = clipped - ? [displayName, props.subProvider].filter(Boolean).join(" · ") - : ""; }} + disabled={Boolean(props.disabledReason)} > -
- {displayName} - {/* The logo is decorative, so name the provider for screen readers. */} - , {props.providerDisplayName} -
- {props.isSelected ?
+ + } + > +
+ {displayName} + {/* The logo is decorative, so name the provider for screen readers. */} + , {props.providerDisplayName} +
+ {props.isSelected ?
+ + {[displayName, props.subProvider].filter(Boolean).join(" · ")} + +
diff --git a/apps/web/src/components/chat/ProviderModelPicker.browser.test.tsx b/apps/web/src/components/chat/ProviderModelPicker.browser.test.tsx index cc1bf6ebe6da..d4e27479bd58 100644 --- a/apps/web/src/components/chat/ProviderModelPicker.browser.test.tsx +++ b/apps/web/src/components/chat/ProviderModelPicker.browser.test.tsx @@ -177,7 +177,7 @@ it("keeps a docked picker open after a pick and hands focus to that model's effo await expect.element(search).not.toBeInTheDocument(); }); -it("names a row in full on hover only when its name or sub-provider is cut off", async () => { +it("names a row in full on hover when only its sub-provider is cut off", async () => { const instanceId = ProviderInstanceId.make("opencode-zen"); const entries = deriveProviderInstanceEntries([ { @@ -220,19 +220,15 @@ it("names a row in full on hover only when its name or sub-provider is cut off", ); await screen.getByRole("button", { name: "Choose model" }).click(); - const hoverTitle = async (modelName: string, subProvider: string) => { - const option = page.getByRole("option", { name: new RegExp(modelName) }); - await expect.element(option).toBeVisible(); - const label = option.getByText(subProvider); - await userEvent.hover(label); - return label.element().parentElement?.getAttribute("title"); - }; - - // Only the sub-provider is clipped here, and main titled only a clipped model name. - await vi.waitFor(async () => - expect(await hoverTitle("GLM-5.3", longSubProvider)).toBe(`GLM-5.3 · ${longSubProvider}`), + const option = page.getByRole("option", { name: /GLM-5\.3/ }); + await expect.element(option).toBeVisible(); + // Only the sub-provider is clipped here, and main named only a clipped model name. + await userEvent.hover(option.getByText(longSubProvider)); + await vi.waitFor(() => + expect(document.querySelector('[data-slot="tooltip-popup"]')?.textContent).toBe( + `GLM-5.3 · ${longSubProvider}`, + ), ); - expect(await hoverTitle("Kimi", "Pi")).toBe(""); }); it("lists a model reported twice by one provider once, with contiguous jump shortcuts", async () => { From 0334067ed292e32589a099316b503bdbcd6d716a Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Thu, 19 Nov 2026 03:57:41 +0000 Subject: [PATCH 4/5] fix(web): model picker hovers name the instance, slug and full header model MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Row hovers now list name · sub-provider · provider instance · slug, and the docked header hover names the full model and its slug through a separate modelTitle on DockedPickerContext instead of repeating the short label. Both open on every hover, since the slug is never visible text. Co-Authored-By: Claude Opus 5.5 --- .../components/chat/ComposerModelEffort.tsx | 20 +++----------- apps/web/src/components/chat/ModelListRow.tsx | 26 +++++++------------ .../chat/ProviderModelPicker.browser.test.tsx | 19 ++++++++++---- .../components/chat/ProviderModelPicker.tsx | 8 ++++-- 4 files changed, 32 insertions(+), 41 deletions(-) diff --git a/apps/web/src/components/chat/ComposerModelEffort.tsx b/apps/web/src/components/chat/ComposerModelEffort.tsx index 77d950015b1a..f486e1115b4d 100644 --- a/apps/web/src/components/chat/ComposerModelEffort.tsx +++ b/apps/web/src/components/chat/ComposerModelEffort.tsx @@ -526,8 +526,6 @@ export function ComposerEffortColumn(props: { traits: TraitsSelectionInput | nul const gt = useGT(); const messages = useMessages(); const picker = use(DockedPickerContext); - const modelLabelRef = useRef(null); - const [modelTooltipOpen, setModelTooltipOpen] = useState(false); const visibility = props.traits ? getTraitsSectionVisibility({ ...props.traits, resolve: messages }) : null; @@ -546,27 +544,15 @@ export function ComposerEffortColumn(props: { traits: TraitsSelectionInput | nul ? gt("Options", { $context: "heading for model options" }) : gt("Effort", { $context: "heading for reasoning effort levels" }))} - { - const label = modelLabelRef.current; - setModelTooltipOpen(open && !!label && label.scrollWidth > label.clientWidth); - }} - > + - } + render={} > {picker.modelLabel} - {picker.modelLabel} + {picker.modelTitle}
diff --git a/apps/web/src/components/chat/ModelListRow.tsx b/apps/web/src/components/chat/ModelListRow.tsx index b61ca6629a2a..0c8a7e8b38e0 100644 --- a/apps/web/src/components/chat/ModelListRow.tsx +++ b/apps/web/src/components/chat/ModelListRow.tsx @@ -1,6 +1,6 @@ import { type ProviderDriverKind, type ProviderInstanceId } from "@t3tools/contracts"; import { T, useGT } from "gt-react"; -import { memo, useRef, useState } from "react"; +import { memo } from "react"; import { CheckIcon, StarIcon } from "lucide-react"; import { getDisplayModelName } from "./providerIconUtils"; import { ComboboxItem } from "../ui/combobox"; @@ -42,8 +42,11 @@ export const ModelListRow = memo(function ModelListRow(props: { subProvider: props.subProvider, }; const displayName = getDisplayModelName(model); - const textRef = useRef(null); - const [nameTooltipOpen, setNameTooltipOpen] = useState(false); + const identity = [ + ...new Set([displayName, props.subProvider, props.providerDisplayName, props.slug]), + ] + .filter(Boolean) + .join(" · "); const row = ( { - const text = textRef.current; - setNameTooltipOpen( - open && - !!text && - [...text.children].some((child) => child.scrollWidth > child.clientWidth), - ); - }} + // A disabled row's reason tooltip covers it. disabled={Boolean(props.disabledReason)} > - } + render={
} >
{displayName} @@ -116,7 +108,7 @@ export const ModelListRow = memo(function ModelListRow(props: { ) : null} - {[displayName, props.subProvider].filter(Boolean).join(" · ")} + {identity} diff --git a/apps/web/src/components/chat/ProviderModelPicker.browser.test.tsx b/apps/web/src/components/chat/ProviderModelPicker.browser.test.tsx index d4e27479bd58..4690b2b32542 100644 --- a/apps/web/src/components/chat/ProviderModelPicker.browser.test.tsx +++ b/apps/web/src/components/chat/ProviderModelPicker.browser.test.tsx @@ -14,6 +14,7 @@ import "~/index.css"; import { render } from "../../../test/render"; import { __setClientSettingsForTests } from "../../hooks/useSettings"; import { deriveProviderInstanceEntries } from "../../providerInstances"; +import { ComposerEffortColumn } from "./ComposerModelEffort"; import { ProviderModelPicker } from "./ProviderModelPicker"; it("keeps each registry image when adding a model from another ACP agent", async () => { @@ -177,7 +178,7 @@ it("keeps a docked picker open after a pick and hands focus to that model's effo await expect.element(search).not.toBeInTheDocument(); }); -it("names a row in full on hover when only its sub-provider is cut off", async () => { +it("names a row and the docked header in full on hover", async () => { const instanceId = ProviderInstanceId.make("opencode-zen"); const entries = deriveProviderInstanceEntries([ { @@ -201,7 +202,7 @@ it("names a row in full on hover when only its sub-provider is cut off", async ( instanceId, [ { slug: "glm-5.3", name: "GLM-5.3", subProvider: longSubProvider }, - { slug: "kimi", name: "Kimi", subProvider: "Pi" }, + { slug: "kimi-k2-0905", name: "Kimi K2 0905", shortName: "Kimi K2", subProvider: "Pi" }, ], ], ]); @@ -210,25 +211,33 @@ it("names a row in full on hover when only its sub-provider is cut off", async ( {}} + effortColumn={} />, ); await screen.getByRole("button", { name: "Choose model" }).click(); const option = page.getByRole("option", { name: /GLM-5\.3/ }); await expect.element(option).toBeVisible(); - // Only the sub-provider is clipped here, and main named only a clipped model name. await userEvent.hover(option.getByText(longSubProvider)); await vi.waitFor(() => expect(document.querySelector('[data-slot="tooltip-popup"]')?.textContent).toBe( - `GLM-5.3 · ${longSubProvider}`, + `GLM-5.3 · ${longSubProvider} · OpenCode Zen · glm-5.3`, ), ); + + // The header shows the short name; its hover names the full model and slug. + await userEvent.hover(page.getByText("Kimi K2", { exact: true }).last()); + await vi.waitFor(() => + expect( + [...document.querySelectorAll('[data-slot="tooltip-popup"]')].map((el) => el.textContent), + ).toContain("Kimi K2 0905 · kimi-k2-0905"), + ); }); it("lists a model reported twice by one provider once, with contiguous jump shortcuts", async () => { diff --git a/apps/web/src/components/chat/ProviderModelPicker.tsx b/apps/web/src/components/chat/ProviderModelPicker.tsx index 254b1ffeac93..8a8b8dd29687 100644 --- a/apps/web/src/components/chat/ProviderModelPicker.tsx +++ b/apps/web/src/components/chat/ProviderModelPicker.tsx @@ -86,7 +86,10 @@ function lockBackgroundScroll(popup: HTMLElement | null) { } /** What a docked effort column needs from its picker: the model it serves. */ -export const DockedPickerContext = createContext<{ modelLabel: string }>({ modelLabel: "" }); +export const DockedPickerContext = createContext<{ modelLabel: string; modelTitle: string }>({ + modelLabel: "", + modelTitle: "", +}); export const ProviderModelPicker = memo(function ProviderModelPicker(props: { environmentId: EnvironmentId | null; @@ -182,6 +185,7 @@ export const ProviderModelPicker = memo(function ProviderModelPicker(props: { const triggerLabel = selectedModel ? withUnavailable(getDisplayModelName(selectedModel), selectedModel.isUnavailable) : triggerTitle; + const modelTitle = selectedModel ? `${triggerLabel} · ${selectedModel.slug}` : triggerTitle; const showInstanceBadge = activeEntry !== null && shouldShowInstanceBadge(activeEntry, props.instanceEntries); @@ -470,7 +474,7 @@ export const ProviderModelPicker = memo(function ProviderModelPicker(props: { touchBackdrop > {props.effortColumn ? ( - +
{/* One fixed height, so a model with more options never resizes the popup. Short windows shrink it and keep the footer. */} From c1972319b67081241884be97a19e9c968da52540 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Thu, 19 Nov 2026 04:40:56 +0000 Subject: [PATCH 5/5] fix(web): disabled model picker rows still name the model on hover The reason tooltip on a disabled row now carries the same identity line (name, sub-provider, provider instance, slug) as an enabled row's hover, so a clipped disabled model name stays readable. Co-Authored-By: Claude Opus 5.5 --- apps/web/src/components/chat/ModelListRow.tsx | 5 +++-- .../chat/ProviderModelPicker.browser.test.tsx | 16 +++++++++++++--- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/apps/web/src/components/chat/ModelListRow.tsx b/apps/web/src/components/chat/ModelListRow.tsx index 0c8a7e8b38e0..a69e16051269 100644 --- a/apps/web/src/components/chat/ModelListRow.tsx +++ b/apps/web/src/components/chat/ModelListRow.tsx @@ -75,7 +75,7 @@ export const ModelListRow = memo(function ModelListRow(props: { badgeClassName="right-[-0.125rem] bottom-[-0.125rem] h-3 min-w-3 px-0.5 text-5xs" /> - {props.disabledReason} +
{props.disabledReason}
+
{identity}
); diff --git a/apps/web/src/components/chat/ProviderModelPicker.browser.test.tsx b/apps/web/src/components/chat/ProviderModelPicker.browser.test.tsx index 4690b2b32542..fd0d4441c2a4 100644 --- a/apps/web/src/components/chat/ProviderModelPicker.browser.test.tsx +++ b/apps/web/src/components/chat/ProviderModelPicker.browser.test.tsx @@ -203,6 +203,7 @@ it("names a row and the docked header in full on hover", async () => { [ { slug: "glm-5.3", name: "GLM-5.3", subProvider: longSubProvider }, { slug: "kimi-k2-0905", name: "Kimi K2 0905", shortName: "Kimi K2", subProvider: "Pi" }, + { slug: "qwen-max", name: "Qwen Max" }, ], ], ]); @@ -217,18 +218,27 @@ it("names a row and the docked header in full on hover", async () => { modelOptionsByInstance={options} triggerAriaLabel="Choose model" onInstanceModelChange={() => {}} + getModelDisabledReason={(_, model) => (model === "qwen-max" ? "Not here." : null)} effortColumn={} />, ); await screen.getByRole("button", { name: "Choose model" }).click(); + // A disabled row's reason tooltip still names the model. + await userEvent.hover(page.getByRole("option", { name: /Qwen Max/ })); + await vi.waitFor(() => + expect(document.querySelector('[data-slot="tooltip-popup"]')?.textContent).toBe( + "Not here.Qwen Max · OpenCode Zen · qwen-max", + ), + ); + const option = page.getByRole("option", { name: /GLM-5\.3/ }); await expect.element(option).toBeVisible(); await userEvent.hover(option.getByText(longSubProvider)); await vi.waitFor(() => - expect(document.querySelector('[data-slot="tooltip-popup"]')?.textContent).toBe( - `GLM-5.3 · ${longSubProvider} · OpenCode Zen · glm-5.3`, - ), + expect( + [...document.querySelectorAll('[data-slot="tooltip-popup"]')].map((el) => el.textContent), + ).toContain(`GLM-5.3 · ${longSubProvider} · OpenCode Zen · glm-5.3`), ); // The header shows the short name; its hover names the full model and slug.