fix(settings): index later-added settings in search catalog (Fixes #4230) (#4232)

* fix(settings): index later-added settings in search catalog

Fixes #4230

Follow-up after #4231. Settings search still missed later-added
rows such as Appearance "Code font" (代码字体) and System session
log "Add timestamps" (时间戳), which already rendered in their
tabs. Index those destinations and other visible setting rows
that had the same catalog/anchor omission.

* fix(settings): fall back to visible parent when search target is gated
This commit is contained in:
陈大猫 authored and GitHub committed 2026-11-14 21:30:27 +08:00
1 parent cf7f998689
commit 1d5cef09ec
14 files changed
+710 -22

No files matched your search

+1
View File
@@ -409,6 +409,7 @@ const SettingsPageContent: React.FC<{ settings: SettingsState; appLock?: AppLock
const nestedDelayMs = (request.aiSubTab || request.syncSubTab) ? 80 : 40;
const focusHandle = window.setTimeout(() => {
void focusSettingsAnchor(request.anchorId, {
fallbackAnchorId: request.fallbackAnchorId,
attempts: 48,
delayMs: 50,
}).finally(() => {
@@ -93,6 +93,7 @@ export function SettingsSearchControl({
aiSubTab: hit.entry.aiSubTab,
syncSubTab: hit.entry.syncSubTab,
anchorId: hit.entry.id,
fallbackAnchorId: hit.entry.fallbackAnchorId,
});
collapseSearch(false);
};
+97 -1
View File
@@ -1,6 +1,102 @@
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import test from "node:test";
import test, { type TestContext } from "node:test";
import { settingsAnchorDomId } from "../../domain/settingsSearchCatalog.ts";
import { focusSettingsAnchor } from "./settingsFocus.ts";
function setupFocusDom(t: TestContext) {
t.mock.timers.enable({ apis: ["setTimeout"] });
const anchors = new Map<string, HTMLElement>();
const focused: string[] = [];
const scrolled: string[] = [];
const globals = {
document: {
getElementById: (id: string) => anchors.get(id) ?? null,
querySelectorAll: () => [],
documentElement: {},
body: {},
},
window: { setTimeout, clearTimeout },
CSS: { escape: (value: string) => value },
requestAnimationFrame: (callback: FrameRequestCallback) => { callback(0); return 0; },
};
for (const [key, value] of Object.entries(globals)) {
const previous = Object.getOwnPropertyDescriptor(globalThis, key);
Object.defineProperty(globalThis, key, { configurable: true, value });
t.after(() => {
if (previous) Object.defineProperty(globalThis, key, previous);
else Reflect.deleteProperty(globalThis, key);
});
}
const mount = (id: string, visible = true) => {
const classes = new Set<string>();
const el = {
closest: () => null,
checkVisibility: () => visible,
classList: { add: (name: string) => classes.add(name), remove: (name: string) => classes.delete(name) },
matches: () => true,
hasAttribute: () => true,
focus: () => focused.push(id),
scrollIntoView: () => scrolled.push(id),
} as unknown as HTMLElement;
anchors.set(settingsAnchorDomId(id), el);
return classes;
};
return { mount, focused, scrolled };
}
test("missing search target focuses and highlights its visible parent after a short mount window", async (t) => {
const { mount, focused, scrolled } = setupFocusDom(t);
const parentClasses = mount("parent");
const result = focusSettingsAnchor("child", { fallbackAnchorId: "parent", attempts: 48, delayMs: 50 });
for (let retry = 0; retry < 3; retry += 1) t.mock.timers.tick(50);
t.mock.timers.tick(49);
assert.deepEqual(focused, []);
t.mock.timers.tick(1);
assert.equal(await result, true);
assert.deepEqual(focused, ["parent"]);
assert.deepEqual(scrolled, ["parent"]);
assert.ok(parentClasses.has("settings-search-highlight"));
});
test("search focus prefers a visible primary over its fallback", async (t) => {
const { mount, focused } = setupFocusDom(t);
const childClasses = mount("child");
const parentClasses = mount("parent");
assert.equal(await focusSettingsAnchor("child", { fallbackAnchorId: "parent" }), true);
assert.deepEqual(focused, ["child"]);
assert.ok(childClasses.has("settings-search-highlight"));
assert.equal(parentClasses.has("settings-search-highlight"), false);
});
test("search focus waits for a lazy primary before using a visible fallback", async (t) => {
const { mount, focused } = setupFocusDom(t);
mount("parent");
const result = focusSettingsAnchor("child", { fallbackAnchorId: "parent" });
t.mock.timers.tick(50);
t.mock.timers.tick(50);
mount("child");
t.mock.timers.tick(50);
assert.equal(await result, true);
assert.deepEqual(focused, ["child"]);
});
test("search focus skips a hidden primary and waits for a visible fallback", async (t) => {
const { mount, focused } = setupFocusDom(t);
mount("child", false);
mount("parent", false);
const result = focusSettingsAnchor("child", { fallbackAnchorId: "parent" });
for (let retry = 0; retry < 4; retry += 1) t.mock.timers.tick(50);
assert.deepEqual(focused, []);
mount("parent");
t.mock.timers.tick(50);
assert.equal(await result, true);
assert.deepEqual(focused, ["parent"]);
});
test("system setting hints sit below their cards with a shared top gap", () => {
const uiSource = readFileSync(new URL("./settings-ui.tsx", import.meta.url), "utf8");
+24 -15
View File
@@ -4,12 +4,15 @@ const HIGHLIGHT_CLASS = "settings-search-highlight";
const HIGHLIGHT_MS = 1600;
/** Keep focused anchors slightly below the top of the settings content pane. */
const SCROLL_TOP_PADDING_PX = 24;
/** Allow 200ms at the default retry delay for lazy tab / sub-tab mounts. */
const FALLBACK_AFTER_ATTEMPTS = 5;
export type SettingsFocusTarget = {
tab: string;
aiSubTab?: string;
syncSubTab?: string;
anchorId: string;
fallbackAnchorId?: string;
};
let focusGeneration = 0;
@@ -30,6 +33,18 @@ function isAnchorVisible(el: HTMLElement): boolean {
return el.getClientRects().length > 0;
}
function findVisibleAnchor(anchorId: string): HTMLElement | undefined {
const candidates = [
document.getElementById(settingsAnchorDomId(anchorId)),
...Array.from(
document.querySelectorAll<HTMLElement>(
`[data-settings-anchor="${CSS.escape(anchorId)}"]`,
),
),
].filter((node): node is HTMLElement => Boolean(node));
return candidates.find((node) => isAnchorVisible(node));
}
function focusAnchorElement(el: HTMLElement): void {
const focusable = el.matches("button, a, input, select, textarea, [tabindex]")
? el
@@ -103,15 +118,16 @@ export function scrollSettingsAnchorIntoView(
/**
* Scroll the settings content pane to a catalog anchor and briefly highlight it.
* Retries to cover lazy tab mounts / nested sub-tab switches.
* After a short mount window, use a visible parent fallback for gated rows.
*/
export function focusSettingsAnchor(
anchorId: string,
options?: { attempts?: number; delayMs?: number },
options?: { attempts?: number; delayMs?: number; fallbackAnchorId?: string },
): Promise<boolean> {
const attempts = options?.attempts ?? 40;
const delayMs = options?.delayMs ?? 50;
const generation = ++focusGeneration;
let remaining = attempts;
let attempt = 0;
return new Promise((resolve) => {
const finish = (ok: boolean) => {
@@ -125,20 +141,13 @@ export function focusSettingsAnchor(
return;
}
const domId = settingsAnchorDomId(anchorId);
const candidates = [
document.getElementById(domId),
...Array.from(
document.querySelectorAll<HTMLElement>(
`[data-settings-anchor="${CSS.escape(anchorId)}"]`,
),
),
].filter((node): node is HTMLElement => Boolean(node));
const el = candidates.find((node) => isAnchorVisible(node));
attempt += 1;
let el = findVisibleAnchor(anchorId);
if (!el && options?.fallbackAnchorId && attempt >= Math.min(FALLBACK_AFTER_ATTEMPTS, attempts)) {
el = findVisibleAnchor(options.fallbackAnchorId);
}
if (!el) {
remaining -= 1;
if (remaining > 0) {
if (attempt < attempts) {
window.setTimeout(tryFocus, delayMs);
return;
}
@@ -258,6 +258,7 @@ export const AppLockSettingsSection: React.FC<AppLockSettingsSectionProps> = ({
</SettingRow>
<SettingRow
anchorId="system-app-lock-timeout"
label={t('settings.appLock.timeout')}
description={t('settings.appLock.timeoutDesc')}
>
@@ -693,6 +693,7 @@ const SettingsSystemTab: React.FC<SettingsSystemTabProps> = ({
{httpNetworkProxy.mode === "custom" && (
<>
<SettingRow
anchorId="system-network-proxy-url"
label={t("settings.system.networkProxy.url")}
description={t("settings.system.networkProxy.url.desc")}
>
@@ -710,6 +711,7 @@ const SettingsSystemTab: React.FC<SettingsSystemTabProps> = ({
/>
</SettingRow>
<SettingRow
anchorId="system-network-proxy-bypass"
label={t("settings.system.networkProxy.bypass")}
description={t("settings.system.networkProxy.bypass.desc")}
>
@@ -1088,7 +1090,7 @@ const SettingsSystemTab: React.FC<SettingsSystemTabProps> = ({
</SettingRow>
{/* Directory Selection */}
<div className="space-y-2">
<SettingsAnchor anchorId="system-session-logs-directory" className="space-y-2">
<div className="flex items-center gap-2">
<span className="text-sm font-medium">{t("settings.sessionLogs.directory")}</span>
</div>
@@ -1125,10 +1127,11 @@ const SettingsSystemTab: React.FC<SettingsSystemTabProps> = ({
<p className="text-xs text-muted-foreground">
{t("settings.sessionLogs.directoryHint")}
</p>
</div>
</SettingsAnchor>
{/* Format Selection */}
<SettingRow
anchorId="system-session-logs-format"
label={t("settings.sessionLogs.format")}
description={t("settings.sessionLogs.formatDesc")}
>
@@ -1141,6 +1144,7 @@ const SettingsSystemTab: React.FC<SettingsSystemTabProps> = ({
</SettingRow>
<SettingRow
anchorId="system-session-logs-timestamps"
label={t("settings.sessionLogs.timestamps")}
description={t("settings.sessionLogs.timestampsDesc")}
>
@@ -814,6 +814,7 @@ function SettingsTerminalTab(props: {
</SettingRow>
<SettingRow
anchorId="terminal-side-panel-auto-open-pane"
label={t("settings.terminal.sidePanel.autoOpenPane")}
description={t("settings.terminal.sidePanel.autoOpenPane.desc")}
>
@@ -841,6 +842,7 @@ function SettingsTerminalTab(props: {
</SettingRow>
<SettingRow
anchorId="terminal-local-shell-side-panel-auto-open-pane"
label={t("settings.terminal.localShellSidePanel.autoOpenPane")}
description={t("settings.terminal.localShellSidePanel.autoOpenPane.desc")}
>
@@ -945,6 +947,7 @@ function SettingsTerminalTab(props: {
</SettingRow>
<SettingRow
anchorId="terminal-local-shell-start-dir"
label={t("settings.terminal.localShell.startDir")}
description={t("settings.terminal.localShell.startDir.desc")}
>
@@ -1048,6 +1051,7 @@ function SettingsTerminalTab(props: {
/>
</SettingRow>
<SettingRow
anchorId="terminal-keepalive-count-max"
label={t("settings.terminal.connection.keepaliveCountMax")}
description={t("settings.terminal.connection.keepaliveCountMax.desc")}
>
@@ -1082,6 +1086,7 @@ function SettingsTerminalTab(props: {
<SectionHeader title={t("settings.terminal.section.serverStats")} />
<div className="space-y-0 divide-y divide-border rounded-lg border bg-card px-4">
<SettingRow
anchorId="terminal-host-info-bar-show"
label={t("settings.terminal.hostInfoBar.show")}
description={t("settings.terminal.hostInfoBar.show.desc")}
>
@@ -1092,6 +1097,7 @@ function SettingsTerminalTab(props: {
</SettingRow>
{terminalSettings.showHostInfoBar && (
<SettingRow
anchorId="terminal-host-info-bar-title-mode"
label={t("settings.terminal.hostInfoBar.titleMode")}
description={t("settings.terminal.hostInfoBar.titleMode.desc")}
>
@@ -1119,6 +1125,7 @@ function SettingsTerminalTab(props: {
{terminalSettings.showServerStats && (
<SettingRow
anchorId="terminal-server-stats-refresh-interval"
label={t("settings.terminal.serverStats.refreshInterval")}
description={t("settings.terminal.serverStats.refreshInterval.desc")}
>
@@ -1145,6 +1152,7 @@ function SettingsTerminalTab(props: {
<SectionHeader title={t("settings.terminal.section.systemManager")} />
<div className="space-y-0 divide-y divide-border rounded-lg border bg-card px-4">
<SettingRow
anchorId="terminal-system-manager-process-refresh-interval"
label={t("settings.terminal.systemManager.processRefreshInterval")}
description={t("settings.terminal.systemManager.processRefreshInterval.desc")}
>
@@ -1166,6 +1174,7 @@ function SettingsTerminalTab(props: {
</div>
</SettingRow>
<SettingRow
anchorId="terminal-system-manager-tmux-refresh-interval"
label={t("settings.terminal.systemManager.tmuxRefreshInterval")}
description={t("settings.terminal.systemManager.tmuxRefreshInterval.desc")}
>
@@ -1187,6 +1196,7 @@ function SettingsTerminalTab(props: {
</div>
</SettingRow>
<SettingRow
anchorId="terminal-system-manager-docker-list-refresh-interval"
label={t("settings.terminal.systemManager.dockerListRefreshInterval")}
description={t("settings.terminal.systemManager.dockerListRefreshInterval.desc")}
>
@@ -1208,6 +1218,7 @@ function SettingsTerminalTab(props: {
</div>
</SettingRow>
<SettingRow
anchorId="terminal-system-manager-docker-stats-refresh-interval"
label={t("settings.terminal.systemManager.dockerStatsRefreshInterval")}
description={t("settings.terminal.systemManager.dockerStatsRefreshInterval.desc")}
>
@@ -1249,6 +1260,7 @@ function SettingsTerminalTab(props: {
/>
</SettingRow>
<SettingRow
anchorId="terminal-hibernate-hidden-tabs"
label={t("settings.terminal.rendering.hibernateHiddenTabs")}
description={t("settings.terminal.rendering.hibernateHiddenTabs.desc")}
>
@@ -1260,6 +1272,7 @@ function SettingsTerminalTab(props: {
{terminalSettings.hibernateHiddenTabs && (
<>
<SettingRow
anchorId="terminal-hibernate-hidden-tabs-delay"
label={t("settings.terminal.rendering.hibernateHiddenTabsDelay")}
description={t("settings.terminal.rendering.hibernateHiddenTabsDelay.desc")}
>
@@ -1281,6 +1294,7 @@ function SettingsTerminalTab(props: {
</div>
</SettingRow>
<SettingRow
anchorId="terminal-hibernate-skip-alt-screen"
label={t("settings.terminal.rendering.hibernateSkipAltScreen")}
description={t("settings.terminal.rendering.hibernateSkipAltScreen.desc")}
>
@@ -1290,6 +1304,7 @@ function SettingsTerminalTab(props: {
/>
</SettingRow>
<SettingRow
anchorId="terminal-hibernate-keep-renderer-count"
label={t("settings.terminal.rendering.hibernateKeepRendererCount")}
description={t("settings.terminal.rendering.hibernateKeepRendererCount.desc")}
>
@@ -1308,6 +1323,7 @@ function SettingsTerminalTab(props: {
/>
</SettingRow>
<SettingRow
anchorId="terminal-hibernate-replay-chunk-bytes"
label={t("settings.terminal.rendering.hibernateReplayChunkBytes")}
description={t("settings.terminal.rendering.hibernateReplayChunkBytes.desc")}
>
@@ -1327,6 +1343,7 @@ function SettingsTerminalTab(props: {
/>
</SettingRow>
<SettingRow
anchorId="terminal-hibernate-prefer-wasm-serialize"
label={t("settings.terminal.rendering.hibernatePreferWasmSerialize")}
description={t("settings.terminal.rendering.hibernatePreferWasmSerialize.desc")}
>
@@ -1354,6 +1371,7 @@ function SettingsTerminalTab(props: {
{terminalSettings.inlineImagesEnabled && (
<>
<SettingRow
anchorId="terminal-inline-images-kitty"
label={t("settings.terminal.inlineImages.kitty")}
description={t("settings.terminal.inlineImages.kitty.desc")}
>
@@ -1363,6 +1381,7 @@ function SettingsTerminalTab(props: {
/>
</SettingRow>
<SettingRow
anchorId="terminal-inline-images-sixel"
label={t("settings.terminal.inlineImages.sixel")}
description={t("settings.terminal.inlineImages.sixel.desc")}
>
@@ -1372,6 +1391,7 @@ function SettingsTerminalTab(props: {
/>
</SettingRow>
<SettingRow
anchorId="terminal-inline-images-iip"
label={t("settings.terminal.inlineImages.iip")}
description={t("settings.terminal.inlineImages.iip.desc")}
>
@@ -1381,6 +1401,7 @@ function SettingsTerminalTab(props: {
/>
</SettingRow>
<SettingRow
anchorId="terminal-inline-images-storage-limit"
label={t("settings.terminal.inlineImages.storageLimit")}
description={t("settings.terminal.inlineImages.storageLimit.desc")}
>
@@ -1406,6 +1427,7 @@ function SettingsTerminalTab(props: {
</div>
</SettingRow>
<SettingRow
anchorId="terminal-inline-images-max-megapixels"
label={t("settings.terminal.inlineImages.maxMegapixels")}
description={t("settings.terminal.inlineImages.maxMegapixels.desc")}
>
@@ -1431,6 +1453,7 @@ function SettingsTerminalTab(props: {
</div>
</SettingRow>
<SettingRow
anchorId="terminal-inline-images-sequence-limit"
label={t("settings.terminal.inlineImages.sequenceLimit")}
description={t("settings.terminal.inlineImages.sequenceLimit.desc")}
>
@@ -1496,6 +1519,7 @@ function SettingsTerminalTab(props: {
/>
</SettingRow>
<SettingRow
anchorId="terminal-autocomplete-ghost-text"
label={t("settings.terminal.autocomplete.ghostText")}
description={t("settings.terminal.autocomplete.ghostText.desc")}
>
@@ -1506,6 +1530,7 @@ function SettingsTerminalTab(props: {
/>
</SettingRow>
<SettingRow
anchorId="terminal-autocomplete-popup-menu"
label={t("settings.terminal.autocomplete.popupMenu")}
description={t("settings.terminal.autocomplete.popupMenu.desc")}
>
@@ -1516,6 +1541,7 @@ function SettingsTerminalTab(props: {
/>
</SettingRow>
<SettingRow
anchorId="terminal-autocomplete-history-scope"
label={t("settings.terminal.autocomplete.historyScope")}
description={t("settings.terminal.autocomplete.historyScope.desc")}
>
@@ -101,6 +101,7 @@ export const TerminalBehaviorSettings: React.FC<TerminalBehaviorSettingsProps> =
</SettingRow>
<SettingRow
anchorId="terminal-right-click-long-press-menu"
label={t("settings.terminal.behavior.rightClick.longPressMenu")}
description={t("settings.terminal.behavior.rightClick.longPressMenu.desc")}
>
@@ -111,6 +112,7 @@ export const TerminalBehaviorSettings: React.FC<TerminalBehaviorSettingsProps> =
</SettingRow>
<SettingRow
anchorId="terminal-right-click-fullscreen-menu"
label={t("settings.terminal.behavior.rightClick.fullscreenMenu")}
description={t("settings.terminal.behavior.rightClick.fullscreenMenu.desc")}
>
@@ -228,6 +230,7 @@ export const TerminalBehaviorSettings: React.FC<TerminalBehaviorSettingsProps> =
</SettingRow>
<SettingRow
anchorId="terminal-shift-enter-newline-text"
label={t("settings.terminal.behavior.shiftEnterNewlineText")}
description={t("settings.terminal.behavior.shiftEnterNewlineText.desc")}
>
@@ -260,6 +263,7 @@ export const TerminalBehaviorSettings: React.FC<TerminalBehaviorSettingsProps> =
</SettingRow>
<SettingRow
anchorId="terminal-preserve-selection-on-input"
label={t("settings.terminal.behavior.preserveSelectionOnInput")}
description={t("settings.terminal.behavior.preserveSelectionOnInput.desc")}
>
@@ -267,6 +271,7 @@ export const TerminalBehaviorSettings: React.FC<TerminalBehaviorSettingsProps> =
</SettingRow>
<SettingRow
anchorId="terminal-force-prompt-new-line"
label={t("settings.terminal.behavior.forcePromptNewLine")}
description={t("settings.terminal.behavior.forcePromptNewLine.desc")}
>
@@ -341,6 +346,7 @@ export const TerminalBehaviorSettings: React.FC<TerminalBehaviorSettingsProps> =
</SettingRow>
<SettingRow
anchorId="terminal-scroll-on-input"
label={t("settings.terminal.behavior.scrollOnInput")}
description={t("settings.terminal.behavior.scrollOnInput.desc")}
>
@@ -348,6 +354,7 @@ export const TerminalBehaviorSettings: React.FC<TerminalBehaviorSettingsProps> =
</SettingRow>
<SettingRow
anchorId="terminal-scroll-on-output"
label={t("settings.terminal.behavior.scrollOnOutput")}
description={t("settings.terminal.behavior.scrollOnOutput.desc")}
>
@@ -355,6 +362,7 @@ export const TerminalBehaviorSettings: React.FC<TerminalBehaviorSettingsProps> =
</SettingRow>
<SettingRow
anchorId="terminal-scroll-on-key-press"
label={t("settings.terminal.behavior.scrollOnKeyPress")}
description={t("settings.terminal.behavior.scrollOnKeyPress.desc")}
>
@@ -362,6 +370,7 @@ export const TerminalBehaviorSettings: React.FC<TerminalBehaviorSettingsProps> =
</SettingRow>
<SettingRow
anchorId="terminal-scroll-on-paste"
label={t("settings.terminal.behavior.scrollOnPaste")}
description={t("settings.terminal.behavior.scrollOnPaste.desc")}
>
@@ -369,6 +378,7 @@ export const TerminalBehaviorSettings: React.FC<TerminalBehaviorSettingsProps> =
</SettingRow>
<SettingRow
anchorId="terminal-smooth-scrolling"
label={t("settings.terminal.behavior.smoothScrolling")}
description={t("settings.terminal.behavior.smoothScrolling.desc")}
>
@@ -392,6 +402,7 @@ export const TerminalBehaviorSettings: React.FC<TerminalBehaviorSettingsProps> =
</SettingRow>
<SettingRow
anchorId="terminal-link-modifier"
label={t("settings.terminal.behavior.linkModifier")}
description={t("settings.terminal.behavior.linkModifier.desc")}
>
@@ -756,7 +756,7 @@ export const ExternalMcpCard: React.FC = () => {
</div>
<SettingsAnchor anchorId="ai-external-mcp-approval-alert">
<SettingRow className="flex-col items-start md:flex-row md:items-center" label={t("ai.toolSettings.behavior")} description={t(mode === "persistent" ? "ai.externalMcp.mode.persistent" : "ai.externalMcp.mode.temporary")}>
<SettingRow anchorId="ai-external-mcp-behavior" className="flex-col items-start md:flex-row md:items-center" label={t("ai.toolSettings.behavior")} description={t(mode === "persistent" ? "ai.externalMcp.mode.persistent" : "ai.externalMcp.mode.temporary")}>
<ToolSettingsDialog title={t("ai.toolSettings.behavior")} triggerLabel={t("ai.toolSettings.configureBehavior")} immediate open={behaviorOpen} onOpenChange={setBehaviorOpen}>
<SettingCard divided className="border-0 bg-transparent p-0">
<SettingRow
@@ -879,7 +879,7 @@ export const ExternalMcpCard: React.FC = () => {
/>
<SettingCard>
<SettingRow className="flex-col items-start md:flex-row md:items-center" label={t("ai.externalMcp.clientConfiguration")} description={t("ai.externalMcp.clientConfiguration.description")}>
<SettingRow anchorId="ai-external-mcp-client-configuration" className="flex-col items-start md:flex-row md:items-center" label={t("ai.externalMcp.clientConfiguration")} description={t("ai.externalMcp.clientConfiguration.description")}>
<ToolSettingsDialog title={t("ai.externalMcp.clientConfiguration")} triggerLabel={t("ai.toolSettings.configureClients")}>
<div className="space-y-2">
@@ -136,6 +136,7 @@ export const SafetySettings: React.FC<{
</SettingRow>
<SettingRow
anchorId="ai-safety-max-iterations"
label={t('ai.safety.maxIterations')}
description={t('ai.safety.maxIterations.description')}
>
@@ -144,6 +144,7 @@ export const WebSearchSettings: React.FC<{
{/* API Key (hidden for SearXNG) */}
{preset.requiresApiKey && (
<SettingRow
anchorId="ai-web-search-api-key"
label={t("ai.webSearch.apiKey")}
description={t("ai.webSearch.apiKey.description")}
>
@@ -170,6 +171,7 @@ export const WebSearchSettings: React.FC<{
{/* API Host */}
<SettingRow
anchorId="ai-web-search-api-host"
label={t("ai.webSearch.apiHost")}
description={
config.providerId === "searxng"
@@ -188,6 +190,7 @@ export const WebSearchSettings: React.FC<{
{/* Max Results */}
<SettingRow
anchorId="ai-web-search-max-results"
label={t("ai.webSearch.maxResults")}
description={t("ai.webSearch.maxResults.description")}
>
+94
View File
@@ -64,6 +64,41 @@ test("settings search catalog has unique ids", () => {
assert.equal(new Set(ids).size, ids.length);
});
test("newly indexed gated settings retain visible parent destinations in search", () => {
const fallbacks = {
"terminal-hibernate-hidden-tabs-delay": "terminal-hibernate-hidden-tabs",
"terminal-hibernate-skip-alt-screen": "terminal-hibernate-hidden-tabs",
"terminal-hibernate-keep-renderer-count": "terminal-hibernate-hidden-tabs",
"terminal-hibernate-replay-chunk-bytes": "terminal-hibernate-hidden-tabs",
"terminal-hibernate-prefer-wasm-serialize": "terminal-hibernate-hidden-tabs",
"terminal-inline-images-kitty": "terminal-inline-images-enabled",
"terminal-inline-images-sixel": "terminal-inline-images-enabled",
"terminal-inline-images-iip": "terminal-inline-images-enabled",
"terminal-inline-images-storage-limit": "terminal-inline-images-enabled",
"terminal-inline-images-max-megapixels": "terminal-inline-images-enabled",
"terminal-inline-images-sequence-limit": "terminal-inline-images-enabled",
"terminal-host-info-bar-title-mode": "terminal-host-info-bar-show",
"terminal-server-stats-refresh-interval": "terminal-server-stats-show",
"ai-web-search-api-key": "ai-web-search-provider",
"system-network-proxy-url": "system-network-proxy-mode",
"system-network-proxy-bypass": "system-network-proxy-mode",
"system-app-lock-timeout": "system-app-lock",
};
const hits = filterSettingsSearchCatalog("", (key) => en[key] ?? key, { limit: 500 });
for (const [id, fallbackId] of Object.entries(fallbacks)) {
const entry = hits.find((hit) => hit.entry.id === id)?.entry;
assert.ok(entry, id);
assert.equal(entry.fallbackAnchorId, fallbackId, id);
const parent = SETTINGS_SEARCH_CATALOG.find((candidate) => candidate.id === fallbackId);
assert.ok(parent, fallbackId);
assert.equal(parent.tab, entry.tab, id);
assert.equal(parent.aiSubTab, entry.aiSubTab, id);
assert.equal(parent.fallbackAnchorId, undefined, fallbackId);
}
// The local start-directory row is always mounted in this UI.
assert.equal(hits.find((hit) => hit.entry.id === "terminal-local-shell-start-dir")?.entry.fallbackAnchorId, undefined);
});
test("filterSettingsSearchCatalog matches English labels", () => {
const hits = filterSettingsSearchCatalog("copy on select", tEn);
assert.ok(hits.some((hit) => hit.entry.id === "terminal-copy-on-select"));
@@ -167,6 +202,65 @@ test("settings search finds SSH connection keep-alive from the real locales", ()
}
});
test("settings search finds note typography from the real locales", () => {
const tZhReal = (key: string) => zhCN[key] ?? key;
const tEnReal = (key: string) => en[key] ?? key;
for (const [id, zhQuery, enQuery] of [
["appearance-vault-notes-font", "代码字体", "code font"],
["appearance-vault-notes-font-size", "笔记字号", "note font size"],
["appearance-vault-notes-code-font-size", "代码字号", "code font size"],
] as const) {
for (const [t, query] of [[tZhReal, zhQuery], [tEnReal, enQuery]] as const) {
const hit = filterSettingsSearchCatalog(query, t).find((hit) => hit.entry.id === id);
assert.ok(hit, `${query} should find ${id}`);
assert.equal(hit.entry.tab, "appearance");
}
}
});
test("settings search finds session log options from the real locales", () => {
const tZhReal = (key: string) => zhCN[key] ?? key;
const tEnReal = (key: string) => en[key] ?? key;
for (const [id, t, queries] of [
["system-session-logs-directory", tZhReal, ["保存目录"]],
["system-session-logs-directory", tEnReal, ["save directory"]],
["system-session-logs-format", tZhReal, ["日志格式"]],
["system-session-logs-format", tEnReal, ["log format"]],
["system-session-logs-timestamps", tZhReal, ["时间戳"]],
["system-session-logs-timestamps", tEnReal, ["timestamp", "Add timestamps"]],
] as const) {
for (const query of queries) {
const hit = filterSettingsSearchCatalog(query, t).find((hit) => hit.entry.id === id);
assert.ok(hit, `${query} should find ${id}`);
assert.equal(hit.entry.tab, "system");
assert.equal(hit.entry.sectionKey, "settings.sessionLogs.title");
}
}
});
test("later-added settings retain their tab and sub-tab destinations", () => {
const tZhReal = (key: string) => zhCN[key] ?? key;
const tEnReal = (key: string) => en[key] ?? key;
for (const [id, tab, subTab, labelKey] of [
["terminal-font-ligatures", "terminal", undefined, "settings.terminal.font.ligatures"],
["terminal-local-shell-side-panel-auto-open", "terminal", undefined, "settings.terminal.localShellSidePanel.autoOpen"],
["terminal-system-manager-process-refresh-interval", "terminal", undefined, "settings.terminal.systemManager.processRefreshInterval"],
["ai-chat-history-message-cap", "ai", "tools", "ai.chatHistory.messageCap"],
["ai-web-search-max-results", "ai", "search", "ai.webSearch.maxResults"],
["ai-safety-max-iterations", "ai", "safety", "ai.safety.maxIterations"],
["sync-ai-sessions", "sync", "status", "cloudSync.aiSessions.title"],
["system-network-proxy-url", "system", undefined, "settings.system.networkProxy.url"],
] as const) {
for (const t of [tZhReal, tEnReal]) {
assert.notEqual(t(labelKey), labelKey);
const hit = filterSettingsSearchCatalog(t(labelKey), t).find((hit) => hit.entry.id === id);
assert.ok(hit, `${t(labelKey)} should find ${id}`);
assert.equal(hit.entry.tab, tab);
assert.equal(hit.entry.aiSubTab ?? hit.entry.syncSubTab, subTab);
}
}
});
test("settings search finds temporary network device mode", () => {
const tEnReal = (key: string) => en[key] ?? key;
const tZhTW = (key: string) => zhTW[key] ?? key;
+2 -2
View File
@@ -24,7 +24,7 @@ function collectSourceFiles(root: string): string[] {
return out;
}
test("every settings search catalog id is wired as an anchor in components", () => {
test("every settings search catalog id and fallback is wired as an anchor in components", () => {
const roots = [
join(process.cwd(), "components"),
];
@@ -32,7 +32,7 @@ test("every settings search catalog id is wired as an anchor in components", ()
const haystack = sources.map((file) => readFileSync(file, "utf8")).join("\n");
const missing = SETTINGS_SEARCH_CATALOG
.map((entry) => entry.id)
.flatMap((entry) => [entry.id, ...(entry.fallbackAnchorId ? [entry.fallbackAnchorId] : [])])
.filter((id) => {
const asProp = `anchorId="${id}"`;
const asPropSingle = `anchorId='${id}'`;
+441
View File
@@ -36,6 +36,11 @@ export type SettingsPlatform = "mac" | "win" | "linux";
export type SettingsSearchEntry = {
/** Stable id; also used as `data-settings-anchor` on the target element. */
id: string;
/**
* Already-mounted parent to highlight when a prerequisite setting is off and
* this entry's own anchor is not in the DOM.
*/
fallbackAnchorId?: string;
tab: SettingsTabId;
/** Nested AI settings tab when `tab === "ai"`. */
aiSubTab?: AISettingsSubTabId;
@@ -214,6 +219,27 @@ export const SETTINGS_SEARCH_CATALOG: readonly SettingsSearchEntry[] = [
descriptionKey: "settings.vault.autoImportSystemKnownHostsDesc",
sectionKey: "settings.vault.title",
},
{
id: "appearance-vault-notes-font",
tab: "appearance",
labelKey: "settings.vault.notesFont",
descriptionKey: "settings.vault.notesFontDesc",
sectionKey: "settings.vault.title",
},
{
id: "appearance-vault-notes-font-size",
tab: "appearance",
labelKey: "settings.vault.notesFontSize",
descriptionKey: "settings.vault.notesFontSizeDesc",
sectionKey: "settings.vault.title",
},
{
id: "appearance-vault-notes-code-font-size",
tab: "appearance",
labelKey: "settings.vault.notesCodeFontSize",
descriptionKey: "settings.vault.notesCodeFontSizeDesc",
sectionKey: "settings.vault.title",
},
{
id: "appearance-custom-css",
tab: "appearance",
@@ -273,6 +299,13 @@ export const SETTINGS_SEARCH_CATALOG: readonly SettingsSearchEntry[] = [
descriptionKey: "settings.terminal.font.smoothing.desc",
sectionKey: "settings.terminal.section.font",
},
{
id: "terminal-font-ligatures",
tab: "terminal",
labelKey: "settings.terminal.font.ligatures",
descriptionKey: "settings.terminal.font.ligatures.desc",
sectionKey: "settings.terminal.section.font",
},
{
id: "terminal-font-line-padding",
tab: "terminal",
@@ -366,6 +399,20 @@ export const SETTINGS_SEARCH_CATALOG: readonly SettingsSearchEntry[] = [
descriptionKey: "settings.terminal.behavior.rightClick.desc",
sectionKey: "settings.terminal.section.behavior",
},
{
id: "terminal-right-click-long-press-menu",
tab: "terminal",
labelKey: "settings.terminal.behavior.rightClick.longPressMenu",
descriptionKey: "settings.terminal.behavior.rightClick.longPressMenu.desc",
sectionKey: "settings.terminal.section.behavior",
},
{
id: "terminal-right-click-fullscreen-menu",
tab: "terminal",
labelKey: "settings.terminal.behavior.rightClick.fullscreenMenu",
descriptionKey: "settings.terminal.behavior.rightClick.fullscreenMenu.desc",
sectionKey: "settings.terminal.section.behavior",
},
{
id: "terminal-copy-on-select",
tab: "terminal",
@@ -415,6 +462,13 @@ export const SETTINGS_SEARCH_CATALOG: readonly SettingsSearchEntry[] = [
descriptionKey: "settings.terminal.behavior.confirmMultilinePaste.desc",
sectionKey: "settings.terminal.section.behavior",
},
{
id: "terminal-confirm-multiline-paste-min-lines",
tab: "terminal",
labelKey: "settings.terminal.behavior.confirmMultilinePasteMinLines",
descriptionKey: "settings.terminal.behavior.confirmMultilinePasteMinLines.desc",
sectionKey: "settings.terminal.section.behavior",
},
{
id: "terminal-shift-enter-newline",
tab: "terminal",
@@ -422,6 +476,13 @@ export const SETTINGS_SEARCH_CATALOG: readonly SettingsSearchEntry[] = [
descriptionKey: "settings.terminal.behavior.shiftEnterNewline.desc",
sectionKey: "settings.terminal.section.behavior",
},
{
id: "terminal-shift-enter-newline-text",
tab: "terminal",
labelKey: "settings.terminal.behavior.shiftEnterNewlineText",
descriptionKey: "settings.terminal.behavior.shiftEnterNewlineText.desc",
sectionKey: "settings.terminal.section.behavior",
},
{
id: "terminal-shift-enter-force-text",
tab: "terminal",
@@ -443,6 +504,20 @@ export const SETTINGS_SEARCH_CATALOG: readonly SettingsSearchEntry[] = [
descriptionKey: "settings.terminal.behavior.clearWipesScrollback.desc",
sectionKey: "settings.terminal.section.behavior",
},
{
id: "terminal-preserve-selection-on-input",
tab: "terminal",
labelKey: "settings.terminal.behavior.preserveSelectionOnInput",
descriptionKey: "settings.terminal.behavior.preserveSelectionOnInput.desc",
sectionKey: "settings.terminal.section.behavior",
},
{
id: "terminal-force-prompt-new-line",
tab: "terminal",
labelKey: "settings.terminal.behavior.forcePromptNewLine",
descriptionKey: "settings.terminal.behavior.forcePromptNewLine.desc",
sectionKey: "settings.terminal.section.behavior",
},
{
id: "terminal-tab-double-click",
tab: "terminal",
@@ -472,6 +547,55 @@ export const SETTINGS_SEARCH_CATALOG: readonly SettingsSearchEntry[] = [
descriptionKey: "settings.terminal.behavior.osc52Clipboard.desc",
sectionKey: "settings.terminal.section.behavior",
},
{
id: "terminal-scroll-on-input",
tab: "terminal",
labelKey: "settings.terminal.behavior.scrollOnInput",
descriptionKey: "settings.terminal.behavior.scrollOnInput.desc",
sectionKey: "settings.terminal.section.behavior",
},
{
id: "terminal-scroll-on-output",
tab: "terminal",
labelKey: "settings.terminal.behavior.scrollOnOutput",
descriptionKey: "settings.terminal.behavior.scrollOnOutput.desc",
sectionKey: "settings.terminal.section.behavior",
},
{
id: "terminal-scroll-on-key-press",
tab: "terminal",
labelKey: "settings.terminal.behavior.scrollOnKeyPress",
descriptionKey: "settings.terminal.behavior.scrollOnKeyPress.desc",
sectionKey: "settings.terminal.section.behavior",
},
{
id: "terminal-scroll-on-paste",
tab: "terminal",
labelKey: "settings.terminal.behavior.scrollOnPaste",
descriptionKey: "settings.terminal.behavior.scrollOnPaste.desc",
sectionKey: "settings.terminal.section.behavior",
},
{
id: "terminal-smooth-scrolling",
tab: "terminal",
labelKey: "settings.terminal.behavior.smoothScrolling",
descriptionKey: "settings.terminal.behavior.smoothScrolling.desc",
sectionKey: "settings.terminal.section.behavior",
},
{
id: "terminal-link-browser",
tab: "terminal",
labelKey: "settings.terminal.behavior.linkBrowser",
descriptionKey: "settings.terminal.behavior.linkBrowser.desc",
sectionKey: "settings.terminal.section.behavior",
},
{
id: "terminal-link-modifier",
tab: "terminal",
labelKey: "settings.terminal.behavior.linkModifier",
descriptionKey: "settings.terminal.behavior.linkModifier.desc",
sectionKey: "settings.terminal.section.behavior",
},
{
id: "terminal-scrollback-rows",
tab: "terminal",
@@ -493,6 +617,27 @@ export const SETTINGS_SEARCH_CATALOG: readonly SettingsSearchEntry[] = [
descriptionKey: "settings.terminal.sidePanel.autoOpen.desc",
sectionKey: "settings.terminal.section.sidePanel",
},
{
id: "terminal-side-panel-auto-open-pane",
tab: "terminal",
labelKey: "settings.terminal.sidePanel.autoOpenPane",
descriptionKey: "settings.terminal.sidePanel.autoOpenPane.desc",
sectionKey: "settings.terminal.section.sidePanel",
},
{
id: "terminal-local-shell-side-panel-auto-open",
tab: "terminal",
labelKey: "settings.terminal.localShellSidePanel.autoOpen",
descriptionKey: "settings.terminal.localShellSidePanel.autoOpen.desc",
sectionKey: "settings.terminal.section.localShellSidePanel",
},
{
id: "terminal-local-shell-side-panel-auto-open-pane",
tab: "terminal",
labelKey: "settings.terminal.localShellSidePanel.autoOpenPane",
descriptionKey: "settings.terminal.localShellSidePanel.autoOpenPane.desc",
sectionKey: "settings.terminal.section.localShellSidePanel",
},
{
id: "terminal-keyword-highlight",
tab: "terminal",
@@ -507,6 +652,13 @@ export const SETTINGS_SEARCH_CATALOG: readonly SettingsSearchEntry[] = [
descriptionKey: "settings.terminal.localShell.shell.desc",
sectionKey: "settings.terminal.section.localShell",
},
{
id: "terminal-local-shell-start-dir",
tab: "terminal",
labelKey: "settings.terminal.localShell.startDir",
descriptionKey: "settings.terminal.localShell.startDir.desc",
sectionKey: "settings.terminal.section.localShell",
},
{
id: "terminal-default-proxy",
tab: "terminal",
@@ -552,6 +704,13 @@ export const SETTINGS_SEARCH_CATALOG: readonly SettingsSearchEntry[] = [
descriptionKey: "settings.terminal.connection.keepaliveInterval.desc",
sectionKey: "settings.terminal.section.connection",
},
{
id: "terminal-keepalive-count-max",
tab: "terminal",
labelKey: "settings.terminal.connection.keepaliveCountMax",
descriptionKey: "settings.terminal.connection.keepaliveCountMax.desc",
sectionKey: "settings.terminal.section.connection",
},
{
id: "terminal-x11-display",
tab: "terminal",
@@ -560,6 +719,21 @@ export const SETTINGS_SEARCH_CATALOG: readonly SettingsSearchEntry[] = [
sectionKey: "settings.terminal.section.connection",
keywords: ["x11", "display"],
},
{
id: "terminal-host-info-bar-show",
tab: "terminal",
labelKey: "settings.terminal.hostInfoBar.show",
descriptionKey: "settings.terminal.hostInfoBar.show.desc",
sectionKey: "settings.terminal.section.serverStats",
},
{
id: "terminal-host-info-bar-title-mode",
fallbackAnchorId: "terminal-host-info-bar-show",
tab: "terminal",
labelKey: "settings.terminal.hostInfoBar.titleMode",
descriptionKey: "settings.terminal.hostInfoBar.titleMode.desc",
sectionKey: "settings.terminal.section.serverStats",
},
{
id: "terminal-server-stats-show",
tab: "terminal",
@@ -567,6 +741,42 @@ export const SETTINGS_SEARCH_CATALOG: readonly SettingsSearchEntry[] = [
descriptionKey: "settings.terminal.serverStats.show.desc",
sectionKey: "settings.terminal.section.serverStats",
},
{
id: "terminal-server-stats-refresh-interval",
fallbackAnchorId: "terminal-server-stats-show",
tab: "terminal",
labelKey: "settings.terminal.serverStats.refreshInterval",
descriptionKey: "settings.terminal.serverStats.refreshInterval.desc",
sectionKey: "settings.terminal.section.serverStats",
},
{
id: "terminal-system-manager-process-refresh-interval",
tab: "terminal",
labelKey: "settings.terminal.systemManager.processRefreshInterval",
descriptionKey: "settings.terminal.systemManager.processRefreshInterval.desc",
sectionKey: "settings.terminal.section.systemManager",
},
{
id: "terminal-system-manager-tmux-refresh-interval",
tab: "terminal",
labelKey: "settings.terminal.systemManager.tmuxRefreshInterval",
descriptionKey: "settings.terminal.systemManager.tmuxRefreshInterval.desc",
sectionKey: "settings.terminal.section.systemManager",
},
{
id: "terminal-system-manager-docker-list-refresh-interval",
tab: "terminal",
labelKey: "settings.terminal.systemManager.dockerListRefreshInterval",
descriptionKey: "settings.terminal.systemManager.dockerListRefreshInterval.desc",
sectionKey: "settings.terminal.section.systemManager",
},
{
id: "terminal-system-manager-docker-stats-refresh-interval",
tab: "terminal",
labelKey: "settings.terminal.systemManager.dockerStatsRefreshInterval",
descriptionKey: "settings.terminal.systemManager.dockerStatsRefreshInterval.desc",
sectionKey: "settings.terminal.section.systemManager",
},
{
id: "terminal-renderer",
tab: "terminal",
@@ -575,6 +785,53 @@ export const SETTINGS_SEARCH_CATALOG: readonly SettingsSearchEntry[] = [
sectionKey: "settings.terminal.section.rendering",
keywords: ["webgl", "canvas"],
},
{
id: "terminal-hibernate-hidden-tabs",
tab: "terminal",
labelKey: "settings.terminal.rendering.hibernateHiddenTabs",
descriptionKey: "settings.terminal.rendering.hibernateHiddenTabs.desc",
sectionKey: "settings.terminal.section.rendering",
},
{
id: "terminal-hibernate-hidden-tabs-delay",
fallbackAnchorId: "terminal-hibernate-hidden-tabs",
tab: "terminal",
labelKey: "settings.terminal.rendering.hibernateHiddenTabsDelay",
descriptionKey: "settings.terminal.rendering.hibernateHiddenTabsDelay.desc",
sectionKey: "settings.terminal.section.rendering",
},
{
id: "terminal-hibernate-skip-alt-screen",
fallbackAnchorId: "terminal-hibernate-hidden-tabs",
tab: "terminal",
labelKey: "settings.terminal.rendering.hibernateSkipAltScreen",
descriptionKey: "settings.terminal.rendering.hibernateSkipAltScreen.desc",
sectionKey: "settings.terminal.section.rendering",
},
{
id: "terminal-hibernate-keep-renderer-count",
fallbackAnchorId: "terminal-hibernate-hidden-tabs",
tab: "terminal",
labelKey: "settings.terminal.rendering.hibernateKeepRendererCount",
descriptionKey: "settings.terminal.rendering.hibernateKeepRendererCount.desc",
sectionKey: "settings.terminal.section.rendering",
},
{
id: "terminal-hibernate-replay-chunk-bytes",
fallbackAnchorId: "terminal-hibernate-hidden-tabs",
tab: "terminal",
labelKey: "settings.terminal.rendering.hibernateReplayChunkBytes",
descriptionKey: "settings.terminal.rendering.hibernateReplayChunkBytes.desc",
sectionKey: "settings.terminal.section.rendering",
},
{
id: "terminal-hibernate-prefer-wasm-serialize",
fallbackAnchorId: "terminal-hibernate-hidden-tabs",
tab: "terminal",
labelKey: "settings.terminal.rendering.hibernatePreferWasmSerialize",
descriptionKey: "settings.terminal.rendering.hibernatePreferWasmSerialize.desc",
sectionKey: "settings.terminal.section.rendering",
},
{
id: "terminal-inline-images-enabled",
tab: "terminal",
@@ -583,6 +840,54 @@ export const SETTINGS_SEARCH_CATALOG: readonly SettingsSearchEntry[] = [
sectionKey: "settings.terminal.section.inlineImages",
keywords: ["sixel", "kitty", "iip"],
},
{
id: "terminal-inline-images-kitty",
fallbackAnchorId: "terminal-inline-images-enabled",
tab: "terminal",
labelKey: "settings.terminal.inlineImages.kitty",
descriptionKey: "settings.terminal.inlineImages.kitty.desc",
sectionKey: "settings.terminal.section.inlineImages",
},
{
id: "terminal-inline-images-sixel",
fallbackAnchorId: "terminal-inline-images-enabled",
tab: "terminal",
labelKey: "settings.terminal.inlineImages.sixel",
descriptionKey: "settings.terminal.inlineImages.sixel.desc",
sectionKey: "settings.terminal.section.inlineImages",
},
{
id: "terminal-inline-images-iip",
fallbackAnchorId: "terminal-inline-images-enabled",
tab: "terminal",
labelKey: "settings.terminal.inlineImages.iip",
descriptionKey: "settings.terminal.inlineImages.iip.desc",
sectionKey: "settings.terminal.section.inlineImages",
},
{
id: "terminal-inline-images-storage-limit",
fallbackAnchorId: "terminal-inline-images-enabled",
tab: "terminal",
labelKey: "settings.terminal.inlineImages.storageLimit",
descriptionKey: "settings.terminal.inlineImages.storageLimit.desc",
sectionKey: "settings.terminal.section.inlineImages",
},
{
id: "terminal-inline-images-max-megapixels",
fallbackAnchorId: "terminal-inline-images-enabled",
tab: "terminal",
labelKey: "settings.terminal.inlineImages.maxMegapixels",
descriptionKey: "settings.terminal.inlineImages.maxMegapixels.desc",
sectionKey: "settings.terminal.section.inlineImages",
},
{
id: "terminal-inline-images-sequence-limit",
fallbackAnchorId: "terminal-inline-images-enabled",
tab: "terminal",
labelKey: "settings.terminal.inlineImages.sequenceLimit",
descriptionKey: "settings.terminal.inlineImages.sequenceLimit.desc",
sectionKey: "settings.terminal.section.inlineImages",
},
{
id: "terminal-workspace-focus-style",
tab: "terminal",
@@ -598,6 +903,27 @@ export const SETTINGS_SEARCH_CATALOG: readonly SettingsSearchEntry[] = [
sectionKey: "settings.terminal.section.autocomplete",
keywords: ["completion", "补全"],
},
{
id: "terminal-autocomplete-ghost-text",
tab: "terminal",
labelKey: "settings.terminal.autocomplete.ghostText",
descriptionKey: "settings.terminal.autocomplete.ghostText.desc",
sectionKey: "settings.terminal.section.autocomplete",
},
{
id: "terminal-autocomplete-popup-menu",
tab: "terminal",
labelKey: "settings.terminal.autocomplete.popupMenu",
descriptionKey: "settings.terminal.autocomplete.popupMenu.desc",
sectionKey: "settings.terminal.section.autocomplete",
},
{
id: "terminal-autocomplete-history-scope",
tab: "terminal",
labelKey: "settings.terminal.autocomplete.historyScope",
descriptionKey: "settings.terminal.autocomplete.historyScope.desc",
sectionKey: "settings.terminal.section.autocomplete",
},
{
id: "terminal-password-prompt-assist",
tab: "terminal",
@@ -779,6 +1105,13 @@ export const SETTINGS_SEARCH_CATALOG: readonly SettingsSearchEntry[] = [
labelKey: "ai.defaultAgent",
descriptionKey: "ai.defaultAgent.description",
},
{
id: "ai-privacy",
tab: "ai",
aiSubTab: "tools",
labelKey: "ai.privacy.title",
descriptionKey: "ai.privacy.description",
},
{
id: "ai-chat-shortcuts-selection",
tab: "ai",
@@ -819,6 +1152,29 @@ export const SETTINGS_SEARCH_CATALOG: readonly SettingsSearchEntry[] = [
sectionKey: "ai.externalMcp.title",
keywords: ["notification", "approval", "dock"],
},
{
id: "ai-chat-history-message-cap",
tab: "ai",
aiSubTab: "tools",
labelKey: "ai.chatHistory.messageCap",
descriptionKey: "ai.chatHistory.messageCap.description",
sectionKey: "ai.chatHistory.title",
},
{
id: "ai-external-mcp-behavior",
tab: "ai",
aiSubTab: "tools",
labelKey: "ai.toolSettings.behavior",
sectionKey: "ai.externalMcp.title",
},
{
id: "ai-external-mcp-client-configuration",
tab: "ai",
aiSubTab: "tools",
labelKey: "ai.externalMcp.clientConfiguration",
descriptionKey: "ai.externalMcp.clientConfiguration.description",
sectionKey: "ai.externalMcp.title",
},
{
id: "ai-user-skills",
tab: "ai",
@@ -850,6 +1206,31 @@ export const SETTINGS_SEARCH_CATALOG: readonly SettingsSearchEntry[] = [
descriptionKey: "ai.webSearch.provider.description",
sectionKey: "ai.webSearch.title",
},
{
id: "ai-web-search-api-key",
fallbackAnchorId: "ai-web-search-provider",
tab: "ai",
aiSubTab: "search",
labelKey: "ai.webSearch.apiKey",
descriptionKey: "ai.webSearch.apiKey.description",
sectionKey: "ai.webSearch.title",
},
{
id: "ai-web-search-api-host",
tab: "ai",
aiSubTab: "search",
labelKey: "ai.webSearch.apiHost",
descriptionKey: "ai.webSearch.apiHost.description",
sectionKey: "ai.webSearch.title",
},
{
id: "ai-web-search-max-results",
tab: "ai",
aiSubTab: "search",
labelKey: "ai.webSearch.maxResults",
descriptionKey: "ai.webSearch.maxResults.description",
sectionKey: "ai.webSearch.title",
},
{
id: "ai-safety-permission-mode",
tab: "ai",
@@ -876,6 +1257,14 @@ export const SETTINGS_SEARCH_CATALOG: readonly SettingsSearchEntry[] = [
sectionKey: "ai.safety.title",
keywords: ["response", "request", "idle", "timeout", "响应", "请求", "超时"],
},
{
id: "ai-safety-max-iterations",
tab: "ai",
aiSubTab: "safety",
labelKey: "ai.safety.maxIterations",
descriptionKey: "ai.safety.maxIterations.description",
sectionKey: "ai.safety.title",
},
{
id: "ai-safety-blocklist",
tab: "ai",
@@ -915,6 +1304,13 @@ export const SETTINGS_SEARCH_CATALOG: readonly SettingsSearchEntry[] = [
labelKey: "cloudSync.strategy.title",
descriptionKey: "cloudSync.strategy.desc",
},
{
id: "sync-ai-sessions",
tab: "sync",
syncSubTab: "status",
labelKey: "cloudSync.aiSessions.title",
descriptionKey: "cloudSync.aiSessions.desc",
},
{
id: "sync-local-backups",
tab: "sync",
@@ -962,6 +1358,22 @@ export const SETTINGS_SEARCH_CATALOG: readonly SettingsSearchEntry[] = [
sectionKey: "settings.system.networkProxy.title",
keywords: ["proxy", "http", "代理"],
},
{
id: "system-network-proxy-url",
fallbackAnchorId: "system-network-proxy-mode",
tab: "system",
labelKey: "settings.system.networkProxy.url",
descriptionKey: "settings.system.networkProxy.url.desc",
sectionKey: "settings.system.networkProxy.title",
},
{
id: "system-network-proxy-bypass",
fallbackAnchorId: "system-network-proxy-mode",
tab: "system",
labelKey: "settings.system.networkProxy.bypass",
descriptionKey: "settings.system.networkProxy.bypass.desc",
sectionKey: "settings.system.networkProxy.title",
},
{
id: "system-app-lock",
tab: "system",
@@ -969,6 +1381,14 @@ export const SETTINGS_SEARCH_CATALOG: readonly SettingsSearchEntry[] = [
descriptionKey: "settings.appLock.description",
keywords: ["app lock", "applock", "lock", "应用锁", "锁屏", "idle", "timeout", "无操作"],
},
{
id: "system-app-lock-timeout",
fallbackAnchorId: "system-app-lock",
tab: "system",
labelKey: "settings.appLock.timeout",
descriptionKey: "settings.appLock.timeoutDesc",
sectionKey: "settings.appLock.title",
},
{
id: "system-credentials",
tab: "system",
@@ -1017,6 +1437,27 @@ export const SETTINGS_SEARCH_CATALOG: readonly SettingsSearchEntry[] = [
descriptionKey: "settings.sessionLogs.enableAutoSaveDesc",
sectionKey: "settings.sessionLogs.title",
},
{
id: "system-session-logs-directory",
tab: "system",
labelKey: "settings.sessionLogs.directory",
descriptionKey: "settings.sessionLogs.directoryHint",
sectionKey: "settings.sessionLogs.title",
},
{
id: "system-session-logs-format",
tab: "system",
labelKey: "settings.sessionLogs.format",
descriptionKey: "settings.sessionLogs.formatDesc",
sectionKey: "settings.sessionLogs.title",
},
{
id: "system-session-logs-timestamps",
tab: "system",
labelKey: "settings.sessionLogs.timestamps",
descriptionKey: "settings.sessionLogs.timestampsDesc",
sectionKey: "settings.sessionLogs.title",
},
{
id: "system-ssh-deep-link",
tab: "system",