diff --git a/apps/web/src/components/settings/SettingsPanels.tsx b/apps/web/src/components/settings/SettingsPanels.tsx index bee57d21b2531722e0988b2227de6bdc6cf15f4a..13c525a3d88eaeddeb845bbad6b59e2f4ae7ba72 100644 --- a/apps/web/src/components/settings/SettingsPanels.tsx +++ b/apps/web/src/components/settings/SettingsPanels.tsx @@ -428,6 +428,7 @@ function AboutVersionSection() { return ( <> } description={description} control={ @@ -450,7 +451,7 @@ function AboutVersionSection() { /> {hasDesktopBridge ? ( ) : selectedHostedAppChannel ? ( } description="Current version of the application." /> diff --git a/apps/web/src/components/settings/settingsSearch.test.ts b/apps/web/src/components/settings/settingsSearch.test.ts index 17bc6407d14b3aeaeac2f3d35799cfbae02c6a90..2fd5707164b3cf43825ef3ce28f079e1aa665328 100644 --- a/apps/web/src/components/settings/settingsSearch.test.ts +++ b/apps/web/src/components/settings/settingsSearch.test.ts @@ -128,6 +128,16 @@ describe("searchSettings", () => { expect(SETTINGS_SEARCH_ITEMS.some((item) => item.id === "quit-confirmation")).toBe(true); expect(searchSettings("hold to quit")).toEqual([]); expect(searchSettings("wsl")).toEqual([]); + expect(searchSettings("update track")).toEqual([]); + }); + + it("finds the About update rows", () => { + expect(searchSettings("check for updates").map((item) => item.id)).toContain("app-version"); + expect(SETTINGS_SEARCH_ITEMS.find((item) => item.id === "update-track")).toMatchObject({ + title: "Update track", + to: "/settings/general", + releaseChannelOnly: true, + }); }); it("hides macOS-only settings on other platforms", () => { diff --git a/apps/web/src/components/settings/settingsSearch.ts b/apps/web/src/components/settings/settingsSearch.ts index aff52adeb1550f6e7732effb0ee95be84bcd2551..c23eeb8fdf061f4d764fd903e12d9e5fe6122fcc 100644 --- a/apps/web/src/components/settings/settingsSearch.ts +++ b/apps/web/src/components/settings/settingsSearch.ts @@ -1,3 +1,4 @@ +import { HOSTED_APP_CHANNEL } from "~/branding"; import { isElectron } from "~/env"; import { isMacPlatform, isWindowsPlatform, normalizeSearchText } from "~/lib/utils"; import { STATIC_KEYBINDING_COMMANDS, type KeybindingCommand } from "@t3tools/contracts"; @@ -53,6 +54,9 @@ export interface SettingsSearchItem { // Its row only renders on Windows desktop, so other desktop platforms must // not expose a result that points to a missing anchor. readonly windowsOnly?: boolean; + // Its row renders only where the release channel can change: the desktop + // app, or a hosted web build deployed with a channel. + readonly releaseChannelOnly?: boolean; readonly cloudOnly?: boolean; readonly environmentOnly?: boolean; readonly providerSettingsOnly?: boolean; @@ -520,6 +524,19 @@ export const SETTINGS_SEARCH_ITEMS = [ scope: "project-defaults", searchTerms: ["generated thread titles source control content default provider"], }, + { + id: "app-version", + title: "Version", + to: "/settings/general", + searchTerms: ["about check for updates download install upgrade release"], + }, + { + id: "update-track", + title: "Update track", + to: "/settings/general", + searchTerms: ["release channel stable latest nightly prerelease"], + releaseChannelOnly: true, + }, { id: "cli-command", title: "t3 command", @@ -1094,6 +1111,7 @@ export function searchSettings( return items .flatMap((item, index) => { if (!isElectron && item.desktopOnly === true) return []; + if (item.releaseChannelOnly && !isElectron && HOSTED_APP_CHANNEL === null) return []; if (item.macOnly && !isMacPlatform(platform)) return []; if (item.windowsOnly && !isWindowsPlatform(platform)) return [];