The best way to control Claude Code, Codex and more from any computer or phone
fix(web): model picker stays open until dismissed, with a Show more row (#28076)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Theo Browne committed
Oct 31, 2026 at 03:05 UTC
2359643cffa6ba9ee84d6f2694b935de54a8013e
6 files changed
+42
-76
apps/web/src/components/ChatView.tsx
+3
-1
@@ -184,6 +184,7 @@ import { isEditableFocused } from "../lib/editableFocus";
184
import { DEFAULT_RESOLVED_KEYBINDINGS } from "@t3tools/shared/keybindings";
185
import { shortcutLabelForCommand } from "../keybindings";
186
import { cn } from "~/lib/utils";
187
+import { isModelPickerOpen } from "../modelPickerVisibility";
188
import { COLLAPSED_SIDEBAR_TITLEBAR_INSET_CLASS } from "~/workspaceTitlebar";
189
import { toastManager } from "./ui/toast";
190
import { projectScriptIdFromCommand } from "~/projectScripts";
@@ -1847,7 +1848,8 @@ export default function ChatView(props: ChatViewProps) {
1848
);
1849
const scheduleComposerFocus = () => {
1850
window.requestAnimationFrame(() => {
1850
- focusComposer();
1851
+ // The model picker stays open through its own changes, so it keeps focus.
1852
+ if (!isModelPickerOpen()) focusComposer();
1853
});
1854
};
1855
const scheduleComposerFocusStable = useStableCallback(scheduleComposerFocus);
apps/web/src/components/chat/ComposerControlsBar.tsx
+4
-5
@@ -35,9 +35,8 @@ import { resolveComposerControlsOwnership } from "./composerControlsOwnership";
35
* permissions), mode controls and the overflow menu for blocks that do not fit. Rendered in the
36
* expanded footer or the resting controls host.
37
*/
38
-// Model and effort share one trigger; hover and open states brighten its text, not a box.
39
-const TEXT_CONTROL_STATES =
40
- "hover:bg-transparent data-pressed:bg-transparent data-popup-open:bg-transparent data-pressed:text-foreground data-popup-open:text-foreground";
38
+// Model and effort share one trigger; it stays filled while its popup is open.
39
+const MODEL_TRIGGER_STATES = "data-popup-open:bg-accent data-popup-open:text-foreground";
40
41
export function ComposerControlsBar(props: {
42
environmentId: EnvironmentId;
@@ -217,8 +216,8 @@ export function ComposerControlsBar(props: {
216
modelOptionsByInstance={modelOptionsByInstance}
217
size={controlSize}
218
triggerClassName={cn(
220
- "group/model-trigger pe-1",
221
- TEXT_CONTROL_STATES,
219
+ "group/model-trigger",
220
+ MODEL_TRIGGER_STATES,
221
composerControlsCollapsed ? "min-w-13 shrink text-xs!" : "min-w-13",
222
)}
223
triggerSuffix={effort.suffix}
apps/web/src/components/chat/ComposerModelEffort.tsx
+5
-20
@@ -52,7 +52,7 @@ type ColumnControl =
52
53
/**
54
* The column lists the model's reasoning control first, under the header that names it, then
55
- * its other options. Picking a level of that control finishes the job and closes the popup.
55
+ * its other options.
56
*/
57
function columnControls(
58
provider: TraitsSelectionInput["provider"],
@@ -201,7 +201,7 @@ function moveBetweenRows(event: KeyboardEvent<HTMLElement>) {
201
next.scrollIntoView({ block: "nearest" });
202
}
203
204
-function EffortLevels(props: { traits: TraitsSelectionInput; onLevelPick: () => void }) {
204
+function EffortLevels(props: { traits: TraitsSelectionInput }) {
205
const traits = useTraitsSelection(props.traits);
206
const { effort, others } = columnControls(
207
props.traits.provider,
@@ -242,10 +242,7 @@ function EffortLevels(props: { traits: TraitsSelectionInput; onLevelPick: () =>
242
label={value ? "On" : "Off"}
243
selected={(control.descriptor.currentValue === true) === value}
244
level={isEffort}
245
- onPick={() => {
246
- traits.changeBoolean(descriptor.id, value);
247
- if (isEffort) props.onLevelPick();
248
- }}
245
+ onPick={() => traits.changeBoolean(descriptor.id, value)}
246
/>
247
))}
248
</div>
@@ -276,10 +273,7 @@ function EffortLevels(props: { traits: TraitsSelectionInput; onLevelPick: () =>
273
isDefault={option.isDefault}
274
disabled={locked}
275
level={isEffort}
279
- onPick={() => {
280
- traits.changeSelect(control.descriptor, option.id);
281
- if (isEffort) props.onLevelPick();
282
- }}
276
+ onPick={() => traits.changeSelect(control.descriptor, option.id)}
277
/>
278
))}
279
</div>
@@ -327,11 +321,7 @@ export function ComposerEffortColumn(props: { traits: TraitsSelectionInput | nul
321
className="flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto overscroll-contain px-2 pt-2.5 pb-1.5"
322
onKeyDown={moveBetweenRows}
323
>
330
- {props.traits ? (
331
- <EffortLevels traits={props.traits} onLevelPick={picker.close} />
332
- ) : (
333
- <NoEffortRow />
334
- )}
324
+ {props.traits ? <EffortLevels traits={props.traits} /> : <NoEffortRow />}
325
</div>
326
</>
327
);
@@ -415,17 +405,12 @@ function PermissionsMenu(props: {
405
options: ReadonlyArray<RuntimeModeOption>;
406
onChange: (mode: RuntimeMode) => void;
407
}) {
418
- const picker = use(DockedPickerContext);
408
const triggerRef = useRef<HTMLButtonElement>(null);
409
const current = props.options.find((option) => option.mode === props.runtimeMode);
410
if (!current) return null;
411
const CurrentIcon = current.icon;
412
return (
413
<Menu
425
- // Any pick, even the current mode, ends the job; a change also hands focus to the prompt.
426
- onOpenChange={(open, details) => {
427
- if (!open && details.reason === "item-press") picker.close();
428
- }}
414
onOpenChangeComplete={(open) => {
415
if (open) focusCheckedPermission(triggerRef.current);
416
}}
apps/web/src/components/chat/ModelPickerContent.tsx
+6
-20
@@ -21,7 +21,6 @@ import {
21
type ReactNode,
22
type RefObject,
23
} from "react";
24
-import { ArchiveIcon, ChevronRightIcon } from "lucide-react";
24
import { ModelListRow } from "./ModelListRow";
25
import { ModelPickerSidebar } from "./ModelPickerSidebar";
26
import { getProviderStatusMessage, hasProviderSetup } from "./ProviderStatusBanner";
@@ -748,11 +747,8 @@ export const ModelPickerContent = memo(function ModelPickerContent(props: {
747
const modelKeys = visibleModels.map((model) =>
748
modelPickerModelKey(model.instanceId, model.slug),
749
);
751
- if (!legacySection) {
752
- return modelKeys;
753
- }
754
- modelKeys.splice(legacySection.currentModels.length, 0, legacySection.key);
755
- return modelKeys;
750
+ // The toggle trails the list, so expanding it reveals older models above it.
751
+ return legacySection ? [...modelKeys, legacySection.key] : modelKeys;
752
})();
753
const filteredModelByKey = ((): ReadonlyMap<string, ModelPickerItem> =>
754
new Map(
@@ -843,7 +839,7 @@ export const ModelPickerContent = memo(function ModelPickerContent(props: {
839
className={cn(
840
"relative flex w-screen max-w-90 flex-row overflow-hidden",
841
props.docked
846
- ? "h-full max-sm:h-56 max-sm:min-h-0! max-sm:w-full max-sm:max-w-none"
842
+ ? "max-sm:h-56 max-sm:min-h-0! max-sm:w-full max-sm:max-w-none"
843
: "max-h-86.5",
844
)}
845
style={
@@ -1023,19 +1019,9 @@ export const ModelPickerContent = memo(function ModelPickerContent(props: {
1019
aria-expanded={legacySection.isExpanded}
1020
className="group w-full cursor-pointer"
1021
>
1026
- <ArchiveIcon aria-hidden="true" className="size-4 opacity-70" />
1027
- <div className="flex min-w-0 flex-1 items-center gap-2 text-left">
1028
- <div className="text-sm font-normal leading-snug">Legacy models</div>
1029
- <div className="text-xs font-normal leading-snug text-muted-foreground/70">
1030
- {legacySection.legacyModels.length}
1031
- </div>
1032
- </div>
1033
- <ChevronRightIcon
1034
- className={cn(
1035
- "size-4 transition-transform",
1036
- legacySection.isExpanded && "rotate-90",
1037
- )}
1038
- />
1022
+ <span className="text-sm leading-snug text-muted-foreground group-hover:text-foreground group-data-highlighted:text-foreground">
1023
+ {legacySection.isExpanded ? "Show less" : "Show more"}
1024
+ </span>
1025
</ComboboxItem>
1026
);
1027
}
apps/web/src/components/chat/ProviderModelPicker.browser.test.tsx
+3
@@ -164,5 +164,8 @@ it("keeps a docked picker open after a pick and hands focus to that model's effo
164
await expect.element(page.getByRole("radio", { name: "Medium" })).toHaveFocus();
165
166
await page.getByRole("option", { name: /Plain model/ }).click();
167
+ await page.getByRole("option", { name: /Second model/ }).click();
168
+ await expect.element(page.getByRole("radio", { name: "Medium" })).toHaveFocus();
169
+ await userEvent.keyboard("{Escape}");
170
await expect.element(search).not.toBeInTheDocument();
171
});
apps/web/src/components/chat/ProviderModelPicker.tsx
+21
-30
@@ -68,11 +68,8 @@ function lockBackgroundScroll(popup: HTMLElement | null) {
68
};
69
}
70
71
-/** What a docked effort column needs from its picker: the model it serves, and a way to close. */
72
-export const DockedPickerContext = createContext<{ modelLabel: string; close: () => void }>({
73
- modelLabel: "",
74
- close: () => {},
75
-});
71
+/** What a docked effort column needs from its picker: the model it serves. */
72
+export const DockedPickerContext = createContext<{ modelLabel: string }>({ modelLabel: "" });
73
74
export const ProviderModelPicker = memo(function ProviderModelPicker(props: {
75
environmentId: EnvironmentId | null;
@@ -107,8 +104,8 @@ export const ProviderModelPicker = memo(function ProviderModelPicker(props: {
104
/** Composer shortcuts this trigger answers besides the picker's own. */
105
triggerShortcuts?: string;
106
/**
110
- * Docks an effort column beside the list and a footer under both. Picking a model then keeps
111
- * the popup open and moves focus to the new model's levels.
107
+ * Docks an effort column beside the list and a footer under both. The popup then stays open
108
+ * until Escape or an outside press, and picking a model moves focus to its levels.
109
*/
110
effortColumn?: ReactNode;
111
footer?: ReactNode;
@@ -185,13 +182,8 @@ export const ProviderModelPicker = memo(function ProviderModelPicker(props: {
182
setIsMenuOpen(false);
183
return;
184
}
188
- // The column renders the new model's levels on commit; a model with none closes the popup.
189
- // Levels an Ultrathink prompt locks still count, so the note explaining them stays visible.
190
- window.requestAnimationFrame(() => {
191
- const hasLevels = popupRef.current?.querySelector("[data-effort-level]") != null;
192
- if (hasLevels) focusEffort("levels");
193
- else setIsMenuOpen(false);
194
- });
185
+ // The column renders the new model's levels on commit.
186
+ window.requestAnimationFrame(() => focusEffort("levels"));
187
};
188
189
const shortcutLabel = props.keybindings
@@ -235,6 +227,12 @@ export const ProviderModelPicker = memo(function ProviderModelPicker(props: {
227
.filter(Boolean)
228
.join(" · ");
229
230
+ const triggerText = props.triggerLabel ?? multipleLabel ?? triggerTitle;
231
+ const triggerTextProps = {
232
+ className: "min-w-0 flex-1 overflow-hidden truncate",
233
+ "data-chat-provider-model-picker-label": "true",
234
+ } as const;
235
+
236
const picker = (
237
<ModelPickerContent
238
searchInputRef={searchInputRef}
@@ -367,19 +365,14 @@ export const ProviderModelPicker = memo(function ProviderModelPicker(props: {
365
/>
366
</span>
367
) : null}
370
- <Tooltip>
371
- <TooltipTrigger
372
- render={
373
- <span
374
- className="min-w-0 flex-1 overflow-hidden truncate"
375
- data-chat-provider-model-picker-label="true"
376
- />
377
- }
378
- >
379
- {props.triggerLabel ?? multipleLabel ?? triggerTitle}
380
- </TooltipTrigger>
381
- <TooltipPopup side="top">{triggerTooltipContent}</TooltipPopup>
382
- </Tooltip>
368
+ {props.isComposerOwned ? (
369
+ <span {...triggerTextProps}>{triggerText}</span>
370
+ ) : (
371
+ <Tooltip>
372
+ <TooltipTrigger render={<span {...triggerTextProps} />}>{triggerText}</TooltipTrigger>
373
+ <TooltipPopup side="top">{triggerTooltipContent}</TooltipPopup>
374
+ </Tooltip>
375
+ )}
376
{props.triggerSuffix}
377
{selectedModel?.isUnavailable && !selectedEntries && props.triggerLabel === undefined ? (
378
<Badge variant="outline" size="sm">
@@ -405,9 +398,7 @@ export const ProviderModelPicker = memo(function ProviderModelPicker(props: {
398
touchBackdrop
399
>
400
{props.effortColumn ? (
408
- <DockedPickerContext
409
- value={{ modelLabel: triggerTitle, close: () => setIsMenuOpen(false) }}
410
- >
401
+ <DockedPickerContext value={{ modelLabel: triggerTitle }}>
402
<div className="flex flex-col">
403
<div className="flex max-h-86.5 max-sm:max-h-none max-sm:flex-col">
404
{picker}