diff --git a/web/docs/current/desktop-parity-continuation.md b/web/docs/current/desktop-parity-continuation.md index 8c3e7963..f93e089d 100644 --- a/web/docs/current/desktop-parity-continuation.md +++ b/web/docs/current/desktop-parity-continuation.md @@ -45,6 +45,10 @@ - 选中 BIM 后菜单显示 2D Drafting / 3D/BIM / Annotation / Manage / Flamingo / Fasteners / Utils;截图 `BIM-web-menu.png`; - Part 回归审计仍 0 错误/0 溢出。 +- **非 Part 工具栏已接入**:`web/src/shell/workbench-toolbars.tsx` + + `toolbar.tsx` 渲染 manifest 工具栏并复用 TaskFrame 回调。 + BIM 实测 8 组工具栏 / 73 个按钮,0 pageError、0 溢出; + 截图 `BIM-toolbars.png`。命令标签部分仍是原始 ID(缺元数据),后续补。 - 非 Part 菜单命令改为打开 **React TaskFrame 模态**(`web/src/shell/task-frame.tsx`), iframe 复用 `/workbench.html?module=&command=` 的现有任务面板; BIM_TogglePanels 实测弹出 "Bottom panels" 任务并可点按钮,0 pageError; diff --git a/web/docs/current/desktop-parity-evidence/BIM-toolbars.png b/web/docs/current/desktop-parity-evidence/BIM-toolbars.png new file mode 100644 index 00000000..e78dbbbc Binary files /dev/null and b/web/docs/current/desktop-parity-evidence/BIM-toolbars.png differ diff --git a/web/src/project-shell.tsx b/web/src/project-shell.tsx index e3273595..79f42a13 100644 --- a/web/src/project-shell.tsx +++ b/web/src/project-shell.tsx @@ -84,6 +84,7 @@ import { mountQueueRecoveryPanel } from "./queue-recovery-panel.js"; import { PartDesignWorkspace } from "./partdesign-workspace-component.js"; import { ParityWorkbenchMenu } from "./shell/workbench-menu.js"; import { TaskFrame } from "./shell/task-frame.js"; +import { ParityWorkbenchToolbars } from "./shell/workbench-toolbars.js"; import { DocumentTree, type DocumentTreeNode } from "./document-tree.js"; import { PARTDESIGN_DOCUMENT_COMMAND, PARTDESIGN_DOCUMENT_SCHEMA, type DesignAction, type DesignPayload, type DesignResult } from "./partdesign-document-facade.js"; @@ -1948,6 +1949,7 @@ function App() { void startParameters(router, { LastModule: `${next}Workbench` }, true).catch(error => setStatus(String(error))); }}> + {csvPanel && document.id === csvPanel.id)?.objects ?? {}).filter(object => object.type === "Spreadsheet::Sheet").map(object => ({ name: String(object.properties.NativeName), label: String(object.properties.Label) }))} onCancel={() => { csvPanel.done({ cancelled: true }); setCsvPanel(null); }} diff --git a/web/src/shell/workbench-toolbars.tsx b/web/src/shell/workbench-toolbars.tsx new file mode 100644 index 00000000..a2272348 --- /dev/null +++ b/web/src/shell/workbench-toolbars.tsx @@ -0,0 +1,25 @@ +import React, { useEffect, useState } from "react"; +import { DesktopToolbars } from "./toolbar.js"; +import { loadDesktopManifest, workbenchById, type DesktopManifest, type DesktopWorkbench } from "./command-registry.js"; + +export function ParityWorkbenchToolbars({ workbench, onCommand }: { + workbench: string; + onCommand: (id: string) => void; +}) { + const [manifest, setManifest] = useState(null); + const [desktop, setDesktop] = useState(null); + useEffect(() => { + if (workbench === "Part") return; + let cancelled = false; + loadDesktopManifest().then(data => { + if (cancelled) return; + setManifest(data); + setDesktop(workbenchById(data, workbench) ?? null); + }).catch(() => { if (!cancelled) setDesktop(null); }); + return () => { cancelled = true; }; + }, [workbench]); + if (workbench === "Part" || !manifest || !desktop) return null; + return
+ +
; +}