Skip to content

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

feat: render Evernote guide inside the main workspace app's right view pane

tianma7ad932bb07af
diff --git a/apps/web/src/components/EvernoteImportGuidePane.tsx b/apps/web/src/components/EvernoteImportGuidePane.tsx
index 84facd22..79d084b8 100644
--- a/apps/web/src/components/EvernoteImportGuidePane.tsx
+++ b/apps/web/src/components/EvernoteImportGuidePane.tsx
@@ -33,9 +33,9 @@ export const EvernoteImportGuidePane = ({ onClose }: { onClose: () => void }) =>
</header>
<main className="min-w-0 flex-1 overflow-x-hidden overflow-y-auto px-4 py-4 lg:px-6 lg:py-6">
- <article className="mx-auto w-full min-w-0 max-w-4xl rounded-lg border border-slate-200 bg-white p-6 shadow-sm">
+ <article className="mx-auto w-full min-w-0 max-w-4xl rounded-lg border border-slate-200 bg-white p-6 shadow-sm sm:p-8">
<div
- className="prose prose-slate max-w-none text-sm leading-6 text-slate-700 dark:prose-invert prose-headings:font-bold prose-a:text-emerald-700"
+ className="markdown-content max-w-none"
dangerouslySetInnerHTML={{ __html: htmlContent }}
/>
</article>
diff --git a/apps/web/src/components/SettingsPane.tsx b/apps/web/src/components/SettingsPane.tsx
index 9139f0c1..72c6aa68 100644
--- a/apps/web/src/components/SettingsPane.tsx
+++ b/apps/web/src/components/SettingsPane.tsx
@@ -75,6 +75,7 @@ interface SettingsPaneProps {
onLogout: () => void;
isLoggingOut: boolean;
authRequired: boolean;
+ onShowGuide?: () => void;
}
interface ProfileCardProps {
@@ -129,23 +130,40 @@ const PreferenceCard = ({ imageCompressionEnabled, onImageCompressionChange }: P
</Card>
);
-const EvernoteImportGuideCard = () => (
+interface EvernoteImportGuideCardProps {
+ onShowGuide?: () => void;
+}
+
+const EvernoteImportGuideCard = ({ onShowGuide }: EvernoteImportGuideCardProps) => (
<Card className="hidden w-full min-w-0 overflow-hidden shadow-none lg:block">
<CardHeader className="p-4">
<CardTitle className="flex items-center gap-2 text-sm">
<UploadCloud className="h-4 w-4 text-emerald-700" />
导入印象笔记
- <Button size="sm" variant="outline" className="h-7 bg-white px-2.5 text-xs" type="button" asChild>
- <a
- href={EVERNOTE_MIGRATION_PATH}
- target="_blank"
- rel="noopener noreferrer"
- aria-label="在新标签页打开印象笔记迁移操作指引"
+ {onShowGuide ? (
+ <Button
+ size="sm"
+ variant="outline"
+ className="h-7 bg-white px-2.5 text-xs gap-1"
+ type="button"
+ onClick={onShowGuide}
>
<HelpCircle className="h-3.5 w-3.5" />
操作指引
- </a>
- </Button>
+ </Button>
+ ) : (
+ <Button size="sm" variant="outline" className="h-7 bg-white px-2.5 text-xs" type="button" asChild>
+ <a
+ href={EVERNOTE_MIGRATION_PATH}
+ target="_blank"
+ rel="noopener noreferrer"
+ aria-label="在新标签页打开印象笔记迁移操作指引"
+ >
+ <HelpCircle className="h-3.5 w-3.5" />
+ 操作指引
+ </a>
+ </Button>
+ )}
</CardTitle>
<CardDescription className="text-xs leading-4">
查看从印象笔记迁移到 EdgeEver 的步骤,推荐使用 MCP 与 AI Agent 批量导入。
@@ -576,6 +594,7 @@ export const SettingsPane = ({
onLogout,
isLoggingOut,
authRequired,
+ onShowGuide,
}: SettingsPaneProps) => {
const queryClient = useQueryClient();
const [name, setName] = useState("MCP Agent");
@@ -672,7 +691,7 @@ export const SettingsPane = ({
imageCompressionEnabled={imageCompressionEnabled}
onImageCompressionChange={onImageCompressionChange}
/>
- <EvernoteImportGuideCard />
+ <EvernoteImportGuideCard onShowGuide={onShowGuide} />
<TokenCard
name={name}
onNameChange={setName}
diff --git a/apps/web/src/components/WorkspaceApp.tsx b/apps/web/src/components/WorkspaceApp.tsx
index 8cb8a328..0036d020 100644
--- a/apps/web/src/components/WorkspaceApp.tsx
+++ b/apps/web/src/components/WorkspaceApp.tsx
@@ -93,6 +93,9 @@ const EditorPane = lazy(() => import("./EditorPane").then((module) => ({ default
const AssetsPane = lazy(() => import("./AssetsPane").then((module) => ({ default: module.AssetsPane })));
const SettingsPane = lazy(() => import("./SettingsPane").then((module) => ({ default: module.SettingsPane })));
const NotebookPane = lazy(() => import("./NotebookPane").then((module) => ({ default: module.NotebookPane })));
+const EvernoteImportGuidePane = lazy(() =>
+ import("./EvernoteImportGuidePane").then((module) => ({ default: module.EvernoteImportGuidePane }))
+);
const TagsDialog = lazy(() => import("./dialogs/TagsDialog").then((module) => ({ default: module.TagsDialog })));
const TemplatesDialog = lazy(() => import("./dialogs/TemplatesDialog").then((module) => ({ default: module.TemplatesDialog })));
@@ -471,7 +474,7 @@ export const WorkspaceApp = ({
const [appNoticeDialog, setAppNoticeDialog] = useState<AppNoticeDialogState | null>(null);
const [multiSelectKeyDown, setMultiSelectKeyDown] = useState(false);
const [imageCompressionEnabled, setImageCompressionEnabled] = useState(readImageCompressionPreference);
- const [rightView, setRightView] = useState<"editor" | "settings" | "assets">(() =>
+ const [rightView, setRightView] = useState<"editor" | "settings" | "assets" | "evernote-migration">(() =>
isInitialSettingsRoute ? "settings" : "editor"
);
const [tagsOpen, setTagsOpen] = useState(false);
@@ -1721,7 +1724,7 @@ export const WorkspaceApp = ({
const shouldRenderRightPane = isDesktop || activePane === "editor";
const rightPaneLoadingLabel =
- rightView === "settings" ? "正在加载个人中心" : rightView === "assets" ? "正在加载资源库" : "正在加载编辑器";
+ rightView === "settings" ? "正在加载个人中心" : rightView === "assets" ? "正在加载资源库" : rightView === "evernote-migration" ? "正在加载迁移指引" : "正在加载编辑器";
const pullToRefreshVisible = pullToRefreshDistance > 0 || isPullRefreshing;
const pullToRefreshReady = pullToRefreshDistance >= PULL_TO_REFRESH_TRIGGER_PX;
const pullToRefreshLabel = isPullRefreshing
@@ -1941,9 +1944,12 @@ export const WorkspaceApp = ({
onLogout={onLogout}
isLoggingOut={isLoggingOut}
authRequired={authRequired}
+ onShowGuide={() => setRightView("evernote-migration")}
/>
) : rightView === "assets" ? (
<AssetsPane onClose={handleCloseAssets} />
+ ) : rightView === "evernote-migration" ? (
+ <EvernoteImportGuidePane onClose={() => setRightView("settings")} />
) : (
<EditorPane
memo={selectedMemo}
diff --git a/apps/web/src/styles/globals.css b/apps/web/src/styles/globals.css
index 56cbb740..3ce1803b 100644
--- a/apps/web/src/styles/globals.css
+++ b/apps/web/src/styles/globals.css
@@ -215,3 +215,99 @@ textarea {
scrollbar-width: thin;
scrollbar-color: rgba(100, 116, 139, 0.18) transparent;
}
+
+/* Standard Markdown Content Rendering Styles */
+.markdown-content {
+ font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
+ color: #334155;
+ line-height: 1.7;
+}
+.markdown-content h1 {
+ font-size: 1.5rem;
+ font-weight: 700;
+ color: #0f172a;
+ margin-top: 1.75rem;
+ margin-bottom: 1rem;
+ padding-bottom: 0.5rem;
+ border-bottom: 1px solid #e2e8f0;
+}
+.markdown-content h2, .markdown-content h3 {
+ font-size: 1.125rem;
+ font-weight: 700;
+ color: #0f172a;
+ margin-top: 1.75rem;
+ margin-bottom: 0.75rem;
+}
+.markdown-content h2 {
+ font-size: 1.2rem;
+ border-left: 4px solid var(--brand-green);
+ padding-left: 0.75rem;
+}
+.markdown-content p {
+ margin: 0.85rem 0;
+ font-size: 0.875rem;
+}
+.markdown-content hr {
+ margin: 2rem 0;
+ border: 0;
+ border-top: 1px solid #e2e8f0;
+}
+.markdown-content blockquote {
+ border-left: 4px solid var(--brand-green);
+ padding: 0.5rem 0 0.5rem 1rem;
+ background-color: var(--brand-green-soft);
+ color: var(--brand-green-text);
+ font-weight: 500;
+ border-radius: 0 4px 4px 0;
+ margin: 1.25rem 0;
+}
+.markdown-content ul {
+ list-style-type: disc;
+ margin: 0.75rem 0;
+ padding-left: 1.5rem;
+}
+.markdown-content ol {
+ list-style-type: decimal;
+ margin: 0.75rem 0;
+ padding-left: 1.5rem;
+}
+.markdown-content li {
+ margin: 0.35rem 0;
+ font-size: 0.875rem;
+}
+.markdown-content pre {
+ background-color: #0f172a;
+ color: #f8fafc;
+ padding: 1rem;
+ border-radius: 6px;
+ overflow-x: auto;
+ font-family: monospace;
+ font-size: 0.8rem;
+ line-height: 1.5;
+ margin: 1rem 0;
+}
+.markdown-content code {
+ font-family: monospace;
+ background-color: #f1f5f9;
+ color: #0f172a;
+ padding: 0.125rem 0.35rem;
+ border-radius: 4px;
+ font-size: 0.8rem;
+ font-weight: 600;
+}
+.markdown-content pre code {
+ background-color: transparent;
+ color: inherit;
+ padding: 0;
+ border-radius: 0;
+ font-weight: normal;
+ font-size: inherit;
+}
+.markdown-content a {
+ color: var(--brand-green-text);
+ text-decoration: underline;
+ font-weight: 500;
+}
+.markdown-content a:hover {
+ color: var(--brand-green);
+}