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 as an independent in-place route page

tianma746025297330
diff --git a/apps/web/src/components/SettingsPane.tsx b/apps/web/src/components/SettingsPane.tsx
index 72c6aa68..3976a57b 100644
--- a/apps/web/src/components/SettingsPane.tsx
+++ b/apps/web/src/components/SettingsPane.tsx
@@ -10,6 +10,7 @@ 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";
@@ -75,7 +76,6 @@ interface SettingsPaneProps {
onLogout: () => void;
isLoggingOut: boolean;
authRequired: boolean;
- onShowGuide?: () => void;
}
interface ProfileCardProps {
@@ -130,40 +130,21 @@ const PreferenceCard = ({ imageCompressionEnabled, onImageCompressionChange }: P
</Card>
);
-interface EvernoteImportGuideCardProps {
- onShowGuide?: () => void;
-}
-
-const EvernoteImportGuideCard = ({ onShowGuide }: EvernoteImportGuideCardProps) => (
+const EvernoteImportGuideCard = () => (
<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" />
导入印象笔记
- {onShowGuide ? (
- <Button
- size="sm"
- variant="outline"
- className="h-7 bg-white px-2.5 text-xs gap-1"
- type="button"
- onClick={onShowGuide}
+ <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="打开印象笔记迁移操作指引"
>
<HelpCircle className="h-3.5 w-3.5" />
操作指引
- </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>
- )}
+ </Link>
+ </Button>
</CardTitle>
<CardDescription className="text-xs leading-4">
查看从印象笔记迁移到 EdgeEver 的步骤,推荐使用 MCP 与 AI Agent 批量导入。
@@ -594,7 +575,6 @@ export const SettingsPane = ({
onLogout,
isLoggingOut,
authRequired,
- onShowGuide,
}: SettingsPaneProps) => {
const queryClient = useQueryClient();
const [name, setName] = useState("MCP Agent");
@@ -691,7 +671,7 @@ export const SettingsPane = ({
imageCompressionEnabled={imageCompressionEnabled}
onImageCompressionChange={onImageCompressionChange}
/>
- <EvernoteImportGuideCard onShowGuide={onShowGuide} />
+ <EvernoteImportGuideCard />
<TokenCard
name={name}
onNameChange={setName}
diff --git a/apps/web/src/components/WorkspaceApp.tsx b/apps/web/src/components/WorkspaceApp.tsx
index 0036d020..8cb8a328 100644
--- a/apps/web/src/components/WorkspaceApp.tsx
+++ b/apps/web/src/components/WorkspaceApp.tsx
@@ -93,9 +93,6 @@ 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 })));
@@ -474,7 +471,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" | "evernote-migration">(() =>
+ const [rightView, setRightView] = useState<"editor" | "settings" | "assets">(() =>
isInitialSettingsRoute ? "settings" : "editor"
);
const [tagsOpen, setTagsOpen] = useState(false);
@@ -1724,7 +1721,7 @@ export const WorkspaceApp = ({
const shouldRenderRightPane = isDesktop || activePane === "editor";
const rightPaneLoadingLabel =
- rightView === "settings" ? "正在加载个人中心" : rightView === "assets" ? "正在加载资源库" : rightView === "evernote-migration" ? "正在加载迁移指引" : "正在加载编辑器";
+ rightView === "settings" ? "正在加载个人中心" : rightView === "assets" ? "正在加载资源库" : "正在加载编辑器";
const pullToRefreshVisible = pullToRefreshDistance > 0 || isPullRefreshing;
const pullToRefreshReady = pullToRefreshDistance >= PULL_TO_REFRESH_TRIGGER_PX;
const pullToRefreshLabel = isPullRefreshing
@@ -1944,12 +1941,9 @@ 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}