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 current account in settings

tianma-if3df54fcc92af
diff --git a/apps/mobile/src/screens/WorkspaceScreen.tsx b/apps/mobile/src/screens/WorkspaceScreen.tsx
index 67e4f7c7..3c6a5454 100644
--- a/apps/mobile/src/screens/WorkspaceScreen.tsx
+++ b/apps/mobile/src/screens/WorkspaceScreen.tsx
@@ -1936,6 +1936,18 @@ const SettingsView = ({
}
return (
<View style={styles.settingsDetailList}>
+ <View style={styles.accountSummaryCard}>
+ <View style={styles.accountSummaryIcon}>
+ <UserRound color="#047857" size={19} />
+ </View>
+ <View style={styles.accountSummaryContent}>
+ <Text style={styles.accountSummaryTitle}>{translate("当前账户")}</Text>
+ <Text style={styles.accountSummaryName}>{currentUser?.displayName || currentUser?.username || "—"}</Text>
+ <Text style={styles.accountSummaryHelp}>
+ @{currentUser?.username ?? "—"} · {currentUser?.role === "owner" ? translate("实例管理员") : translate("成员")}
+ </Text>
+ </View>
+ </View>
<View style={styles.settingsGroup}>
<AccountSecurityPanel active currentUser={currentUser} section="password" />
</View>
@@ -6225,6 +6237,45 @@ const baseWorkspaceStyles = StyleSheet.create({
settingsDetailList: {
gap: 16,
},
+ accountSummaryCard: {
+ alignItems: "center",
+ backgroundColor: "#ffffff",
+ borderColor: "#e2e8f0",
+ borderRadius: 12,
+ borderWidth: 1,
+ flexDirection: "row",
+ gap: 12,
+ padding: 16,
+ },
+ accountSummaryIcon: {
+ alignItems: "center",
+ backgroundColor: "#ecfdf5",
+ borderRadius: 999,
+ height: 40,
+ justifyContent: "center",
+ width: 40,
+ },
+ accountSummaryContent: {
+ flex: 1,
+ minWidth: 0,
+ },
+ accountSummaryHelp: {
+ color: "#64748b",
+ fontSize: 12,
+ lineHeight: 18,
+ marginTop: 3,
+ },
+ accountSummaryTitle: {
+ color: "#64748b",
+ fontSize: 12,
+ fontWeight: "700",
+ },
+ accountSummaryName: {
+ color: "#0f172a",
+ fontSize: 15,
+ fontWeight: "800",
+ marginTop: 2,
+ },
settingsGroup: {
backgroundColor: "#ffffff",
borderColor: "#e2e8f0",
diff --git a/apps/web/src/components/SettingsPane.tsx b/apps/web/src/components/SettingsPane.tsx
index 86c10f7b..fe7d28f9 100644
--- a/apps/web/src/components/SettingsPane.tsx
+++ b/apps/web/src/components/SettingsPane.tsx
@@ -16,6 +16,7 @@ import type { ShortcutSettings } from "@/lib/app-helpers";
import { WORKSPACE_PAGE_TITLE_CLASSNAME } from "@/lib/workspace-ui";
import { cn } from "@/lib/utils";
import { AdvancedPlayCard } from "./settings/AdvancedPlayCard";
+import { AccountInfoCard } from "./settings/AccountInfoCard";
import { DataExportCard } from "./settings/DataExportCard";
import { LoginDevicesCard } from "./settings/LoginDevicesCard";
import { EvernoteImportGuideCard } from "./settings/EvernoteImportGuideCard";
@@ -26,6 +27,7 @@ import { PasswordCard } from "./settings/PasswordCard";
import { SessionCard } from "./settings/SessionCard";
import { UserManagementCard } from "./settings/UserManagementCard";
import { ThemeToggle } from "./ThemeToggle";
+import type { AuthUser } from "@edgeever/shared";
interface SettingsPaneProps {
onClose: () => void;
@@ -41,6 +43,7 @@ interface SettingsPaneProps {
authRequired: boolean;
demoMode: boolean;
isOwner: boolean;
+ user: AuthUser | null;
}
// Slate and brand color variables already switch values with the root theme.
@@ -77,6 +80,7 @@ export const SettingsPane = ({
authRequired,
demoMode,
isOwner,
+ user,
}: SettingsPaneProps) => {
const { t } = useTranslation();
const [activeTab, setActiveTab] = useState<TabKey>("general");
@@ -205,6 +209,7 @@ export const SettingsPane = ({
case "account":
return (
<SettingsGroup>
+ <AccountInfoCard user={user} />
<PasswordCard authRequired={authRequired} demoMode={demoMode} />
{demoMode ? null : <LoginDevicesCard authRequired={authRequired} />}
<SessionCard authRequired={authRequired} isLoggingOut={isLoggingOut} onLogout={onLogout} />
diff --git a/apps/web/src/components/WorkspaceApp.tsx b/apps/web/src/components/WorkspaceApp.tsx
index 8c163b0b..4c10f68e 100644
--- a/apps/web/src/components/WorkspaceApp.tsx
+++ b/apps/web/src/components/WorkspaceApp.tsx
@@ -2723,6 +2723,7 @@ export const WorkspaceApp = ({
authRequired={authRequired}
demoMode={demoMode}
isOwner={authRequired && user?.role === "owner"}
+ user={user}
/>
) : rightView === "assets" ? (
<AssetsPane onClose={handleCloseAssets} activeMemo={selectedMemo} />
diff --git a/apps/web/src/components/settings/AccountInfoCard.tsx b/apps/web/src/components/settings/AccountInfoCard.tsx
new file mode 100644
index 00000000..d756797f
--- /dev/null
+++ b/apps/web/src/components/settings/AccountInfoCard.tsx
@@ -0,0 +1,35 @@
+import { UserRound } from "lucide-react";
+import type { AuthUser } from "@edgeever/shared";
+import { useTranslation } from "react-i18next";
+import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
+
+export const AccountInfoCard = ({ user }: { user: AuthUser | null }) => {
+ const { t } = useTranslation();
+
+ if (!user) return null;
+
+ return (
+ <Card className="w-full min-w-0 overflow-hidden shadow-none">
+ <CardHeader className="p-4">
+ <CardTitle className="flex items-center gap-2 text-sm">
+ <UserRound className="h-4 w-4 text-emerald-700" />
+ {t("accountInfo.title")}
+ </CardTitle>
+ <CardDescription>{t("accountInfo.description")}</CardDescription>
+ </CardHeader>
+ <CardContent className="flex items-center gap-3 p-4 pt-0">
+ <div className="flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-emerald-50 text-emerald-700">
+ <UserRound className="h-5 w-5" />
+ </div>
+ <div className="min-w-0">
+ <p className="truncate text-sm font-semibold text-slate-800">
+ {user.displayName || user.username}
+ </p>
+ <p className="truncate text-xs text-slate-500">
+ @{user.username} · {t(`users.roles.${user.role}`)}
+ </p>
+ </div>
+ </CardContent>
+ </Card>
+ );
+};
diff --git a/packages/shared/src/i18n/en-US.ts b/packages/shared/src/i18n/en-US.ts
index 4883cae4..e1fe6c99 100644
--- a/packages/shared/src/i18n/en-US.ts
+++ b/packages/shared/src/i18n/en-US.ts
@@ -208,6 +208,10 @@ export const enUS = {
account: "Login Settings",
},
},
+ accountInfo: {
+ title: "Current account",
+ description: "The account currently signed in on this device.",
+ },
systemInfo: {
title: "System info",
description: "View the current app version, build identifier, and runtime environment.",
diff --git a/packages/shared/src/i18n/zh-CN.ts b/packages/shared/src/i18n/zh-CN.ts
index 1ee01575..e45d33f8 100644
--- a/packages/shared/src/i18n/zh-CN.ts
+++ b/packages/shared/src/i18n/zh-CN.ts
@@ -208,6 +208,10 @@ export const zhCN = {
account: "登录设置",
},
},
+ accountInfo: {
+ title: "当前账户",
+ description: "当前设备正在登录的账户信息。",
+ },
systemInfo: {
title: "系统信息",
description: "查看当前应用版本、构建标识和运行环境。",