推进 INI 面板 launch persistence capabilities manifest
This commit is contained in:
65
text12.txt
65
text12.txt
@@ -1208,3 +1208,68 @@ host_wasm_opfs_browser_smokes=ok
|
|||||||
或等价只读字段,明确 launch 入口可发现的 OPFS/session workflow 能力(如 machine files、
|
或等价只读字段,明确 launch 入口可发现的 OPFS/session workflow 能力(如 machine files、
|
||||||
session snapshot、readonly status),并由 focused Node gate 与 browser launch smoke 双向校验;
|
session snapshot、readonly status),并由 focused Node gate 与 browser launch smoke 双向校验;
|
||||||
仍保持只读,不新增控制按钮,不解析 G-code。
|
仍保持只读,不新增控制按钮,不解析 G-code。
|
||||||
|
|
||||||
|
十五、2026-06-15 继续执行记录:INI panel launch persistence capabilities manifest
|
||||||
|
|
||||||
|
本轮按“第一原则:加快实质性推进”继续推进 OPFS/session persistence,把 launch API manifest
|
||||||
|
扩展为可发现的 persistence capabilities 清单,让入口页和外部 shell 能在不读取 DOM、不加载
|
||||||
|
control-page iframe 的情况下发现 machine files、session snapshot 和 readonly status 能力。
|
||||||
|
|
||||||
|
完成内容:
|
||||||
|
|
||||||
|
- `createIniPanelLaunchApiManifest()` 新增 `persistenceCapabilities`;
|
||||||
|
- persistence capabilities 固定包含:
|
||||||
|
- `machine-files` / `Machine text files` / `opfs`
|
||||||
|
- `session-snapshot` / `Machine session snapshot` / `opfs`
|
||||||
|
- `readonly-status` / `Read-only machine session status` / `control-page`
|
||||||
|
- `verify_ini_panel_launch_api_manifest.mjs` 覆盖 persistence capabilities shape 和深拷贝行为;
|
||||||
|
- `ini_panel_launch_smoke.html` 在真实 launch iframe 中校验 persistence capabilities 数量、
|
||||||
|
id 清单和 readonly status scope;
|
||||||
|
- `docs/panel-entry.md` 记录 launch manifest 中的 OPFS/session persistence capabilities;
|
||||||
|
- `verify_ini_panel_entry_docs.mjs` 覆盖文档中的 machine files、session snapshots 和
|
||||||
|
read-only status 能力说明;
|
||||||
|
- 未新增控制按钮;
|
||||||
|
- 未解析 G-code;
|
||||||
|
- 未解释 canonical events;
|
||||||
|
- 未改变 LinuxCNC interpreter、tool、parameter、planner 或 LinuxCNC-owned runtime semantics。
|
||||||
|
|
||||||
|
验证已通过:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git diff --check
|
||||||
|
wasm-port/tests/ui/node/verify_ini_panel_launch_api_manifest.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_launch_api_manifest_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
|
||||||
|
```
|
||||||
|
|
||||||
|
下一步建议:
|
||||||
|
|
||||||
|
继续推进 SDK/API surface。下一批建议为 `persistenceCapabilities` 增加 stable schema helper 或
|
||||||
|
manifest version 字段(例如 `manifestVersion: 1`),由 focused Node gate、launch browser smoke
|
||||||
|
和 docs gate 共同校验,便于后续外部 shell 做兼容性判断;仍保持只读,不新增控制按钮,不解析
|
||||||
|
G-code。
|
||||||
|
|||||||
@@ -85,7 +85,8 @@ read-only control-page API list without loading the control-page iframe first.
|
|||||||
Use `createIniPanelLaunchApiManifest()` or
|
Use `createIniPanelLaunchApiManifest()` or
|
||||||
`linuxCncIniPanelLaunchApi.getLaunchApiManifest()` when an outer shell needs a
|
`linuxCncIniPanelLaunchApi.getLaunchApiManifest()` when an outer shell needs a
|
||||||
single read-only description of launch methods, visible entries, target pages,
|
single read-only description of launch methods, visible entries, target pages,
|
||||||
and the control-page browser API methods.
|
the control-page browser API methods, and OPFS/session persistence capabilities
|
||||||
|
for machine files, session snapshots, and read-only status.
|
||||||
|
|
||||||
The control-page refresh workflow lives in
|
The control-page refresh workflow lives in
|
||||||
`runtime/ui/ini-panel/control-page-refresh-workflow.js`. Use
|
`runtime/ui/ini-panel/control-page-refresh-workflow.js`. Use
|
||||||
|
|||||||
@@ -79,6 +79,23 @@ export function createIniPanelLaunchApiManifest(entries = getVisibleIniPanelEntr
|
|||||||
href,
|
href,
|
||||||
})),
|
})),
|
||||||
controlPageApiMethods: createControlPageBrowserApiMethods(),
|
controlPageApiMethods: createControlPageBrowserApiMethods(),
|
||||||
|
persistenceCapabilities: [
|
||||||
|
{
|
||||||
|
id: "machine-files",
|
||||||
|
label: "Machine text files",
|
||||||
|
scope: "opfs",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "session-snapshot",
|
||||||
|
label: "Machine session snapshot",
|
||||||
|
scope: "opfs",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "readonly-status",
|
||||||
|
label: "Read-only machine session status",
|
||||||
|
scope: "control-page",
|
||||||
|
},
|
||||||
|
],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -89,6 +89,21 @@
|
|||||||
"./control-page.html",
|
"./control-page.html",
|
||||||
"launch API manifest control target",
|
"launch API manifest control target",
|
||||||
);
|
);
|
||||||
|
assertEqual(
|
||||||
|
launchApiManifest.persistenceCapabilities.length,
|
||||||
|
3,
|
||||||
|
"launch API manifest persistence capability count",
|
||||||
|
);
|
||||||
|
assertEqual(
|
||||||
|
launchApiManifest.persistenceCapabilities.map((capability) => capability.id).join(","),
|
||||||
|
"machine-files,session-snapshot,readonly-status",
|
||||||
|
"launch API manifest persistence capability ids",
|
||||||
|
);
|
||||||
|
assertEqual(
|
||||||
|
launchApiManifest.persistenceCapabilities[2].scope,
|
||||||
|
"control-page",
|
||||||
|
"launch API manifest readonly status scope",
|
||||||
|
);
|
||||||
assertEqual(
|
assertEqual(
|
||||||
launchDoc.querySelector('a[href="./index.html"]').textContent,
|
launchDoc.querySelector('a[href="./index.html"]').textContent,
|
||||||
"Open edit and run panel",
|
"Open edit and run panel",
|
||||||
|
|||||||
@@ -145,6 +145,10 @@ assert.match(docText, /\blinuxCncIniPanelControlPageApi\.readControlPageStatus\b
|
|||||||
assert.match(docText, /\bcreateIniPanelLaunchApiManifest\b/);
|
assert.match(docText, /\bcreateIniPanelLaunchApiManifest\b/);
|
||||||
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getLaunchApiManifest\b/);
|
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getLaunchApiManifest\b/);
|
||||||
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getControlPageApiMethods\b/);
|
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getControlPageApiMethods\b/);
|
||||||
|
assert.match(docText, /\bOPFS\/session persistence capabilities\b/);
|
||||||
|
assert.match(docText, /\bmachine files\b/);
|
||||||
|
assert.match(docText, /\bsession snapshots\b/);
|
||||||
|
assert.match(docText, /\bread-only status\b/);
|
||||||
|
|
||||||
for (const entry of INI_PANEL_ENTRIES) {
|
for (const entry of INI_PANEL_ENTRIES) {
|
||||||
const escapedHref = entry.href.replace(".", "\\.");
|
const escapedHref = entry.href.replace(".", "\\.");
|
||||||
|
|||||||
@@ -48,6 +48,23 @@ assert.deepEqual(manifest, {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
controlPageApiMethods: createControlPageBrowserApiMethods(),
|
controlPageApiMethods: createControlPageBrowserApiMethods(),
|
||||||
|
persistenceCapabilities: [
|
||||||
|
{
|
||||||
|
id: "machine-files",
|
||||||
|
label: "Machine text files",
|
||||||
|
scope: "opfs",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "session-snapshot",
|
||||||
|
label: "Machine session snapshot",
|
||||||
|
scope: "opfs",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "readonly-status",
|
||||||
|
label: "Read-only machine session status",
|
||||||
|
scope: "control-page",
|
||||||
|
},
|
||||||
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
assert.deepEqual(createIniPanelShellViewModel().launchApiManifest, manifest);
|
assert.deepEqual(createIniPanelShellViewModel().launchApiManifest, manifest);
|
||||||
@@ -56,9 +73,11 @@ assert.deepEqual(getVisibleIniPanelEntries(), INI_PANEL_ENTRIES);
|
|||||||
manifest.visibleEntries[0].title = "changed";
|
manifest.visibleEntries[0].title = "changed";
|
||||||
manifest.targetPages[0].href = "./changed.html";
|
manifest.targetPages[0].href = "./changed.html";
|
||||||
manifest.controlPageApiMethods.push("changedMethod");
|
manifest.controlPageApiMethods.push("changedMethod");
|
||||||
|
manifest.persistenceCapabilities[0].label = "changed";
|
||||||
assert.equal(INI_PANEL_ENTRIES[0].title, "Open edit and run panel");
|
assert.equal(INI_PANEL_ENTRIES[0].title, "Open edit and run panel");
|
||||||
assert.equal(createIniPanelLaunchApiManifest().targetPages[0].href, "./index.html");
|
assert.equal(createIniPanelLaunchApiManifest().targetPages[0].href, "./index.html");
|
||||||
assert.deepEqual(createIniPanelLaunchApiManifest().controlPageApiMethods, createControlPageBrowserApiMethods());
|
assert.deepEqual(createIniPanelLaunchApiManifest().controlPageApiMethods, createControlPageBrowserApiMethods());
|
||||||
|
assert.equal(createIniPanelLaunchApiManifest().persistenceCapabilities[0].label, "Machine text files");
|
||||||
|
|
||||||
const customManifest = createIniPanelLaunchApiManifest([
|
const customManifest = createIniPanelLaunchApiManifest([
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user