Skip to content

AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.

feat: show client type in system info

tianma-if063ad8c7ad5f
diff --git a/apps/mobile/src/screens/WorkspaceScreen.tsx b/apps/mobile/src/screens/WorkspaceScreen.tsx
index c126d66f..78912037 100644
--- a/apps/mobile/src/screens/WorkspaceScreen.tsx
+++ b/apps/mobile/src/screens/WorkspaceScreen.tsx
@@ -4143,6 +4143,7 @@ const getMobileSystemInfoText = (localePreference: MobileLocaleMode) =>
? {
appIdentifier: "App identifier",
build: "Build",
+ client: "Client",
description: "View the current app version, build identifier, and runtime environment.",
disconnected: "Disconnected",
followSystem: "Follow system",
@@ -4152,8 +4153,9 @@ const getMobileSystemInfoText = (localePreference: MobileLocaleMode) =>
memoCount: "Notes",
notSet: "Not set",
notebookCount: "Notebooks",
- platform: "Platform",
- platformVersion: "Platform version",
+ platform: "System",
+ mobileApp: "Mobile app",
+ platformVersion: "System version",
timeZone: "Time zone",
title: "System info",
unknown: "Unknown",
@@ -4162,6 +4164,7 @@ const getMobileSystemInfoText = (localePreference: MobileLocaleMode) =>
: {
appIdentifier: "应用标识",
build: "构建",
+ client: "客户端",
description: "查看当前应用版本、构建标识和运行环境。",
disconnected: "未连接",
followSystem: "跟随系统",
@@ -4171,8 +4174,9 @@ const getMobileSystemInfoText = (localePreference: MobileLocaleMode) =>
memoCount: "笔记总数",
notSet: "未设置",
notebookCount: "笔记本数量",
- platform: "平台",
- platformVersion: "平台版本",
+ platform: "系统",
+ mobileApp: "移动应用",
+ platformVersion: "系统版本",
timeZone: "时区",
title: "系统信息",
unknown: "未知",
@@ -4182,11 +4186,22 @@ const getMobileSystemInfoText = (localePreference: MobileLocaleMode) =>
const getMobileSystemInfoItems = (localePreference: MobileLocaleMode) => {
const copy = getMobileSystemInfoText(localePreference);
const resolvedLocale = getResolvedMobileLocale(localePreference);
+ const platformName =
+ Platform.OS === "android"
+ ? "Android"
+ : Platform.OS === "ios"
+ ? "iOS"
+ : Platform.OS === "macos"
+ ? "macOS"
+ : Platform.OS === "windows"
+ ? "Windows"
+ : Platform.OS;
return [
{ label: copy.version, value: `v${MOBILE_APP_VERSION}` },
{ label: copy.build, value: __DEV__ ? "development" : "production" },
- { label: copy.platform, value: Platform.OS },
+ { label: copy.client, value: copy.mobileApp },
+ { label: copy.platform, value: platformName },
{ label: copy.platformVersion, value: String(Platform.Version) },
{ label: copy.language, value: localePreference === "system" ? `${resolvedLocale} (${copy.followSystem})` : resolvedLocale },
{ label: copy.timeZone, value: Intl.DateTimeFormat().resolvedOptions().timeZone || copy.unknown },
diff --git a/apps/web/src/components/settings/SystemInfoPanel.tsx b/apps/web/src/components/settings/SystemInfoPanel.tsx
index 7062ed30..505db6ce 100644
--- a/apps/web/src/components/settings/SystemInfoPanel.tsx
+++ b/apps/web/src/components/settings/SystemInfoPanel.tsx
@@ -2,6 +2,7 @@ import { useEffect, useMemo, useState } from "react";
import { ArrowUpCircle, CheckCircle2, Copy, ExternalLink } from "lucide-react";
import { useTranslation } from "react-i18next";
import { Button } from "@/components/ui/button";
+import { detectWebClientKind } from "@/lib/client-environment";
import { cn } from "@/lib/utils";
import { fetchLatestRelease, isVersionOutdated, type LatestRelease } from "@/lib/version-check";
import { copyTextToClipboard } from "./settings-utils";
@@ -37,9 +38,13 @@ const getDeploymentDescription = (t: (key: string) => string) => {
export const getWebSystemInfoItems = (t: (key: string) => string, language: string): SystemInfoItem[] => {
const timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone || t("systemInfo.unknown");
const userAgent = navigator.userAgent;
- const standalone =
- window.matchMedia("(display-mode: standalone)").matches ||
- (navigator as NavigatorWithStandalone).standalone === true;
+ const clientKind = detectWebClientKind({
+ desktopBridgeAvailable: window.edgeeverDesktop?.isAvailable === true,
+ displayModeStandalone:
+ window.matchMedia("(display-mode: standalone)").matches ||
+ window.matchMedia("(display-mode: fullscreen)").matches,
+ navigatorStandalone: (navigator as NavigatorWithStandalone).standalone === true,
+ });
return [
{ label: t("systemInfo.version"), value: `v${__EDGEEVER_APP_VERSION__}` },
@@ -50,12 +55,14 @@ export const getWebSystemInfoItems = (t: (key: string) => string, language: stri
: t("systemInfo.unknown"),
},
{ label: t("systemInfo.build"), value: __EDGEEVER_BUILD_LABEL__ },
+ { label: t("systemInfo.client"), value: t(`systemInfo.clients.${clientKind}`) },
{ label: t("systemInfo.deployment"), value: getDeploymentDescription(t) },
- { label: t("systemInfo.browser"), value: detectBrowser(userAgent) ?? t("systemInfo.unknown") },
+ ...(clientKind === "desktopApp"
+ ? []
+ : [{ label: t("systemInfo.browser"), value: detectBrowser(userAgent) ?? t("systemInfo.unknown") }]),
{ label: t("systemInfo.os"), value: detectOperatingSystem(userAgent, navigator.platform) ?? t("systemInfo.unknown") },
{ label: t("systemInfo.language"), value: navigator.language || language },
{ label: t("systemInfo.timeZone"), value: timeZone },
- { label: t("systemInfo.installMode"), value: standalone ? t("systemInfo.standalone") : t("systemInfo.browserMode") },
];
};
diff --git a/apps/web/src/lib/client-environment.test.mjs b/apps/web/src/lib/client-environment.test.mjs
new file mode 100644
index 00000000..d24a61e3
--- /dev/null
+++ b/apps/web/src/lib/client-environment.test.mjs
@@ -0,0 +1,44 @@
+import { describe, expect, test } from "bun:test";
+import { detectWebClientKind } from "./client-environment.ts";
+
+describe("web client kind detection", () => {
+ test("prefers the native desktop bridge over browser display modes", () => {
+ expect(
+ detectWebClientKind({
+ desktopBridgeAvailable: true,
+ displayModeStandalone: true,
+ navigatorStandalone: false,
+ }),
+ ).toBe("desktopApp");
+ });
+
+ test("detects installed PWAs from the display mode", () => {
+ expect(
+ detectWebClientKind({
+ desktopBridgeAvailable: false,
+ displayModeStandalone: true,
+ navigatorStandalone: false,
+ }),
+ ).toBe("pwa");
+ });
+
+ test("detects installed iOS PWAs from navigator.standalone", () => {
+ expect(
+ detectWebClientKind({
+ desktopBridgeAvailable: false,
+ displayModeStandalone: false,
+ navigatorStandalone: true,
+ }),
+ ).toBe("pwa");
+ });
+
+ test("falls back to the web client", () => {
+ expect(
+ detectWebClientKind({
+ desktopBridgeAvailable: false,
+ displayModeStandalone: false,
+ navigatorStandalone: false,
+ }),
+ ).toBe("web");
+ });
+});
diff --git a/apps/web/src/lib/client-environment.ts b/apps/web/src/lib/client-environment.ts
new file mode 100644
index 00000000..cf1370cb
--- /dev/null
+++ b/apps/web/src/lib/client-environment.ts
@@ -0,0 +1,17 @@
+export type WebClientKind = "desktopApp" | "pwa" | "web";
+
+type WebClientEnvironment = {
+ desktopBridgeAvailable: boolean;
+ displayModeStandalone: boolean;
+ navigatorStandalone: boolean;
+};
+
+export const detectWebClientKind = ({
+ desktopBridgeAvailable,
+ displayModeStandalone,
+ navigatorStandalone,
+}: WebClientEnvironment): WebClientKind => {
+ if (desktopBridgeAvailable) return "desktopApp";
+ if (displayModeStandalone || navigatorStandalone) return "pwa";
+ return "web";
+};
diff --git a/packages/shared/src/i18n/en-US.ts b/packages/shared/src/i18n/en-US.ts
index 5b8f3009..a29f3c42 100644
--- a/packages/shared/src/i18n/en-US.ts
+++ b/packages/shared/src/i18n/en-US.ts
@@ -244,6 +244,13 @@ export const enUS = {
version: "Version",
releaseTime: "Release time",
build: "Build",
+ client: "Client",
+ clients: {
+ desktopApp: "Desktop app",
+ mobileApp: "Mobile app",
+ pwa: "PWA",
+ web: "Web",
+ },
deployment: "Deployment",
deploymentTriggers: {
github_release: "GitHub Release trigger",
diff --git a/packages/shared/src/i18n/zh-CN.ts b/packages/shared/src/i18n/zh-CN.ts
index 81b73fd7..62bc7801 100644
--- a/packages/shared/src/i18n/zh-CN.ts
+++ b/packages/shared/src/i18n/zh-CN.ts
@@ -244,6 +244,13 @@ export const zhCN = {
version: "版本号",
releaseTime: "发版时间",
build: "构建",
+ client: "客户端",
+ clients: {
+ desktopApp: "桌面应用",
+ mobileApp: "移动应用",
+ pwa: "PWA",
+ web: "网页",
+ },
deployment: "自动部署方式",
deploymentTriggers: {
github_release: "正式 Release 触发",