authorgravatar for s@serg.techSergiy Dybskiy <s@serg.tech> 2026-10-10 07:27:33-04:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-10-10 06:27:33-05:00
log472ea7ec5f67fae660dc606b82698d15a2bc850f
treed53d80b4e0932812beedce09fb154ee09dbef509
parente1ad595e0f10cc16d66fe54b4ee195435dd3cc0d
signature Signed by PGP key B5690EEEBB952194

fix(web): find update settings from the command palette (#17396)

Co-authored-by: Claude <claude@anthropic.com>

3 files changed, 32 insertions(+), 2 deletions(-)

apps/web/src/components/settings/SettingsPanels.tsx+4-2
......@@ -428,6 +428,7 @@ function AboutVersionSection() {
428428 return (
429429 <>
430430 <SettingsRow
431 id={searchableSetting("app-version").id}
431432 title={<AboutVersionTitle />}
432433 description={description}
433434 control={
......@@ -450,7 +451,7 @@ function AboutVersionSection() {
450451 />
451452 {hasDesktopBridge ? (
452453 <SettingsRow
453 title="Update track"
454 {...searchableSetting("update-track")}
454455 description="Use stable releases or nightly builds. Switch back anytime."
455456 control={
456457 <Select
......@@ -482,7 +483,7 @@ function AboutVersionSection() {
482483 />
483484 ) : selectedHostedAppChannel ? (
484485 <SettingsRow
485 title="Update track"
486 {...searchableSetting("update-track")}
486487 description="Switches the hosted app release channel."
487488 control={
488489 <Select
......@@ -3345,6 +3346,7 @@ export function GeneralSettingsPanel() {
33453346 ) : (
33463347 <>
33473348 <SettingsRow
3349 id={searchableSetting("app-version").id}
33483350 title={<AboutVersionTitle />}
33493351 description="Current version of the application."
33503352 />
apps/web/src/components/settings/settingsSearch.test.ts+10
......@@ -128,6 +128,16 @@ describe("searchSettings", () => {
128128 expect(SETTINGS_SEARCH_ITEMS.some((item) => item.id === "quit-confirmation")).toBe(true);
129129 expect(searchSettings("hold to quit")).toEqual([]);
130130 expect(searchSettings("wsl")).toEqual([]);
131 expect(searchSettings("update track")).toEqual([]);
132 });
133
134 it("finds the About update rows", () => {
135 expect(searchSettings("check for updates").map((item) => item.id)).toContain("app-version");
136 expect(SETTINGS_SEARCH_ITEMS.find((item) => item.id === "update-track")).toMatchObject({
137 title: "Update track",
138 to: "/settings/general",
139 releaseChannelOnly: true,
140 });
131141 });
132142
133143 it("hides macOS-only settings on other platforms", () => {
apps/web/src/components/settings/settingsSearch.ts+18
......@@ -1,3 +1,4 @@
1import { HOSTED_APP_CHANNEL } from "~/branding";
12import { isElectron } from "~/env";
23import { isMacPlatform, isWindowsPlatform, normalizeSearchText } from "~/lib/utils";
34import { STATIC_KEYBINDING_COMMANDS, type KeybindingCommand } from "@t3tools/contracts";
......@@ -53,6 +54,9 @@ export interface SettingsSearchItem {
5354 // Its row only renders on Windows desktop, so other desktop platforms must
5455 // not expose a result that points to a missing anchor.
5556 readonly windowsOnly?: boolean;
57 // Its row renders only where the release channel can change: the desktop
58 // app, or a hosted web build deployed with a channel.
59 readonly releaseChannelOnly?: boolean;
5660 readonly cloudOnly?: boolean;
5761 readonly environmentOnly?: boolean;
5862 readonly providerSettingsOnly?: boolean;
......@@ -520,6 +524,19 @@ export const SETTINGS_SEARCH_ITEMS = [
520524 scope: "project-defaults",
521525 searchTerms: ["generated thread titles source control content default provider"],
522526 },
527 {
528 id: "app-version",
529 title: "Version",
530 to: "/settings/general",
531 searchTerms: ["about check for updates download install upgrade release"],
532 },
533 {
534 id: "update-track",
535 title: "Update track",
536 to: "/settings/general",
537 searchTerms: ["release channel stable latest nightly prerelease"],
538 releaseChannelOnly: true,
539 },
523540 {
524541 id: "cli-command",
525542 title: "t3 command",
......@@ -1094,6 +1111,7 @@ export function searchSettings(
10941111 return items
10951112 .flatMap((item, index) => {
10961113 if (!isElectron && item.desktopOnly === true) return [];
1114 if (item.releaseChannelOnly && !isElectron && HOSTED_APP_CHANNEL === null) return [];
10971115 if (item.macOnly && !isMacPlatform(platform)) return [];
10981116 if (item.windowsOnly && !isWindowsPlatform(platform)) return [];
10991117