Skip to content

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

优化个人中心设置布局

yomab42bf8678c3d
diff --git a/apps/web/src/components/SettingsPane.tsx b/apps/web/src/components/SettingsPane.tsx
index 6f6bfc84..88157a41 100644
--- a/apps/web/src/components/SettingsPane.tsx
+++ b/apps/web/src/components/SettingsPane.tsx
@@ -1,4 +1,5 @@
import { ChevronLeft, User } from "lucide-react";
+import type { ReactNode } from "react";
import { useTranslation } from "react-i18next";
import { Button } from "@/components/ui/button";
import type { ShortcutSettings } from "@/lib/app-helpers";
@@ -25,6 +26,12 @@ interface SettingsPaneProps {
onShowGuide?: () => void;
}
+const SettingsGroup = ({ children }: { children: ReactNode }) => (
+ <div className="min-w-0 divide-y divide-slate-200 overflow-hidden rounded-xl border border-slate-200 bg-white [&>*]:rounded-none [&>*]:border-0 [&>*]:bg-transparent">
+ {children}
+ </div>
+);
+
export const SettingsPane = ({
onClose,
imageCompressionEnabled,
@@ -70,13 +77,17 @@ export const SettingsPane = ({
shortcutSettings={shortcutSettings}
onShortcutSettingsChange={onShortcutSettingsChange}
/>
- <PasswordCard authRequired={authRequired} />
<AdvancedPlayCard />
- <DataExportCard />
- <EvernoteImportGuideCard onShowGuide={onShowGuide} />
- <McpConfigCard />
- <SystemInfoCard />
- <SessionCard authRequired={authRequired} isLoggingOut={isLoggingOut} onLogout={onLogout} />
+ <SettingsGroup>
+ <DataExportCard />
+ <EvernoteImportGuideCard onShowGuide={onShowGuide} />
+ <McpConfigCard />
+ </SettingsGroup>
+ <SettingsGroup>
+ <PasswordCard authRequired={authRequired} />
+ <SystemInfoCard />
+ <SessionCard authRequired={authRequired} isLoggingOut={isLoggingOut} onLogout={onLogout} />
+ </SettingsGroup>
</div>
</div>
</div>
diff --git a/apps/web/src/components/settings/DataExportCard.tsx b/apps/web/src/components/settings/DataExportCard.tsx
index 05b4ea12..2e6c6c65 100644
--- a/apps/web/src/components/settings/DataExportCard.tsx
+++ b/apps/web/src/components/settings/DataExportCard.tsx
@@ -43,11 +43,22 @@ export const DataExportCard = () => {
<Download className="h-4 w-4 text-emerald-700" />
{t("dataExport.title")}
</CardTitle>
- <CardDescription className="text-xs leading-4">{t("dataExport.description")}</CardDescription>
</CardHeader>
<CardContent className="grid gap-3 p-4 pt-0">
- <div className="rounded-lg border border-slate-200 bg-slate-50 px-3 py-2.5 text-xs leading-5 text-slate-600">
- {t("dataExport.markdownDetails")}
+ <div className="grid gap-3 md:grid-cols-[minmax(0,1fr)_auto] md:items-center">
+ <CardDescription className="min-w-0 text-xs leading-5 md:truncate">
+ {t("dataExport.description")}
+ </CardDescription>
+ <Button
+ size="sm"
+ type="button"
+ className="w-full whitespace-nowrap md:w-auto"
+ disabled={state === "exporting"}
+ onClick={() => void handleExport()}
+ >
+ <Download className="h-4 w-4" />
+ {state === "exporting" ? t("dataExport.exportingButton") : t("dataExport.exportButton")}
+ </Button>
</div>
{state === "exporting" ? (
@@ -79,18 +90,6 @@ export const DataExportCard = () => {
</p>
) : null}
- <div className="flex justify-end">
- <Button
- size="sm"
- type="button"
- className="w-full sm:w-auto"
- disabled={state === "exporting"}
- onClick={() => void handleExport()}
- >
- <Download className="h-4 w-4" />
- {state === "exporting" ? t("dataExport.exportingButton") : t("dataExport.exportButton")}
- </Button>
- </div>
</CardContent>
</Card>
);
diff --git a/apps/web/src/components/settings/PreferenceCard.tsx b/apps/web/src/components/settings/PreferenceCard.tsx
index a818a221..371635e9 100644
--- a/apps/web/src/components/settings/PreferenceCard.tsx
+++ b/apps/web/src/components/settings/PreferenceCard.tsx
@@ -43,8 +43,8 @@ export const PreferenceCard = ({
{t("settings.preferences")}
</CardTitle>
</CardHeader>
- <CardContent className="grid gap-3 p-4 pt-0">
- <div className="flex min-h-14 flex-col items-start gap-3 rounded-lg border border-slate-100 bg-slate-50/70 px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-4">
+ <CardContent className="divide-y divide-slate-100 p-0">
+ <div className="flex min-h-16 flex-col items-start gap-3 px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-4">
<div className="min-w-0">
<div className="text-sm font-semibold text-slate-900">{t("settings.languageTitle")}</div>
<div className="mt-0.5 text-xs leading-4 text-slate-500">{t("settings.languageDescription")}</div>
@@ -69,12 +69,12 @@ export const PreferenceCard = ({
</div>
</div>
- <div className="flex min-h-14 flex-col items-start gap-3 rounded-lg border border-slate-100 bg-slate-50/70 px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-4">
+ <div className="flex min-h-16 flex-col items-start gap-3 px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-4">
<div className="min-w-0">
<div className="text-sm font-semibold text-slate-900">{t("settings.imageCompressionTitle")}</div>
<div className="mt-0.5 text-xs leading-4 text-slate-500">{t("settings.imageCompressionDescription")}</div>
</div>
- <div className="flex w-full shrink-0 justify-start sm:w-32">
+ <div className="flex w-full shrink-0 justify-start sm:w-44 sm:justify-end">
<Switch
checked={imageCompressionEnabled}
onCheckedChange={onImageCompressionChange}
diff --git a/apps/web/src/components/settings/ShortcutSettingsItem.tsx b/apps/web/src/components/settings/ShortcutSettingsItem.tsx
index 72f0b41a..8fc5f861 100644
--- a/apps/web/src/components/settings/ShortcutSettingsItem.tsx
+++ b/apps/web/src/components/settings/ShortcutSettingsItem.tsx
@@ -103,7 +103,7 @@ export const ShortcutSettingsItem = ({ shortcutSettings, onShortcutSettingsChang
return (
<>
- <div className="flex min-h-14 flex-col items-start gap-3 rounded-lg border border-slate-100 bg-slate-50/70 px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-4">
+ <div className="flex min-h-16 flex-col items-start gap-3 px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-4">
<div className="min-w-0">
<div className="flex items-center gap-2 text-sm font-semibold text-slate-900">
<Keyboard className="h-4 w-4 text-emerald-700" />
diff --git a/apps/web/src/i18n/resources/en-US.ts b/apps/web/src/i18n/resources/en-US.ts
index 93957b99..8c349c60 100644
--- a/apps/web/src/i18n/resources/en-US.ts
+++ b/apps/web/src/i18n/resources/en-US.ts
@@ -165,8 +165,7 @@ export const enUS = {
},
dataExport: {
title: "Export notes",
- description: "Export all active notes in this workspace as a Markdown ZIP archive.",
- markdownDetails: "Each note is saved as a separate Markdown file with tags, notebook, and timestamps in Front Matter. Images and attachments are stored in a matching .assets folder and referenced with relative paths. Notes in Trash are excluded.",
+ description: "Export active notes as a Markdown ZIP with Front Matter and .assets attachments; Trash is excluded.",
exportButton: "Export Markdown ZIP",
exportingButton: "Exporting",
exporting: "Preparing notes and attachments…",
diff --git a/apps/web/src/i18n/resources/zh-CN.ts b/apps/web/src/i18n/resources/zh-CN.ts
index 91f2f3e9..1fd02b0e 100644
--- a/apps/web/src/i18n/resources/zh-CN.ts
+++ b/apps/web/src/i18n/resources/zh-CN.ts
@@ -165,8 +165,7 @@ export const zhCN = {
},
dataExport: {
title: "导出笔记",
- description: "将当前工作区中的全部有效笔记导出为 Markdown ZIP。",
- markdownDetails: "每篇笔记会保存为独立的 Markdown 文件,标签、笔记本和时间信息写入 Front Matter;图片与附件保存在对应的 .assets 文件夹中,并使用相对路径引用。回收站中的笔记不会导出。",
+ description: "将当前工作区中的有效笔记导出为 Markdown ZIP,元数据写入 Front Matter,附件存入 .assets,不含回收站内容。",
exportButton: "导出 Markdown ZIP",
exportingButton: "正在导出",
exporting: "正在整理笔记和附件…",