refactor(settings): remove data directory from system info panel

Remove the desktop local data directory field from the system info panel,
avoiding exposing local usernames and account hashes in screenshots or
copies, and cleaning up unused diagnostic references.
This commit is contained in:
tianma-if committed 2026-09-20 00:28:43 +08:00
1 parent 66797e6eb1
commit 6b28d9b5ee
7 files changed
+3 -18

No files matched your search

@@ -49,7 +49,7 @@ describe("desktop update flow", () => {
expect(systemInfoSource).toContain("getClientRuntimeDiagnostics");
expect(systemInfoSource).toContain('t("systemInfo.runtimeEngine")');
expect(systemInfoSource).toContain('t("systemInfo.connectionSection")');
expect(systemInfoSource).toContain('t("systemInfo.dataDirectory")');
expect(systemInfoSource).not.toContain('t("systemInfo.dataDirectory")');
expect(mainSource).toContain("dataDir: sidecarDataDirectory(activeAccountId)");
});
@@ -17,9 +17,9 @@ describe("system information client/instance version hint", () => {
});
describe("system information diagnostic fields", () => {
test("shows desktop instance URL and data directory only as local-only fields", () => {
test("shows desktop instance URL as local-only field and omits data directory", () => {
expect(source).toContain('t("systemInfo.instanceUrl")');
expect(source).toContain('t("systemInfo.dataDirectory")');
expect(source).not.toContain('t("systemInfo.dataDirectory")');
expect(source).toContain("localOnly: true");
expect(source).toContain('clientKind === "desktopApp"');
expect(source).toContain("getShareableWebSystemInfoItems");
@@ -223,15 +223,6 @@ const getWebSystemInfoGroups = (
},
{ label: t("systemInfo.language"), value: navigator.language || language, mono: true },
{ label: t("systemInfo.timeZone"), value: timeZone, mono: true, colSpan: "double-sm" },
...(clientKind === "desktopApp"
? [{
label: t("systemInfo.dataDirectory"),
value: diagnostics.clientRuntime?.dataDirectory ?? t("systemInfo.unknown"),
mono: true,
colSpan: "full" as const,
localOnly: true,
}]
: []),
],
},
];
-3
View File
@@ -7,7 +7,6 @@ export type ClientRuntimeDiagnostics = {
appVersion: string | null;
architecture: string | null;
autoUpdateSupported: boolean | null;
dataDirectory: string | null;
engine: string | null;
operatingSystem: string | null;
};
@@ -81,7 +80,6 @@ export const getClientRuntimeDiagnostics = async (): Promise<ClientRuntimeDiagno
appVersion: info.appVersion,
architecture: info.architecture === "unknown" ? null : info.architecture,
autoUpdateSupported: info.autoUpdateSupported,
dataDirectory: info.dataDir && info.dataDir !== "unknown" ? info.dataDir : null,
engine: [
info.electron === "unknown" ? null : `Electron ${info.electron}`,
info.chrome === "unknown" ? null : `Chromium ${info.chrome}`,
@@ -108,7 +106,6 @@ export const getClientRuntimeDiagnostics = async (): Promise<ClientRuntimeDiagno
appVersion: null,
architecture: architecture || null,
autoUpdateSupported: null,
dataDirectory: null,
engine: browserEngine(navigator.userAgent),
operatingSystem: browserOperatingSystem(
navigator.userAgent,
-1
View File
@@ -1191,7 +1191,6 @@ export const enUS = {
runtimeEngine: "Runtime engine",
language: "Language",
timeZone: "Time zone",
dataDirectory: "Data directory",
instanceConnection: "Instance connection",
requestLatency: "Health check time",
lastSuccessfulSync: "Last successful sync",
-1
View File
@@ -1191,7 +1191,6 @@ export const ja = {
runtimeEngine: "ランタイムエンジン",
language: "言語",
timeZone: "タイムゾーン",
dataDirectory: "データディレクトリ",
instanceConnection: "インスタンス接続",
requestLatency: "ヘルスチェック時間",
lastSuccessfulSync: "最後に成功した同期",
-1
View File
@@ -1191,7 +1191,6 @@ export const zhCN = {
runtimeEngine: "运行引擎",
language: "语言",
timeZone: "时区",
dataDirectory: "数据目录",
instanceConnection: "实例连接",
requestLatency: "健康检查耗时",
lastSuccessfulSync: "最近成功同步",