From 6b28d9b5ee85ab5e16ac757366b32da4bbe335a2 Mon Sep 17 00:00:00 2001 From: tianma-if Date: Sun, 20 Sep 2026 00:28:43 +0800 Subject: [PATCH] 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. --- apps/desktop/src/main/desktop-update-flow.test.mjs | 2 +- .../web/src/components/settings/SystemInfoPanel.test.mjs | 4 ++-- apps/web/src/components/settings/SystemInfoPanel.tsx | 9 --------- apps/web/src/lib/system-diagnostics.ts | 3 --- packages/shared/src/i18n/en-US.ts | 1 - packages/shared/src/i18n/ja.ts | 1 - packages/shared/src/i18n/zh-CN.ts | 1 - 7 files changed, 3 insertions(+), 18 deletions(-) diff --git a/apps/desktop/src/main/desktop-update-flow.test.mjs b/apps/desktop/src/main/desktop-update-flow.test.mjs index aa9f92e4..44fa182b 100644 --- a/apps/desktop/src/main/desktop-update-flow.test.mjs +++ b/apps/desktop/src/main/desktop-update-flow.test.mjs @@ -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)"); }); diff --git a/apps/web/src/components/settings/SystemInfoPanel.test.mjs b/apps/web/src/components/settings/SystemInfoPanel.test.mjs index 231b64da..fb946edf 100644 --- a/apps/web/src/components/settings/SystemInfoPanel.test.mjs +++ b/apps/web/src/components/settings/SystemInfoPanel.test.mjs @@ -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"); diff --git a/apps/web/src/components/settings/SystemInfoPanel.tsx b/apps/web/src/components/settings/SystemInfoPanel.tsx index 4106b3ea..6d4b7fc1 100644 --- a/apps/web/src/components/settings/SystemInfoPanel.tsx +++ b/apps/web/src/components/settings/SystemInfoPanel.tsx @@ -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, - }] - : []), ], }, ]; diff --git a/apps/web/src/lib/system-diagnostics.ts b/apps/web/src/lib/system-diagnostics.ts index 43ea9d8f..65d7bf90 100644 --- a/apps/web/src/lib/system-diagnostics.ts +++ b/apps/web/src/lib/system-diagnostics.ts @@ -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