Skip to content

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

Revert "feat: render Evernote guide as an independent in-place route page"

tianma6eb4b3315b04
diff --git a/apps/web/src/components/SettingsPane.tsx b/apps/web/src/components/SettingsPane.tsx
index 3976a57b..72c6aa68 100644
--- a/apps/web/src/components/SettingsPane.tsx
+++ b/apps/web/src/components/SettingsPane.tsx
@@ -10,7 +10,6 @@ import { Input } from "@/components/ui/input";
import { Switch } from "@/components/ui/switch";
import { api } from "@/lib/api";
import { EVERNOTE_MIGRATION_PATH } from "@/lib/routes";
-import { Link } from "react-router";
import { cn, formatDateTime } from "@/lib/utils";
import { AppConfirmDialog } from "./dialogs/ConfirmDialogs";
@@ -76,6 +75,7 @@ interface SettingsPaneProps {
onLogout: () => void;
isLoggingOut: boolean;
authRequired: boolean;
+ onShowGuide?: () => void;
}
interface ProfileCardProps {
@@ -130,21 +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>
- <Link
- to={EVERNOTE_MIGRATION_PATH}
- 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" />
操作指引
- </Link>
- </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 批量导入。
@@ -575,6 +594,7 @@ export const SettingsPane = ({
onLogout,
isLoggingOut,
authRequired,
+ onShowGuide,
}: SettingsPaneProps) => {
const queryClient = useQueryClient();
const [name, setName] = useState("MCP Agent");
@@ -671,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}