From 7d906f180928623c02b965c28f5a391962e53413 Mon Sep 17 00:00:00 2001 From: wangdequan Date: Mon, 15 Jun 2026 06:25:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E8=BF=9B=20INI=20=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=20launch=20API=20manifest?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- text12.txt | 77 +++++++++++++++++++ wasm-port/docs/panel-entry.md | 5 ++ wasm-port/runtime/ui/ini-panel/launch.html | 1 + wasm-port/runtime/ui/ini-panel/ui-shell.js | 22 ++++++ .../tests/browser/ini_panel_launch_smoke.html | 34 +++++++- .../ui/node/verify_ini_panel_entry_docs.mjs | 7 ++ ..._ini_panel_shell_control_page_contract.mjs | 2 + .../ui/node/verify_ini_panel_ui_shell.mjs | 3 + 8 files changed, 150 insertions(+), 1 deletion(-) diff --git a/text12.txt b/text12.txt index cb3b56f..210743e 100644 --- a/text12.txt +++ b/text12.txt @@ -1065,3 +1065,80 @@ host_wasm_opfs_browser_smokes=ok 继续推进 SDK/API surface。下一批建议把 `linuxCncIniPanelLaunchApi` 也整理为轻量 launch API manifest,明确 `getLauncherLinks()`、`getControlPageApiMethods()`、visible entries 和目标页面 路径,供外部 shell 在不读 DOM 的情况下发现入口;仍保持只读,不新增控制按钮,不解析 G-code。 + +十三、2026-06-15 继续执行记录:INI panel launch API manifest + +本轮按“第一原则:加快实质性推进”继续推进 SDK/API surface,为 launch page 增加轻量 API +manifest,使外部 shell 可以在不读取 DOM、不加载 control-page iframe 的情况下发现入口方法、 +visible entries、目标页面路径和 read-only control-page browser API 清单。 + +完成内容: + +- `wasm-port/runtime/ui/ini-panel/ui-shell.js` 新增 + `createIniPanelLaunchApiManifest()`; +- `createIniPanelShellViewModel()` 新增 `launchApiManifest`; +- launch API manifest 固定包含: + - `apiName` + - `methods` + - `visibleEntries` + - `targetPages` + - `controlPageApiMethods` +- `launch.html` 的 `window.linuxCncIniPanelLaunchApi` 新增 `getLaunchApiManifest()`; +- `ini_panel_launch_smoke.html` 在真实 launch iframe 中校验: + - manifest API name; + - manifest method list; + - visible entry count; + - control-page target href; + - launch API 与 shell helper 一致; +- `verify_ini_panel_ui_shell.mjs`、`verify_ini_panel_shell_control_page_contract.mjs` 和 + `verify_ini_panel_entry_docs.mjs` 覆盖 shell view-model、launch API manifest helper 与文档入口; +- `docs/panel-entry.md` 记录 `createIniPanelLaunchApiManifest()` 和 + `linuxCncIniPanelLaunchApi.getLaunchApiManifest()`; +- 未新增控制按钮; +- 未解析 G-code; +- 未解释 canonical events; +- 未改变 OPFS/session persistence、LinuxCNC interpreter、tool、parameter、planner 或 + LinuxCNC-owned runtime semantics。 + +验证已通过: + +```bash +git diff --check +wasm-port/tests/ui/node/verify_ini_panel_ui_shell.sh +wasm-port/tests/ui/node/verify_ini_panel_shell_control_page_contract.sh +wasm-port/tests/ui/node/verify_ini_panel_entry_docs.sh +wasm-port/tests/ui/node/verify_ui_node_smokes.sh +SKIP_INI_BUILD=1 SKIP_INTERP_BUILD=1 wasm-port/tests/browser/verify_ini_panel_browser.sh +wasm-port/tools/verify_vendor_sync.sh +wasm-port/tools/verify_no_standalone_cnc_semantics.sh +SKIP_INTERP_BUILD=1 wasm-port/tests/wasm/node/verify_interp_wasm.sh +SKIP_INTERP_BUILD=1 wasm-port/tests/wasm/node/verify_sim_configs_inventory_wasm.sh +wasm-port/tests/host/verify_host_smokes.sh +``` + +关键输出: + +```text +ini_panel_ui_shell_node_smoke=ok +ini_panel_shell_control_page_contract_node_smoke=ok +ini_panel_entry_docs_node_smoke=ok +ui_node_smokes=ok +browser_ini_opfs_smoke=ok +browser_ini_control_page_smoke=ok +browser_ini_launch_smoke=ok +vendor sync up to date +standalone CNC semantics guard complete +interp_wasm_node_smoke=ok +sim_configs_wasm_node_inventory_executed=28 +sim_configs_wasm_node_inventory_passed=28 +sim_configs_wasm_node_inventory_skipped=131 +sim_configs_wasm_node_inventory_unexpected_fail=0 +host_wasm_opfs_browser_smokes=ok +``` + +下一步建议: + +继续推进 browser/UI workflow。下一批建议给 launch API manifest 增加一个 focused Node smoke +`verify_ini_panel_launch_api_manifest.sh`,直接校验 manifest shape、entries 深拷贝、target page +映射和 control-page API methods,避免这些能力只被大 smoke 间接覆盖;仍保持只读,不新增控制 +按钮,不解析 G-code。 diff --git a/wasm-port/docs/panel-entry.md b/wasm-port/docs/panel-entry.md index 969acee..45a4dcc 100644 --- a/wasm-port/docs/panel-entry.md +++ b/wasm-port/docs/panel-entry.md @@ -11,6 +11,7 @@ control view: import { INI_PANEL_ENTRIES, createControlPageBrowserApiMethods, + createIniPanelLaunchApiManifest, createIniPanelLauncherLinkViewModel, createIniPanelShellControlPageContract, createIniPanelShellViewModel, @@ -81,6 +82,10 @@ control page after save/load session workflows. The launch page exposes `linuxCncIniPanelLaunchApi.getControlPageApiMethods()` from the same shell view-model so entry pages can consume the available read-only control-page API list without loading the control-page iframe first. +Use `createIniPanelLaunchApiManifest()` or +`linuxCncIniPanelLaunchApi.getLaunchApiManifest()` when an outer shell needs a +single read-only description of launch methods, visible entries, target pages, +and the control-page browser API methods. The control-page refresh workflow lives in `runtime/ui/ini-panel/control-page-refresh-workflow.js`. Use diff --git a/wasm-port/runtime/ui/ini-panel/launch.html b/wasm-port/runtime/ui/ini-panel/launch.html index 5e4adb3..bf558b0 100644 --- a/wasm-port/runtime/ui/ini-panel/launch.html +++ b/wasm-port/runtime/ui/ini-panel/launch.html @@ -90,6 +90,7 @@ } window.linuxCncIniPanelLaunchApi = { + getLaunchApiManifest: () => shellViewModel.launchApiManifest, getLauncherLinks: () => shellViewModel.launcherLinks, getControlPageApiMethods: () => shellViewModel.controlPage.browserApiMethods, }; diff --git a/wasm-port/runtime/ui/ini-panel/ui-shell.js b/wasm-port/runtime/ui/ini-panel/ui-shell.js index 5ed9033..22a1037 100644 --- a/wasm-port/runtime/ui/ini-panel/ui-shell.js +++ b/wasm-port/runtime/ui/ini-panel/ui-shell.js @@ -61,6 +61,27 @@ export function createIniPanelLauncherLinkViewModel(entries = getVisibleIniPanel })); } +export function createIniPanelLaunchApiManifest(entries = getVisibleIniPanelEntries()) { + return { + apiName: "ini-panel-launch", + methods: [ + "getLaunchApiManifest", + "getLauncherLinks", + "getControlPageApiMethods", + ], + visibleEntries: entries.map(({ id, href, title }) => ({ + id, + href, + title, + })), + targetPages: entries.map(({ id, href }) => ({ + entryId: id, + href, + })), + controlPageApiMethods: createControlPageBrowserApiMethods(), + }; +} + export function createIniPanelShellControlPageContract() { const readonlyStatusApiManifest = createMachineSessionReadonlyStatusApiManifest(); return { @@ -99,6 +120,7 @@ export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries title, })), launcherLinks: createIniPanelLauncherLinkViewModel(entries), + launchApiManifest: createIniPanelLaunchApiManifest(entries), controlPage: { browserApiMethods: createControlPageBrowserApiMethods(), contract: createIniPanelShellControlPageContract(), diff --git a/wasm-port/tests/browser/ini_panel_launch_smoke.html b/wasm-port/tests/browser/ini_panel_launch_smoke.html index 6fc7782..5aa61ed 100644 --- a/wasm-port/tests/browser/ini_panel_launch_smoke.html +++ b/wasm-port/tests/browser/ini_panel_launch_smoke.html @@ -9,6 +9,7 @@