AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.
HTML ai-agentcloudflarecloudflare-d1cloudflare-r2cloudflare-workersdockerelectronevernoteevernote-alternativeknowledge-basemcpnote-takingobsidian-alternativeoffline-firstpersonal-knowledge-basepwaself-hostedsqlitetiptapweb-clipper
refactor(web): move plugin menu to workspace shortcuts
tianma-if2458cb51ad78
diff --git a/apps/web/src/components/EditorPane.tsx b/apps/web/src/components/EditorPane.tsxindex 923e9180..61941200 100644--- a/apps/web/src/components/EditorPane.tsx+++ b/apps/web/src/components/EditorPane.tsx@@ -238,7 +238,6 @@ import { getEditorScrollProgress, restoreEditorScrollProgress } from "./editor/eimport { useEditorSaveStatus } from "./editor/useEditorSaveStatus";import { resolveEditorDraftState } from "./editor/editor-draft-state";import type { EdgeEverPluginHost, PluginEditorAdapter } from "@/lib/plugins/plugin-host";-import { PluginToolbarMenu } from "@/components/plugins/PluginToolbarMenu";import {useEditorResourceActions,type AttachmentMenuTarget,@@ -272,12 +271,8 @@ const IconTooltip = ({ label, children }: { label: string; children: ReactNode }</TooltipProvider>);-const EmptyEditorHeader = ({ pluginHost, onOpenPluginManager }: {- pluginHost: EdgeEverPluginHost;- onOpenPluginManager: () => void;-}) => (+const EmptyEditorHeader = () => (<header className="hidden h-12 shrink-0 items-center justify-end gap-1 border-b border-slate-100 px-5 lg:flex">- <PluginToolbarMenu host={pluginHost} onManage={onOpenPluginManager} /><ThemeToggle /></header>);@@ -701,7 +696,6 @@ type EditorPaneProps = {onOpenMemo?: (memoId: string) => void;onOpenAiPrompts?: () => void;pluginHost: EdgeEverPluginHost;- onOpenPluginManager: () => void;};type RichEditorPaneProps = EditorPaneProps & {@@ -775,7 +769,6 @@ const RichEditorPane = ({onOpenMemo,onOpenAiPrompts,pluginHost,- onOpenPluginManager,onRequestMobileNativeEdit,}: RichEditorPaneProps) => {const { t, i18n } = useTranslation();@@ -3857,7 +3850,7 @@ const RichEditorPane = ({if (isLoading && !memo) {return (<div className="flex h-full min-w-0 flex-col bg-white">- <EmptyEditorHeader pluginHost={pluginHost} onOpenPluginManager={onOpenPluginManager} />+ <EmptyEditorHeader />{selectionActionBar}<div className="flex min-h-0 flex-1 items-center justify-center text-sm text-slate-500">{t("editor.loading")}</div></div>@@ -3867,7 +3860,7 @@ const RichEditorPane = ({if (!memo) {return (<div className="flex h-full min-w-0 flex-col bg-white">- <EmptyEditorHeader pluginHost={pluginHost} onOpenPluginManager={onOpenPluginManager} />+ <EmptyEditorHeader />{selectionActionBar}<div className="flex min-h-0 flex-1 items-center justify-center px-8 text-center"><div>@@ -4401,7 +4394,6 @@ const RichEditorPane = ({{deployedUpdateUnseen ? <span className="absolute right-1 top-1 h-1.5 w-1.5 rounded-full bg-emerald-500 ring-2 ring-white" /> : null}</Button></IconTooltip>- <PluginToolbarMenu host={pluginHost} onManage={onOpenPluginManager} /><ThemeToggle />{!effectiveReadOnly && (<IconTooltip label={t("editor.save")}>diff --git a/apps/web/src/components/NotebookPane.tsx b/apps/web/src/components/NotebookPane.tsxindex c9bf7a15..a925627d 100644--- a/apps/web/src/components/NotebookPane.tsx+++ b/apps/web/src/components/NotebookPane.tsx@@ -51,8 +51,10 @@ import {writeNotebookSortPreference,} from "@/lib/app-helpers";import type { EdgeEverRepository } from "@/lib/repository";+import type { EdgeEverPluginHost } from "@/lib/plugins/plugin-host";import { statusSettleMotion } from "@/lib/motion";import { DesktopUpdateNotice } from "./DesktopUpdateNotice";+import { PluginToolbarMenu } from "./plugins/PluginToolbarMenu";const DesktopSyncIssuesDialog = lazy(() => import("./DesktopSyncIssuesDialog").then((module) => ({ default: module.DesktopSyncIssuesDialog })));@@ -347,6 +349,8 @@ export const NotebookPane = ({onOpenTags,onOpenAssets,onOpenTemplates,+ pluginHost,+ onOpenPluginManager,onOpenTrash,onEmptyTrash,onOpenSettings,@@ -381,6 +385,8 @@ export const NotebookPane = ({onOpenTags: () => void;onOpenAssets: () => void;onOpenTemplates: () => void;+ pluginHost: EdgeEverPluginHost;+ onOpenPluginManager: () => void;onOpenTrash: () => void;onEmptyTrash: () => void;onOpenSettings: () => void;@@ -516,10 +522,16 @@ export const NotebookPane = ({</header><TooltipProvider delayDuration={0} skipDelayDuration={0}>- <nav className="grid shrink-0 grid-cols-2 gap-0.5 border-b border-slate-100 px-2 py-1.5 sm:grid-cols-3 lg:grid-cols-4" aria-label={t("notebookPane.secondaryEntries")}>+ <nav className="grid shrink-0 grid-cols-2 gap-0.5 border-b border-slate-100 px-2 py-1.5 sm:grid-cols-3 lg:grid-cols-5" aria-label={t("notebookPane.secondaryEntries")}><SidebarShortcutButton icon={<Tags className="h-4 w-4" />} label={t("mobileSheets.tags")} onClick={onOpenTags} /><SidebarShortcutButton icon={<Archive className="h-4 w-4" />} label={t("mobileSheets.assets")} onClick={onOpenAssets} />{showTemplateEntry && <SidebarShortcutButton icon={<LayoutTemplate className="h-4 w-4" />} label={t("nav.templates")} onClick={onOpenTemplates} />}+ <PluginToolbarMenu+ host={pluginHost}+ onManage={onOpenPluginManager}+ align="start"+ className="h-9 w-full rounded-md px-0 text-slate-600"+ /><SidebarTrashShortcut active={view === "trash"} onOpenTrash={onOpenTrash} onEmptyTrash={onEmptyTrash} /></nav></TooltipProvider>diff --git a/apps/web/src/components/SettingsPane.tsx b/apps/web/src/components/SettingsPane.tsxindex d5607cf8..086b6ead 100644--- a/apps/web/src/components/SettingsPane.tsx+++ b/apps/web/src/components/SettingsPane.tsx@@ -37,8 +37,6 @@ import { AiTagSuggestionPromptCard } from "./settings/AiTagSuggestionPromptCard"import { ThemeToggle } from "./ThemeToggle";import type { AuthUser } from "@edgeever/shared";import { contentEnterMotion } from "@/lib/motion";-import type { EdgeEverPluginHost } from "@/lib/plugins/plugin-host";-import { PluginToolbarMenu } from "./plugins/PluginToolbarMenu";import { useDeployedUpdateNotice } from "@/hooks/useDeployedUpdateNotice";interface SettingsPaneProps {@@ -60,8 +58,6 @@ interface SettingsPaneProps {isOwner: boolean;user: AuthUser | null;refreshWorkspaceAfterImport: () => Promise<void>;- pluginHost: EdgeEverPluginHost;- onOpenPluginMarketplace: () => void;}// Slate and brand color variables already switch values with the root theme.@@ -103,8 +99,6 @@ export const SettingsPane = ({isOwner,user,refreshWorkspaceAfterImport,- pluginHost,- onOpenPluginMarketplace,}: SettingsPaneProps) => {const { t } = useTranslation();const [activeTab, setActiveTab] = useState<TabKey>("general");@@ -295,10 +289,6 @@ export const SettingsPane = ({</div></div><div className="flex items-center gap-1">- <PluginToolbarMenu- host={pluginHost}- onManage={onOpenPluginMarketplace}- /><ThemeToggle className="inline-flex" showLabel /></div></header>diff --git a/apps/web/src/components/WorkspaceApp.tsx b/apps/web/src/components/WorkspaceApp.tsxindex 0911ffae..63389c38 100644--- a/apps/web/src/components/WorkspaceApp.tsx+++ b/apps/web/src/components/WorkspaceApp.tsx@@ -2921,6 +2921,8 @@ export const WorkspaceApp = ({onOpenAssets={handleOpenAssets}onOpenTags={handleOpenTags}onOpenTemplates={handleOpenTemplates}+ pluginHost={pluginHost}+ onOpenPluginManager={handleOpenPluginManager}onOpenSettings={handleOpenSettings}onOpenTrash={() => {navigateWorkspaceTrash();@@ -3113,8 +3115,6 @@ export const WorkspaceApp = ({refreshWorkspaceAfterImport={async () => {await refreshWorkspaceFromServer("manual");}}- pluginHost={pluginHost}- onOpenPluginMarketplace={handleOpenPluginManager}/>) : rightView === "plugins" ? (<PluginMarketplacePane host={pluginHost} onClose={handleClosePluginMarketplace} />@@ -3156,7 +3156,6 @@ export const WorkspaceApp = ({memo={selectedMemo}repository={repository}pluginHost={pluginHost}- onOpenPluginManager={handleOpenPluginManager}onOpenAiPrompts={handleOpenAiPrompts}desktopFocusMode={desktopFocusModeActive}onToggleDesktopFocusMode={toggleDesktopFocusMode}diff --git a/apps/web/src/components/plugins/PluginToolbarMenu.tsx b/apps/web/src/components/plugins/PluginToolbarMenu.tsxindex 9184eeb1..ff21c8d1 100644--- a/apps/web/src/components/plugins/PluginToolbarMenu.tsx+++ b/apps/web/src/components/plugins/PluginToolbarMenu.tsx@@ -12,6 +12,7 @@ import {} from "@/components/ui/dropdown-menu";import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip";import { PluginPanelDialog } from "@/components/plugins/PluginPanelDialog";+import { cn } from "@/lib/utils";import type {EdgeEverPluginHost,RegisteredPluginAction,@@ -20,9 +21,11 @@ import type {const actionKey = (action: RegisteredPluginAction) => `${action.type}:${action.pluginId}:${action.id}`;-export const PluginToolbarMenu = ({ host, onManage }: {+export const PluginToolbarMenu = ({ host, onManage, align = "end", className }: {host: EdgeEverPluginHost;onManage: () => void;+ align?: "start" | "center" | "end";+ className?: string;}) => {const { t } = useTranslation();const snapshot = useSyncExternalStore(host.subscribe, host.getSnapshot, host.getSnapshot);@@ -109,7 +112,7 @@ export const PluginToolbarMenu = ({ host, onManage }: {<TooltipTrigger asChild><DropdownMenuTrigger asChild><Button- className="relative hidden h-8 w-8 text-slate-500 hover:bg-slate-100 hover:text-slate-950 focus-visible:ring-2 focus-visible:ring-emerald-500/70 lg:inline-flex"+ className={cn("relative hidden h-8 w-8 text-slate-500 hover:bg-slate-100 hover:text-slate-950 focus-visible:ring-2 focus-visible:ring-emerald-500/70 lg:inline-flex", className)}size="icon"variant="ghost"aria-label={t("plugins.toolbar.open")}@@ -122,7 +125,7 @@ export const PluginToolbarMenu = ({ host, onManage }: {<TooltipContent side="bottom">{t("plugins.toolbar.open")}</TooltipContent></Tooltip></TooltipProvider>- <DropdownMenuContent align="end" className="w-72">+ <DropdownMenuContent align={align} className="w-72">{snapshot.recentActions.length ? (<><DropdownMenuLabel className="flex items-center gap-2 text-xs text-slate-500">diff --git a/docs/plugin-development.md b/docs/plugin-development.mdindex bd4693f3..08689a87 100644--- a/docs/plugin-development.md+++ b/docs/plugin-development.md@@ -220,7 +220,7 @@ context.ui.panels.register({## Desktop plugin entry-After a plugin is enabled, a unified puzzle button appears in the top-right of the desktop editor and settings page. Its menu groups commands and panels by plugin, keeps recently used actions at the top, and links directly to extension management. Individual plugins do not each consume a toolbar icon.+After a plugin is enabled, a unified puzzle button appears in the desktop workspace shortcuts on the left. Its menu groups commands and panels by plugin, keeps recently used actions at the top, and links directly to extension management. Individual plugins do not each consume a toolbar icon.## Theme manifestdiff --git a/docs/plugin-development.zh-CN.md b/docs/plugin-development.zh-CN.mdindex da2bd079..caf5f06c 100644--- a/docs/plugin-development.zh-CN.md+++ b/docs/plugin-development.zh-CN.md@@ -220,7 +220,7 @@ context.ui.panels.register({## 桌面端插件入口-启用插件后,桌面端编辑器和个人中心右上角会显示统一的拼图入口。菜单按插件分组展示命令和面板,并在顶部保留最近使用的操作;“管理插件与主题”会直接打开独立插件市场页面。插件不会各自在工具栏占用一个图标。+启用插件后,桌面端左侧工作区快捷栏会显示统一的拼图入口。菜单按插件分组展示命令和面板,并在顶部保留最近使用的操作;“管理插件与主题”会直接打开独立插件市场页面。插件不会各自在工具栏占用一个图标。## 主题 Manifest