Skip to content

armgit / dbx

Public Imported from GitHub
0

25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。

fix(settings): index the HTTP tunnel protocol label (#12903)

ordinary being5e8988619448
diff --git a/apps/desktop/src/lib/settings/__tests__/settingsSearchCoverage.spec.ts b/apps/desktop/src/lib/settings/__tests__/settingsSearchCoverage.spec.ts
index 002eff8360..862aa1a9a3 100644
--- a/apps/desktop/src/lib/settings/__tests__/settingsSearchCoverage.spec.ts
+++ b/apps/desktop/src/lib/settings/__tests__/settingsSearchCoverage.spec.ts
@@ -1,5 +1,5 @@
import { readFileSync } from "node:fs";
-import { dirname, resolve, relative } from "node:path";
+import { dirname, resolve, relative, sep } from "node:path";
import { fileURLToPath } from "node:url";
import { parse } from "vue/compiler-sfc";
import { describe, expect, it } from "vitest";
@@ -14,6 +14,11 @@ import { APP_CUSTOM_UI_COLOR_DEFS } from "@/lib/app/appTheme";
const src = resolve(dirname(fileURLToPath(import.meta.url)), "../../..");
const root = resolve(src, "components/editor/EditorSettingsDialog.vue");
+/** Findings key with POSIX separators so the expectations stay stable on Windows. */
+function relativePosix(file: string): string {
+ return relative(src, file).split(sep).join("/");
+}
+
// These dialogs display transient operations or release notes, not persisted settings.
// UI primitives and decorative icons are excluded by directory, not by control label.
const excludedComponents: Record<string, string> = {
@@ -100,7 +105,7 @@ function inspectSettingsTemplates(entry: string): Map<string, Set<string>> {
const expression = expressions(node).trim().replace(/\s+/g, " ");
const translated = translationKeys(expression);
translated.forEach((key) => keys.add(key));
- if (expression && !translated.length && !auditedNonLiteralLabels[expression]) unauditedLabels.push(`${relative(src, file)}: ${expression}`);
+ if (expression && !translated.length && !auditedNonLiteralLabels[expression]) unauditedLabels.push(`${relativePosix(file)}: ${expression}`);
}
// Buttons with configuration roles are settings, not ordinary action buttons.
const role = node.props?.find((prop) => prop.name === "role")?.value?.content;
@@ -131,7 +136,7 @@ function inspectSettingsTemplates(entry: string): Map<string, Set<string>> {
if (!ruleEnums) throw new Error("Formatter rule enum source is missing");
for (const match of ruleEnums.matchAll(/["']([^"']+)["']/g)) keys.add(`settings.sqlFormatterRule_${match[1]}`);
}
- findings.set(relative(src, file), keys);
+ findings.set(relativePosix(file), keys);
for (const component of components) {
if (excludedComponents[component]) continue;
const importPath = imports.get(component)!;
diff --git a/apps/desktop/src/lib/settings/settingsSearch.ts b/apps/desktop/src/lib/settings/settingsSearch.ts
index 169cfeb9e5..b9e2e89672 100644
--- a/apps/desktop/src/lib/settings/settingsSearch.ts
+++ b/apps/desktop/src/lib/settings/settingsSearch.ts
@@ -563,7 +563,6 @@ export const SETTINGS_SEARCH_DEFINITIONS: readonly SettingsSearchDefinition[] =
"connection.httpTunnelProtocolDbx",
"connection.httpTunnelProtocolNavicat",
"connection.httpTunnelUrl",
- "connection.httpTunnelProtocol",
"connection.httpTunnelToken",
"connection.httpTunnelConnectTimeout",
],