diff --git a/web/docs/current/desktop-parity-continuation.md b/web/docs/current/desktop-parity-continuation.md index 87fe10cf..f2824878 100644 --- a/web/docs/current/desktop-parity-continuation.md +++ b/web/docs/current/desktop-parity-continuation.md @@ -59,8 +59,11 @@ - **偏好已写入 OPFS**:`shell/settings-store.ts` 基于 `parameter-storage.ts` 的 `persist/saved`,保存到 `freecad-parameters/web-preferences.json`。 实测切换单位制后文件为 98 字节、内容含 `MKS (m, kg, s, °)`;localStorage 仍作缓存。 +- **底部停靠面板**:`shell/bottom-dock.tsx` + Windows 菜单入口。 + - Selection view 显示当前选择对象;Report view 保留最近 50 条状态; + - 实测打开/切换正常,0 pageError;截图 `bottom-dock.png`。 - 说明:原生 `BaseApp/Preferences` 参数同步与单位制驱动显示待 P3; - 快捷键仍仅 localStorage。 + 快捷键仍仅 localStorage;Python 控制台尚未接入。 - 非 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/bottom-dock.png b/web/docs/current/desktop-parity-evidence/bottom-dock.png new file mode 100644 index 00000000..1d68a8d3 Binary files /dev/null and b/web/docs/current/desktop-parity-evidence/bottom-dock.png differ diff --git a/web/src/project-shell.tsx b/web/src/project-shell.tsx index 35d3df11..bdc9224a 100644 --- a/web/src/project-shell.tsx +++ b/web/src/project-shell.tsx @@ -88,6 +88,7 @@ import { ParityWorkbenchToolbars } from "./shell/workbench-toolbars.js"; import { UtilityMenus } from "./shell/utility-menus.js"; import { PreferencesDialog } from "./shell/preferences-dialog.js"; import { ShortcutEditor, ShortcutManager } from "./shell/shortcut-manager.js"; +import { BottomDock } from "./shell/bottom-dock.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"; @@ -212,6 +213,8 @@ function App() { return () => window.removeEventListener("message", receive); }, []); const [status, setStatus] = useState("Project session ready"); + const [reportLog, setReportLog] = useState([]); + const [bottomDockOpen, setBottomDockOpen] = useState(false); const [response, setResponse] = useState(null); const [importedMesh, setImportedMesh] = useState(null); const [importing, setImporting] = useState(false); @@ -316,6 +319,7 @@ function App() { const [designSnapshots, setDesignSnapshots] = useState>({}); const [workbenches, setWorkbenches] = useState>(() => initialWorkbench ? { [initialDocumentId]: initialWorkbench } : {}); const workbench = workbenches[active] ?? "Part"; + useEffect(() => { if (status) setReportLog(previous => previous[0] === status ? previous : [status, ...previous].slice(0, 50)); }, [status]); const [parityTask, setParityTask] = useState<{ module: string; command: string } | null>(null); const [preferencesOpen, setPreferencesOpen] = useState(false); const [shortcutsOpen, setShortcutsOpen] = useState(false); @@ -1907,7 +1911,7 @@ function App() { {workbench === "Part" && } - setPreferencesOpen(true)} onShortcuts={() => setShortcutsOpen(true)} /> + setPreferencesOpen(true)} onShortcuts={() => setShortcutsOpen(true)} onToggleDock={() => setBottomDockOpen(open => !open)} /> {workbench === "Part" && } {workbench !== "Part" && void executeManifestCommand(command)} />} @@ -3136,6 +3140,9 @@ function App() { onClose={() => setParityTask(null)} />} {preferencesOpen && setPreferencesOpen(false)} />} {shortcutsOpen && setShortcutsOpen(false)} />} + {bottomDockOpen && objects.find(object => String(object.properties.NativeName) === name)?.properties.Label ?? name)} + onClose={() => setBottomDockOpen(false)} />} {lineReferenceOpen && setLineReferenceOpen(false)} />}

{status}

; } diff --git a/web/src/shell/bottom-dock.tsx b/web/src/shell/bottom-dock.tsx new file mode 100644 index 00000000..81cc7b50 --- /dev/null +++ b/web/src/shell/bottom-dock.tsx @@ -0,0 +1,30 @@ +import React, { useState } from "react"; + +export function BottomDock({ selection, report, onClose }: { + selection: string[]; + report: string[]; + onClose: () => void; +}) { + const [tab, setTab] = useState<"selection" | "report">("selection"); + return
+ +
+ + + +
+
+ {tab === "selection" + ? (selection.length ? selection.map(item =>

{item}

) :

No selection

) + : (report.length ? report.map((item, index) =>

{item}

) :

No messages

)} +
+
; +} diff --git a/web/src/shell/utility-menus.tsx b/web/src/shell/utility-menus.tsx index 5db7795a..578cc9d3 100644 --- a/web/src/shell/utility-menus.tsx +++ b/web/src/shell/utility-menus.tsx @@ -1,6 +1,6 @@ import React, { useState } from "react"; -export function UtilityMenus({ onPreferences, onShortcuts }: { onPreferences: () => void; onShortcuts: () => void }) { +export function UtilityMenus({ onPreferences, onShortcuts, onToggleDock }: { onPreferences: () => void; onShortcuts: () => void; onToggleDock: () => void }) { const [open, setOpen] = useState(""); return