The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 22, 08:15 UTC
fix(web): find the fallback model in Settings search (#27376)
Lakshmi Tanmay committed
Nov 1, 2026 at 08:07 UTC
cae3ced9fbe3b5f304c9264539b0889009b75469
5 files changed
+74
-3
apps/web/src/components/settings/ProjectDefaultsSettings.tsx
+1
-2
@@ -229,8 +229,7 @@ export function ProjectDefaultsSettings({ category }: { category: ProjectSetting
229
serverScoped
230
settingKeys={["fallbackModelSelection"]}
231
mixed={mixedFallback}
232
- id="fallback-model"
233
- title="Fallback model"
232
+ {...searchableSetting("fallback-model")}
233
description="Used for new threads when the default model's provider is out of usage."
234
resetAction={
235
mixedFallback || settings.fallbackModelSelection !== null ? (
apps/web/src/components/settings/ProjectSettingsPanel.browser.test.tsx
+43
@@ -138,6 +138,7 @@ import { buildSidebarProjectSnapshots } from "../../sidebarProjectGrouping";
138
import { ProjectSettingsPanel } from "./ProjectSettingsPanel";
139
import { ProjectsSettings } from "./ProjectsSettings";
140
import { SettingsScopeProvider } from "./SettingsScopeContext";
141
+import { SettingsScopeNotice } from "./SettingsScopeNotice";
142
import { validateSettingsScopeSearch, type SettingsScopeSearch } from "./settingsScope";
143
import { retainSettingsScope, validateSettingsRouteSearch } from "./settingsScopeNavigation";
144
@@ -533,6 +534,48 @@ describe("project identity reset", () => {
534
});
535
});
536
537
+it("opens the fallback search target across all environments from a checkout", async () => {
538
+ setup();
539
+ const root = createRootRoute();
540
+ const settings = createRoute({
541
+ getParentRoute: () => root,
542
+ path: "settings",
543
+ validateSearch: validateSettingsRouteSearch,
544
+ search: { middlewares: [retainSettingsScope] },
545
+ });
546
+ const threads = createRoute({
547
+ getParentRoute: () => settings,
548
+ path: "threads",
549
+ component: () => (
550
+ <SettingsScopeProvider search={settings.useSearch()} onChange={() => {}}>
551
+ <SettingsScopeNotice target="all" targetId="fallback-model">
552
+ Choose all environments to edit the fallback model.
553
+ </SettingsScopeNotice>
554
+ </SettingsScopeProvider>
555
+ ),
556
+ });
557
+ const query = new URLSearchParams({
558
+ project: projectKey(),
559
+ machine: primaryId,
560
+ checkout: "primary:/work/primary",
561
+ });
562
+ const router = createRouter({
563
+ routeTree: root.addChildren([settings.addChildren([threads])]),
564
+ history: createMemoryHistory({ initialEntries: [`/settings/threads?${query}#fallback-model`] }),
565
+ });
566
+ await router.load();
567
+ // This route needs the real scope-retention middleware used by settings search.
568
+ await using _screen = await render(
569
+ <RegistryContext.Provider value={appAtomRegistry}>
570
+ <RouterProvider router={router} />
571
+ </RegistryContext.Provider>,
572
+ { router: false },
573
+ );
574
+ await userEvent.click(page.getByRole("button", { name: "Open all environments" }));
575
+ await vi.waitFor(() => expect(router.state.location.search).toEqual({}));
576
+ expect(router.state.location.hash).toBe("fallback-model");
577
+});
578
+
579
describe("project settings scope", () => {
580
const environmentMenu = () => page.getByRole("button", { name: /^Environment scope:/ });
581
const primaryOption = () => page.getByRole("menuitemradio", { name: /^primary/ });
apps/web/src/components/settings/SettingsScopeNotice.tsx
+10
-1
@@ -129,7 +129,16 @@ export function SettingsScopeNotice({
129
)}
130
onClick={() => {
131
if (targetId)
132
- void navigate({ to: pathname, search: () => choice.search, hash: targetId });
132
+ void navigate({
133
+ to: pathname,
134
+ search: () => ({
135
+ project: undefined,
136
+ machine: undefined,
137
+ checkout: undefined,
138
+ ...choice.search,
139
+ }),
140
+ hash: targetId,
141
+ });
142
else selectScope(choice.search);
143
}}
144
>
apps/web/src/components/settings/settingsSearch.test.ts
+12
@@ -64,6 +64,13 @@ describe("searchSettings", () => {
64
expect(searchSettings("sharing", ITEMS).map((item) => item.id)).toEqual(["network-access"]);
65
expect(searchSettings("claude", ITEMS).map((item) => item.id)).toEqual(["providers"]);
66
expect(searchSettings("long lines", ITEMS).map((item) => item.id)).toEqual(["word-wrap"]);
67
+ for (const query of ["fallback", "fallback agent", "fallback model"]) {
68
+ expect(searchSettings(query)[0]).toMatchObject({
69
+ id: "fallback-model",
70
+ to: "/settings/threads",
71
+ scope: "environment-defaults",
72
+ });
73
+ }
74
});
75
76
it("hides the Secrets page from nav and search while the secrets feature is disabled", () => {
@@ -205,6 +212,11 @@ describe("settings search targets", () => {
212
expect(isSettingsSearchScopeAvailable(updates.scope, "environment")).toBe(true);
213
expect(isSettingsSearchScopeAvailable(updates.scope, "all")).toBe(true);
214
expect(isSettingsSearchScopeAvailable(updates.scope, "project")).toBe(false);
215
+ const fallback = getSettingsSearchTargetScope("fallback-model")!;
216
+ expect(fallback.scope).toBe("environment-defaults");
217
+ expect(isSettingsSearchScopeAvailable(fallback.scope, "environment")).toBe(true);
218
+ expect(isSettingsSearchScopeAvailable(fallback.scope, "all")).toBe(true);
219
+ expect(isSettingsSearchScopeAvailable(fallback.scope, "project")).toBe(false);
220
const streaming = getSettingsSearchTargetScope("response-streaming")!;
221
expect(streaming.scope).toBe("project-defaults");
222
expect(isSettingsSearchScopeAvailable(streaming.scope, "project")).toBe(true);
apps/web/src/components/settings/settingsSearch.ts
+8
@@ -276,6 +276,14 @@ export const SETTINGS_SEARCH_ITEMS = [
276
scope: "project-defaults",
277
searchTerms: ["new thread project provider reasoning effort"],
278
},
279
+ {
280
+ id: "fallback-model",
281
+ title: "Fallback model",
282
+ to: "/settings/threads",
283
+ scope: "environment-defaults",
284
+ searchTerms: ["fallback agent provider out of usage new threads"],
285
+ environmentOnly: true,
286
+ },
287
{
288
id: "default-permissions",
289
title: "Permissions",