| author | |
| committer | |
| log | 472ea7ec5f67fae660dc606b82698d15a2bc850f |
| tree | d53d80b4e0932812beedce09fb154ee09dbef509 |
| parent | e1ad595e0f10cc16d66fe54b4ee195435dd3cc0d |
| signature | Signed by PGP key B5690EEEBB952194 |
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() { |
| 428 | 428 | return ( |
| 429 | 429 | <> |
| 430 | 430 | <SettingsRow |
| 431 | id={searchableSetting("app-version").id} | |
| 431 | 432 | title={<AboutVersionTitle />} |
| 432 | 433 | description={description} |
| 433 | 434 | control={ |
| ... | ... | @@ -450,7 +451,7 @@ function AboutVersionSection() { |
| 450 | 451 | /> |
| 451 | 452 | {hasDesktopBridge ? ( |
| 452 | 453 | <SettingsRow |
| 453 | title="Update track" | |
| 454 | {...searchableSetting("update-track")} | |
| 454 | 455 | description="Use stable releases or nightly builds. Switch back anytime." |
| 455 | 456 | control={ |
| 456 | 457 | <Select |
| ... | ... | @@ -482,7 +483,7 @@ function AboutVersionSection() { |
| 482 | 483 | /> |
| 483 | 484 | ) : selectedHostedAppChannel ? ( |
| 484 | 485 | <SettingsRow |
| 485 | title="Update track" | |
| 486 | {...searchableSetting("update-track")} | |
| 486 | 487 | description="Switches the hosted app release channel." |
| 487 | 488 | control={ |
| 488 | 489 | <Select |
| ... | ... | @@ -3345,6 +3346,7 @@ export function GeneralSettingsPanel() { |
| 3345 | 3346 | ) : ( |
| 3346 | 3347 | <> |
| 3347 | 3348 | <SettingsRow |
| 3349 | id={searchableSetting("app-version").id} | |
| 3348 | 3350 | title={<AboutVersionTitle />} |
| 3349 | 3351 | description="Current version of the application." |
| 3350 | 3352 | /> |
apps/web/src/components/settings/settingsSearch.test.ts+10| ... | ... | @@ -128,6 +128,16 @@ describe("searchSettings", () => { |
| 128 | 128 | expect(SETTINGS_SEARCH_ITEMS.some((item) => item.id === "quit-confirmation")).toBe(true); |
| 129 | 129 | expect(searchSettings("hold to quit")).toEqual([]); |
| 130 | 130 | 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 | }); | |
| 131 | 141 | }); |
| 132 | 142 | |
| 133 | 143 | it("hides macOS-only settings on other platforms", () => { |
apps/web/src/components/settings/settingsSearch.ts+18| ... | ... | @@ -1,3 +1,4 @@ |
| 1 | import { HOSTED_APP_CHANNEL } from "~/branding"; | |
| 1 | 2 | import { isElectron } from "~/env"; |
| 2 | 3 | import { isMacPlatform, isWindowsPlatform, normalizeSearchText } from "~/lib/utils"; |
| 3 | 4 | import { STATIC_KEYBINDING_COMMANDS, type KeybindingCommand } from "@t3tools/contracts"; |
| ... | ... | @@ -53,6 +54,9 @@ export interface SettingsSearchItem { |
| 53 | 54 | // Its row only renders on Windows desktop, so other desktop platforms must |
| 54 | 55 | // not expose a result that points to a missing anchor. |
| 55 | 56 | 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; | |
| 56 | 60 | readonly cloudOnly?: boolean; |
| 57 | 61 | readonly environmentOnly?: boolean; |
| 58 | 62 | readonly providerSettingsOnly?: boolean; |
| ... | ... | @@ -520,6 +524,19 @@ export const SETTINGS_SEARCH_ITEMS = [ |
| 520 | 524 | scope: "project-defaults", |
| 521 | 525 | searchTerms: ["generated thread titles source control content default provider"], |
| 522 | 526 | }, |
| 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 | }, | |
| 523 | 540 | { |
| 524 | 541 | id: "cli-command", |
| 525 | 542 | title: "t3 command", |
| ... | ... | @@ -1094,6 +1111,7 @@ export function searchSettings( |
| 1094 | 1111 | return items |
| 1095 | 1112 | .flatMap((item, index) => { |
| 1096 | 1113 | if (!isElectron && item.desktopOnly === true) return []; |
| 1114 | if (item.releaseChannelOnly && !isElectron && HOSTED_APP_CHANNEL === null) return []; | |
| 1097 | 1115 | if (item.macOnly && !isMacPlatform(platform)) return []; |
| 1098 | 1116 | if (item.windowsOnly && !isWindowsPlatform(platform)) return []; |
| 1099 | 1117 |