From b1f23e6641da7a2df06ccd1f76826f16ddd0a35e Mon Sep 17 00:00:00 2001 From: wangdequan Date: Mon, 15 Jun 2026 09:51:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E8=BF=9B=20INI=20=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=20shell=20handoff=20render-state?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- text13.txt | 96 +++++++++++++++++++ wasm-port/docs/panel-entry.md | 10 +- wasm-port/runtime/ui/ini-panel/launch.html | 12 ++- wasm-port/runtime/ui/ini-panel/ui-shell.js | 40 ++++++++ .../tests/browser/ini_panel_launch_smoke.html | 34 ++++++- ...anel_shell_integration_workflow_smoke.html | 7 +- .../ui/node/verify_ini_panel_entry_docs.mjs | 13 +++ .../verify_ini_panel_launch_api_manifest.mjs | 2 + ...y_ini_panel_shell_integration_manifest.mjs | 75 ++++++++++++++- .../ui/node/verify_ini_panel_ui_shell.mjs | 22 +++++ 10 files changed, 300 insertions(+), 11 deletions(-) diff --git a/text13.txt b/text13.txt index 85c79d6..118b301 100644 --- a/text13.txt +++ b/text13.txt @@ -507,3 +507,99 @@ host_wasm_opfs_browser_smokes=ok 继续推进 browser/UI workflow。下一批建议在 launch 页面或等价外部 shell view 中增加一个只读 snapshot consumer helper,把 snapshot 直接压成 launch-side render state,并对 blocked snapshot 做 focused browser smoke;仍保持只读,不新增控制按钮,不解析 G-code。 + +四、2026-06-15 继续执行记录:INI panel shell handoff render-state consumer + +本轮按“第一原则:加快实质性推进”继续推进 browser/UI workflow,新增只读 shell handoff +render-state consumer,把 handoff snapshot 压成 launch 页面和外部 shell 可直接渲染的稳定状态。 + +完成内容: + +- `ui-shell.js` 新增 `createIniPanelShellSessionHandoffRenderState()`; +- render-state 输出: + - `apiName: "ini-panel-shell-session-handoff-render-state"`; + - `renderStateVersion: 1`; + - `phase`; + - `ready`; + - `title`; + - `statusText`; + - `detailText`; + - `statusLine`; + - `rows`; + - `dataset.handoffPhase`; + - `dataset.handoffReady`; +- `createIniPanelShellViewModel()` 新增: + - `shellSessionHandoffRenderState`; + - `createShellSessionHandoffRenderState`; +- `createIniPanelLaunchApiManifest().methods` 新增 + `getShellSessionHandoffRenderState`; +- `launch.html` 改为从 render-state 渲染 `[data-handoff-status]`、 + `[data-handoff-rows]` 和 `[data-handoff-shell]` 的 phase/readiness dataset; +- `launch.html` 的 `window.linuxCncIniPanelLaunchApi` 新增真实 browser 入口 + `getShellSessionHandoffRenderState()`; +- `ini_panel_launch_smoke.html` 校验真实 launch iframe: + - render-state version 为 1; + - render-state `ready === true`; + - render-state status line 为 `Ready: No blocking reasons`; + - render-state rows 与 display view-model rows 一致; + - DOM `[data-handoff-shell]` 输出 `handoffPhase=ready` 与 `handoffReady=true`; +- `ini_panel_shell_integration_workflow_smoke.html` 校验外部 shell workflow 能读取 + render-state,并确认 status line 与 display rows 一致; +- `verify_ini_panel_shell_integration_manifest.mjs` 覆盖: + - ready render-state 完整 shape; + - blocked snapshot render-state 的 `Blocked: summaryVersion` focused case; +- `verify_ini_panel_ui_shell.mjs` 覆盖 shell view-model 的 render-state 聚合关系; +- `verify_ini_panel_launch_api_manifest.mjs`、`verify_ini_panel_entry_docs.mjs` 与 + `docs/panel-entry.md` 同步记录和校验新 helper/API/DOM dataset; +- 未新增控制按钮; +- 未解析 G-code; +- 未解释 canonical events; +- 未新增 JS CNC 语义; +- 未改变 OPFS/session persistence、LinuxCNC interpreter、tool、parameter、planner 或 + LinuxCNC-owned runtime semantics。 + +验证已通过: + +```bash +git diff --check +wasm-port/tests/ui/node/verify_ini_panel_shell_integration_manifest.sh +wasm-port/tests/ui/node/verify_ini_panel_launch_api_manifest.sh +wasm-port/tests/ui/node/verify_ini_panel_ui_shell.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_shell_integration_manifest_node_smoke=ok +ini_panel_launch_api_manifest_node_smoke=ok +ini_panel_ui_shell_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 +browser_ini_shell_integration_workflow_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 与 browser/UI workflow 的交界。下一批建议新增一个只读 +`createIniPanelShellSessionHandoffActionPlan()` 或等价 helper,把 render-state 的 ready/blocked +状态转成外部 shell 可执行的下一步计划(例如 target page、required methods、blocked reasons、 +display rows),但仍只描述流程,不新增控制按钮,不解析 G-code。 diff --git a/wasm-port/docs/panel-entry.md b/wasm-port/docs/panel-entry.md index 756b6cd..4943744 100644 --- a/wasm-port/docs/panel-entry.md +++ b/wasm-port/docs/panel-entry.md @@ -23,6 +23,7 @@ import { createIniPanelShellIntegrationWorkflowPlan, createIniPanelShellSessionHandoffCompatibilityReport, createIniPanelShellSessionHandoffDisplayViewModel, + createIniPanelShellSessionHandoffRenderState, createIniPanelShellSessionHandoffSnapshot, createIniPanelShellSessionHandoffSummary, createIniPanelShellSessionHandoffSummarySchema, @@ -153,12 +154,17 @@ handoff summary. Use `createIniPanelShellSessionHandoffDisplayViewModel()` or `linuxCncIniPanelLaunchApi.getShellSessionHandoffDisplayViewModel()` when an outer shell needs the same diagnostics as stable read-only label/value rows for -DOM display. The launch page renders those rows in `[data-handoff-status]` and -`[data-handoff-rows]` without adding control actions. +DOM display. Use `createIniPanelShellSessionHandoffSnapshot()` or `linuxCncIniPanelLaunchApi.getShellSessionHandoffSnapshot()` when an outer shell needs one read-only API read that includes readiness, handoff summary, compatibility report, and display view-model together. +Use `createIniPanelShellSessionHandoffRenderState()` or +`linuxCncIniPanelLaunchApi.getShellSessionHandoffRenderState()` when an outer +shell needs the snapshot compressed into launch-side DOM state with a status +line, stable rows, and `[data-handoff-shell]` phase/readiness flags. The launch +page renders `[data-handoff-status]` and `[data-handoff-rows]` from this helper +without adding control actions. The browser workflow smoke `tests/browser/ini_panel_shell_integration_workflow_smoke.html` verifies the same external shell handoff: read integration manifest, pass readiness gate, diff --git a/wasm-port/runtime/ui/ini-panel/launch.html b/wasm-port/runtime/ui/ini-panel/launch.html index ebdb610..ef9ac1c 100644 --- a/wasm-port/runtime/ui/ini-panel/launch.html +++ b/wasm-port/runtime/ui/ini-panel/launch.html @@ -91,7 +91,7 @@ Open edit and run panel Open read-only control view -
+

Checking shell handoff compatibility.

@@ -114,10 +114,13 @@ link.textContent = linkModel.label; link.href = linkModel.href; } - const handoffDisplay = shellViewModel.shellSessionHandoffDisplayViewModel; - document.querySelector("[data-handoff-status]").textContent = `${handoffDisplay.statusText}: ${handoffDisplay.detailText}`; + const handoffRenderState = shellViewModel.shellSessionHandoffRenderState; + const handoffShell = document.querySelector("[data-handoff-shell]"); + handoffShell.dataset.handoffPhase = handoffRenderState.dataset.handoffPhase; + handoffShell.dataset.handoffReady = handoffRenderState.dataset.handoffReady; + document.querySelector("[data-handoff-status]").textContent = handoffRenderState.statusLine; const handoffRows = document.querySelector("[data-handoff-rows]"); - for (const row of handoffDisplay.rows) { + for (const row of handoffRenderState.rows) { const term = document.createElement("dt"); term.dataset.handoffRow = row.id; term.textContent = row.label; @@ -140,6 +143,7 @@ getShellSessionHandoffCompatibilityReport: () => shellViewModel.shellSessionHandoffCompatibilityReport, getShellSessionHandoffDisplayViewModel: () => shellViewModel.shellSessionHandoffDisplayViewModel, getShellSessionHandoffSnapshot: () => shellViewModel.shellSessionHandoffSnapshot, + getShellSessionHandoffRenderState: () => shellViewModel.shellSessionHandoffRenderState, 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 fbe842c..bd34ee1 100644 --- a/wasm-port/runtime/ui/ini-panel/ui-shell.js +++ b/wasm-port/runtime/ui/ini-panel/ui-shell.js @@ -132,6 +132,7 @@ export function createIniPanelLaunchApiManifest(entries = getVisibleIniPanelEntr "getShellSessionHandoffCompatibilityReport", "getShellSessionHandoffDisplayViewModel", "getShellSessionHandoffSnapshot", + "getShellSessionHandoffRenderState", "getLauncherLinks", "getControlPageApiMethods", ], @@ -553,6 +554,40 @@ export function createIniPanelShellSessionHandoffSnapshot({ }; } +export function createIniPanelShellSessionHandoffRenderState( + snapshot = createIniPanelShellSessionHandoffSnapshot(), +) { + const displayViewModel = snapshot?.displayViewModel && typeof snapshot.displayViewModel === "object" + ? snapshot.displayViewModel + : createIniPanelShellSessionHandoffDisplayViewModel(snapshot?.compatibilityReport); + const rows = Array.isArray(displayViewModel.rows) + ? displayViewModel.rows.map(({ id, label, value }) => ({ + id, + label, + value: value == null ? "" : String(value), + })) + : []; + const ready = snapshot?.ready === true && displayViewModel.phase === "ready"; + const statusText = displayViewModel.statusText ?? (ready ? "Ready" : "Blocked"); + const detailText = displayViewModel.detailText ?? "No blocking reasons"; + + return { + apiName: "ini-panel-shell-session-handoff-render-state", + renderStateVersion: 1, + phase: ready ? "ready" : "blocked", + ready, + title: displayViewModel.title ?? "Shell handoff compatibility", + statusText, + detailText, + statusLine: `${statusText}: ${detailText}`, + rows, + dataset: { + handoffPhase: ready ? "ready" : "blocked", + handoffReady: ready ? "true" : "false", + }, + }; +} + export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries()) { const shellIntegrationManifest = createIniPanelShellIntegrationManifest(entries); const shellIntegrationReadiness = createIniPanelShellIntegrationReadiness(shellIntegrationManifest); @@ -577,6 +612,9 @@ export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries compatibilityReport: shellSessionHandoffCompatibilityReport, displayViewModel: shellSessionHandoffDisplayViewModel, }); + const shellSessionHandoffRenderState = createIniPanelShellSessionHandoffRenderState( + shellSessionHandoffSnapshot, + ); return { pages: entries.map(({ id, href, title }) => ({ id, @@ -593,6 +631,7 @@ export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries shellSessionHandoffCompatibilityReport, shellSessionHandoffDisplayViewModel, shellSessionHandoffSnapshot, + shellSessionHandoffRenderState, launchApiSchema: createIniPanelLaunchApiSchema(), launchApiManifest: createIniPanelLaunchApiManifest(entries), isSupportedShellIntegrationManifest: isSupportedIniPanelShellIntegrationManifest, @@ -604,6 +643,7 @@ export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries createShellSessionHandoffCompatibilityReport: createIniPanelShellSessionHandoffCompatibilityReport, createShellSessionHandoffDisplayViewModel: createIniPanelShellSessionHandoffDisplayViewModel, createShellSessionHandoffSnapshot: createIniPanelShellSessionHandoffSnapshot, + createShellSessionHandoffRenderState: createIniPanelShellSessionHandoffRenderState, controlPage: { browserApiSchema: createControlPageBrowserApiSchema(), browserApiManifest: createControlPageBrowserApiManifest(), diff --git a/wasm-port/tests/browser/ini_panel_launch_smoke.html b/wasm-port/tests/browser/ini_panel_launch_smoke.html index bce9b75..9e171fd 100644 --- a/wasm-port/tests/browser/ini_panel_launch_smoke.html +++ b/wasm-port/tests/browser/ini_panel_launch_smoke.html @@ -79,6 +79,7 @@ !launchApi?.getShellSessionHandoffCompatibilityReport || !launchApi?.getShellSessionHandoffDisplayViewModel || !launchApi?.getShellSessionHandoffSnapshot || + !launchApi?.getShellSessionHandoffRenderState || !launchApi?.getLauncherLinks || !launchApi?.getControlPageApiMethods ) { @@ -118,7 +119,7 @@ ); assertEqual( launchApiManifest.methods.join(","), - "isSupportedLaunchApiManifest,getLaunchApiSchema,getLaunchApiManifest,getShellIntegrationSchema,getShellIntegrationManifest,getShellIntegrationReadiness,getShellSessionHandoffSummarySchema,getShellSessionHandoffSummary,isSupportedShellSessionHandoffSummary,getShellSessionHandoffCompatibilityReport,getShellSessionHandoffDisplayViewModel,getShellSessionHandoffSnapshot,getLauncherLinks,getControlPageApiMethods", + "isSupportedLaunchApiManifest,getLaunchApiSchema,getLaunchApiManifest,getShellIntegrationSchema,getShellIntegrationManifest,getShellIntegrationReadiness,getShellSessionHandoffSummarySchema,getShellSessionHandoffSummary,isSupportedShellSessionHandoffSummary,getShellSessionHandoffCompatibilityReport,getShellSessionHandoffDisplayViewModel,getShellSessionHandoffSnapshot,getShellSessionHandoffRenderState,getLauncherLinks,getControlPageApiMethods", "launch API manifest methods", ); const shellIntegrationSchema = launchApi.getShellIntegrationSchema(); @@ -129,6 +130,7 @@ const shellSessionHandoffCompatibilityReport = launchApi.getShellSessionHandoffCompatibilityReport(); const shellSessionHandoffDisplayViewModel = launchApi.getShellSessionHandoffDisplayViewModel(); const shellSessionHandoffSnapshot = launchApi.getShellSessionHandoffSnapshot(); + const shellSessionHandoffRenderState = launchApi.getShellSessionHandoffRenderState(); assertEqual( shellIntegrationSchema.manifestVersion, 1, @@ -224,6 +226,21 @@ true, "shell session handoff snapshot readiness", ); + assertEqual( + shellSessionHandoffRenderState.renderStateVersion, + 1, + "shell session handoff render-state version", + ); + assertEqual( + shellSessionHandoffRenderState.ready, + true, + "shell session handoff render-state readiness", + ); + assertEqual( + shellSessionHandoffRenderState.statusLine, + "Ready: No blocking reasons", + "shell session handoff render-state status", + ); assertEqual( JSON.stringify(shellSessionHandoffSnapshot.readiness), JSON.stringify(shellIntegrationReadiness), @@ -239,11 +256,26 @@ JSON.stringify(shellSessionHandoffDisplayViewModel), "shell session handoff snapshot display object", ); + assertEqual( + JSON.stringify(shellSessionHandoffRenderState.rows), + JSON.stringify(shellSessionHandoffDisplayViewModel.rows), + "shell session handoff render-state rows", + ); assertEqual( launchDoc.querySelector("[data-handoff-status]").textContent, "Ready: No blocking reasons", "shell session handoff DOM status", ); + assertEqual( + launchDoc.querySelector("[data-handoff-shell]").dataset.handoffPhase, + "ready", + "shell session handoff DOM phase", + ); + assertEqual( + launchDoc.querySelector("[data-handoff-shell]").dataset.handoffReady, + "true", + "shell session handoff DOM ready", + ); assertEqual( launchDoc.querySelector('[data-handoff-value="missing-fields"]').textContent, "none", diff --git a/wasm-port/tests/browser/ini_panel_shell_integration_workflow_smoke.html b/wasm-port/tests/browser/ini_panel_shell_integration_workflow_smoke.html index 867a5e7..bbc94d7 100644 --- a/wasm-port/tests/browser/ini_panel_shell_integration_workflow_smoke.html +++ b/wasm-port/tests/browser/ini_panel_shell_integration_workflow_smoke.html @@ -69,7 +69,8 @@ TOOL_TABLE = browser-shell-tool.tbl !launchApi?.isSupportedShellSessionHandoffSummary || !launchApi?.getShellSessionHandoffCompatibilityReport || !launchApi?.getShellSessionHandoffDisplayViewModel || - !launchApi?.getShellSessionHandoffSnapshot + !launchApi?.getShellSessionHandoffSnapshot || + !launchApi?.getShellSessionHandoffRenderState ) { throw new Error("launch API namespace did not expose shell integration helpers"); } @@ -81,6 +82,7 @@ TOOL_TABLE = browser-shell-tool.tbl const compatibilityReport = launchApi.getShellSessionHandoffCompatibilityReport(); const handoffDisplay = launchApi.getShellSessionHandoffDisplayViewModel(); const handoffSnapshot = launchApi.getShellSessionHandoffSnapshot(); + const handoffRenderState = launchApi.getShellSessionHandoffRenderState(); assertEqual(handoffSummarySchema.summaryVersion, 1, "shell handoff summary schema version"); assertEqual( launchApi.isSupportedShellSessionHandoffSummary(handoffSummary), @@ -94,6 +96,9 @@ TOOL_TABLE = browser-shell-tool.tbl assertEqual(handoffDisplay.detailText, "No blocking reasons", "shell handoff display detail"); assertEqual(handoffSnapshot.ready, true, "shell handoff snapshot readiness"); assertEqual(handoffSnapshot.displayViewModel.statusText, "Ready", "shell handoff snapshot display status"); + assertEqual(handoffRenderState.ready, true, "shell handoff render-state readiness"); + assertEqual(handoffRenderState.statusLine, "Ready: No blocking reasons", "shell handoff render-state status"); + assertEqual(handoffRenderState.rows.length, handoffDisplay.rows.length, "shell handoff render-state rows"); assertEqual(readiness.phase, "ready", "shell integration readiness phase"); assertEqual(readiness.ready, true, "shell integration readiness"); assertEqual(readiness.missing.join(","), "", "shell integration readiness missing checks"); diff --git a/wasm-port/tests/ui/node/verify_ini_panel_entry_docs.mjs b/wasm-port/tests/ui/node/verify_ini_panel_entry_docs.mjs index b793793..ffb7f83 100644 --- a/wasm-port/tests/ui/node/verify_ini_panel_entry_docs.mjs +++ b/wasm-port/tests/ui/node/verify_ini_panel_entry_docs.mjs @@ -20,6 +20,7 @@ import { createIniPanelShellIntegrationWorkflowPlan, createIniPanelShellSessionHandoffCompatibilityReport, createIniPanelShellSessionHandoffDisplayViewModel, + createIniPanelShellSessionHandoffRenderState, createIniPanelShellSessionHandoffSnapshot, createIniPanelShellSessionHandoffSummary, createIniPanelShellSessionHandoffSummarySchema, @@ -73,6 +74,7 @@ const requiredShellExports = [ "createIniPanelShellIntegrationWorkflowPlan", "createIniPanelShellSessionHandoffCompatibilityReport", "createIniPanelShellSessionHandoffDisplayViewModel", + "createIniPanelShellSessionHandoffRenderState", "createIniPanelShellSessionHandoffSnapshot", "createIniPanelShellSessionHandoffSummary", "createIniPanelShellSessionHandoffSummarySchema", @@ -184,6 +186,10 @@ assert.deepEqual( displayViewModel: createIniPanelShellViewModel().shellSessionHandoffDisplayViewModel, }), ); +assert.deepEqual( + createIniPanelShellViewModel().shellSessionHandoffRenderState, + createIniPanelShellSessionHandoffRenderState(createIniPanelShellViewModel().shellSessionHandoffSnapshot), +); assert.equal(isSupportedIniPanelShellIntegrationManifest(createIniPanelShellViewModel().shellIntegrationManifest), true); assert.deepEqual(createIniPanelShellViewModel().launchApiSchema, createIniPanelLaunchApiSchema()); assert.deepEqual(createIniPanelShellViewModel().launchApiManifest, createIniPanelLaunchApiManifest()); @@ -240,6 +246,7 @@ assert.match(shellText, /\bexport function createIniPanelShellIntegrationReadine assert.match(shellText, /\bexport function createIniPanelShellIntegrationWorkflowPlan\b/); assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffCompatibilityReport\b/); assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffDisplayViewModel\b/); +assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffRenderState\b/); assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffSnapshot\b/); assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffSummary\b/); assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffSummarySchema\b/); @@ -264,6 +271,8 @@ assert.match(launchText, /\bisSupportedShellSessionHandoffSummary\b/); assert.match(launchText, /\bgetShellSessionHandoffCompatibilityReport\b/); assert.match(launchText, /\bgetShellSessionHandoffDisplayViewModel\b/); assert.match(launchText, /\bgetShellSessionHandoffSnapshot\b/); +assert.match(launchText, /\bgetShellSessionHandoffRenderState\b/); +assert.match(launchText, /\bdata-handoff-shell\b/); assert.match(launchText, /\bdata-handoff-status\b/); assert.match(launchText, /\bdata-handoff-rows\b/); assert.match(launchText, /\bgetControlPageApiMethods\b/); @@ -286,6 +295,7 @@ assert.match(docText, /\bcreateIniPanelShellIntegrationSchema\b/); assert.match(docText, /\bcreateIniPanelShellIntegrationWorkflowPlan\b/); assert.match(docText, /\bcreateIniPanelShellSessionHandoffCompatibilityReport\b/); assert.match(docText, /\bcreateIniPanelShellSessionHandoffDisplayViewModel\b/); +assert.match(docText, /\bcreateIniPanelShellSessionHandoffRenderState\b/); assert.match(docText, /\bcreateIniPanelShellSessionHandoffSnapshot\b/); assert.match(docText, /\bcreateIniPanelShellSessionHandoffSummary\b/); assert.match(docText, /\bcreateIniPanelShellSessionHandoffSummarySchema\b/); @@ -305,6 +315,8 @@ assert.match(docText, /\blinuxCncIniPanelLaunchApi\.isSupportedShellSessionHando assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getShellSessionHandoffCompatibilityReport\b/); assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getShellSessionHandoffDisplayViewModel\b/); assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getShellSessionHandoffSnapshot\b/); +assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getShellSessionHandoffRenderState\b/); +assert.match(docText, /\bdata-handoff-shell\b/); assert.match(docText, /\bdata-handoff-status\b/); assert.match(docText, /\bdata-handoff-rows\b/); assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getControlPageApiMethods\b/); @@ -316,6 +328,7 @@ assert.match(shellIntegrationWorkflowSmokeText, /\bisSupportedShellSessionHandof assert.match(shellIntegrationWorkflowSmokeText, /\bgetShellSessionHandoffCompatibilityReport\b/); assert.match(shellIntegrationWorkflowSmokeText, /\bgetShellSessionHandoffDisplayViewModel\b/); assert.match(shellIntegrationWorkflowSmokeText, /\bgetShellSessionHandoffSnapshot\b/); +assert.match(shellIntegrationWorkflowSmokeText, /\bgetShellSessionHandoffRenderState\b/); assert.match(shellIntegrationWorkflowSmokeText, /\bhandoffSummary\.handoffMethods\.readStatus\b/); assert.match(shellIntegrationWorkflowSmokeText, /\breadControlPageStatus\b/); assert.match(shellIntegrationWorkflowSmokeText, /\bbrowser_ini_shell_integration_workflow_smoke=ok\b/); diff --git a/wasm-port/tests/ui/node/verify_ini_panel_launch_api_manifest.mjs b/wasm-port/tests/ui/node/verify_ini_panel_launch_api_manifest.mjs index 0d64de5..010598b 100644 --- a/wasm-port/tests/ui/node/verify_ini_panel_launch_api_manifest.mjs +++ b/wasm-port/tests/ui/node/verify_ini_panel_launch_api_manifest.mjs @@ -52,6 +52,7 @@ assert.deepEqual(manifest, { "getShellSessionHandoffCompatibilityReport", "getShellSessionHandoffDisplayViewModel", "getShellSessionHandoffSnapshot", + "getShellSessionHandoffRenderState", "getLauncherLinks", "getControlPageApiMethods", ], @@ -158,6 +159,7 @@ assert.match(launchText, /\bisSupportedShellSessionHandoffSummary\b/); assert.match(launchText, /\bgetShellSessionHandoffCompatibilityReport\b/); assert.match(launchText, /\bgetShellSessionHandoffDisplayViewModel\b/); assert.match(launchText, /\bgetShellSessionHandoffSnapshot\b/); +assert.match(launchText, /\bgetShellSessionHandoffRenderState\b/); assert.match(launchText, /\blinuxCncIniPanelLaunchApi\b/); console.log("ini_panel_launch_api_manifest_node_smoke=ok"); diff --git a/wasm-port/tests/ui/node/verify_ini_panel_shell_integration_manifest.mjs b/wasm-port/tests/ui/node/verify_ini_panel_shell_integration_manifest.mjs index 744c036..5935b9b 100644 --- a/wasm-port/tests/ui/node/verify_ini_panel_shell_integration_manifest.mjs +++ b/wasm-port/tests/ui/node/verify_ini_panel_shell_integration_manifest.mjs @@ -16,6 +16,7 @@ import { createIniPanelShellIntegrationWorkflowPlan, createIniPanelShellSessionHandoffCompatibilityReport, createIniPanelShellSessionHandoffDisplayViewModel, + createIniPanelShellSessionHandoffRenderState, createIniPanelShellSessionHandoffSnapshot, createIniPanelShellSessionHandoffSummary, createIniPanelShellSessionHandoffSummarySchema, @@ -44,6 +45,7 @@ const handoffSnapshot = createIniPanelShellSessionHandoffSnapshot({ compatibilityReport: handoffCompatibilityReport, displayViewModel: handoffDisplayViewModel, }); +const handoffRenderState = createIniPanelShellSessionHandoffRenderState(handoffSnapshot); assert.deepEqual(schema, { apiName: "ini-panel-shell-integration", @@ -99,7 +101,7 @@ assert.deepEqual(readiness, { counts: { pages: 2, launcherLinks: 2, - launchMethods: 14, + launchMethods: 15, controlPageMethods: 11, persistenceCapabilities: 3, }, @@ -161,7 +163,7 @@ assert.deepEqual(handoffSummary, { counts: { pages: 2, launcherLinks: 2, - launchMethods: 14, + launchMethods: 15, controlPageMethods: 11, persistenceCapabilities: 3, }, @@ -310,7 +312,23 @@ assert.deepEqual(handoffSnapshot, { compatibilityReport: handoffCompatibilityReport, displayViewModel: handoffDisplayViewModel, }); +assert.deepEqual(handoffRenderState, { + apiName: "ini-panel-shell-session-handoff-render-state", + renderStateVersion: 1, + phase: "ready", + ready: true, + title: "Shell handoff compatibility", + statusText: "Ready", + detailText: "No blocking reasons", + statusLine: "Ready: No blocking reasons", + rows: handoffDisplayViewModel.rows, + dataset: { + handoffPhase: "ready", + handoffReady: "true", + }, +}); assert.equal(createIniPanelShellSessionHandoffSnapshot().displayViewModel.rows.length, 5); +assert.equal(createIniPanelShellSessionHandoffRenderState().statusLine, "Ready: No blocking reasons"); assert.deepEqual( createIniPanelShellSessionHandoffDisplayViewModel( createIniPanelShellSessionHandoffCompatibilityReport({ ...handoffSummary, summaryVersion: 2 }), @@ -348,6 +366,55 @@ assert.deepEqual( createIniPanelShellSessionHandoffCompatibilityReport(null).missingFields, handoffSummarySchema.fields, ); +assert.deepEqual( + createIniPanelShellSessionHandoffRenderState(createIniPanelShellSessionHandoffSnapshot({ + compatibilityReport: createIniPanelShellSessionHandoffCompatibilityReport({ + ...handoffSummary, + summaryVersion: 2, + }), + })), + { + apiName: "ini-panel-shell-session-handoff-render-state", + renderStateVersion: 1, + phase: "blocked", + ready: false, + title: "Shell handoff compatibility", + statusText: "Blocked", + detailText: "summaryVersion", + statusLine: "Blocked: summaryVersion", + rows: [ + { + id: "summary-supported", + label: "Summary schema", + value: "blocked", + }, + { + id: "handoff-ready", + label: "Handoff readiness", + value: "blocked", + }, + { + id: "missing-fields", + label: "Missing fields", + value: "none", + }, + { + id: "mismatch-fields", + label: "Mismatched fields", + value: "summaryVersion", + }, + { + id: "blocking-reasons", + label: "Blocking reasons", + value: "none", + }, + ], + dataset: { + handoffPhase: "blocked", + handoffReady: "false", + }, + }, +); const blockedManifest = { ...createIniPanelShellIntegrationManifest(), compatibility: { @@ -369,7 +436,7 @@ assert.deepEqual(createIniPanelShellIntegrationReadiness(blockedManifest), { counts: { pages: 2, launcherLinks: 2, - launchMethods: 14, + launchMethods: 15, controlPageMethods: 11, persistenceCapabilities: 3, }, @@ -514,6 +581,7 @@ assert.match(shellText, /\bexport function createIniPanelShellIntegrationReadine assert.match(shellText, /\bexport function createIniPanelShellIntegrationWorkflowPlan\b/); assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffCompatibilityReport\b/); assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffDisplayViewModel\b/); +assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffRenderState\b/); assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffSnapshot\b/); assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffSummary\b/); assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffSummarySchema\b/); @@ -527,6 +595,7 @@ assert.match(docText, /\bcreateIniPanelShellIntegrationReadiness\b/); assert.match(docText, /\bcreateIniPanelShellIntegrationWorkflowPlan\b/); assert.match(docText, /\bcreateIniPanelShellSessionHandoffCompatibilityReport\b/); assert.match(docText, /\bcreateIniPanelShellSessionHandoffDisplayViewModel\b/); +assert.match(docText, /\bcreateIniPanelShellSessionHandoffRenderState\b/); assert.match(docText, /\bcreateIniPanelShellSessionHandoffSnapshot\b/); assert.match(docText, /\bcreateIniPanelShellSessionHandoffSummary\b/); assert.match(docText, /\bcreateIniPanelShellSessionHandoffSummarySchema\b/); diff --git a/wasm-port/tests/ui/node/verify_ini_panel_ui_shell.mjs b/wasm-port/tests/ui/node/verify_ini_panel_ui_shell.mjs index ff7d1ab..770aee4 100644 --- a/wasm-port/tests/ui/node/verify_ini_panel_ui_shell.mjs +++ b/wasm-port/tests/ui/node/verify_ini_panel_ui_shell.mjs @@ -16,6 +16,7 @@ import { createIniPanelShellIntegrationWorkflowPlan, createIniPanelShellSessionHandoffCompatibilityReport, createIniPanelShellSessionHandoffDisplayViewModel, + createIniPanelShellSessionHandoffRenderState, createIniPanelShellSessionHandoffSnapshot, createIniPanelShellSessionHandoffSummary, createIniPanelShellSessionHandoffSummarySchema, @@ -74,6 +75,7 @@ assert.equal(typeof createIniPanelShellIntegrationSchema, "function"); assert.equal(typeof createIniPanelShellIntegrationWorkflowPlan, "function"); assert.equal(typeof createIniPanelShellSessionHandoffCompatibilityReport, "function"); assert.equal(typeof createIniPanelShellSessionHandoffDisplayViewModel, "function"); +assert.equal(typeof createIniPanelShellSessionHandoffRenderState, "function"); assert.equal(typeof createIniPanelShellSessionHandoffSnapshot, "function"); assert.equal(typeof createIniPanelShellSessionHandoffSummary, "function"); assert.equal(typeof createIniPanelShellSessionHandoffSummarySchema, "function"); @@ -161,6 +163,10 @@ assert.deepEqual( displayViewModel: shellViewModel.shellSessionHandoffDisplayViewModel, }), ); +assert.deepEqual( + shellViewModel.shellSessionHandoffRenderState, + createIniPanelShellSessionHandoffRenderState(shellViewModel.shellSessionHandoffSnapshot), +); assert.deepEqual(shellViewModel.shellSessionHandoffDisplayViewModel, { phase: "ready", title: "Shell handoff compatibility", @@ -194,6 +200,21 @@ assert.deepEqual(shellViewModel.shellSessionHandoffDisplayViewModel, { }, ], }); +assert.deepEqual(shellViewModel.shellSessionHandoffRenderState, { + apiName: "ini-panel-shell-session-handoff-render-state", + renderStateVersion: 1, + phase: "ready", + ready: true, + title: "Shell handoff compatibility", + statusText: "Ready", + detailText: "No blocking reasons", + statusLine: "Ready: No blocking reasons", + rows: shellViewModel.shellSessionHandoffDisplayViewModel.rows, + dataset: { + handoffPhase: "ready", + handoffReady: "true", + }, +}); assert.equal( isSupportedIniPanelShellIntegrationManifest(shellViewModel.shellIntegrationManifest), true, @@ -238,6 +259,7 @@ assert.equal( createIniPanelShellSessionHandoffDisplayViewModel, ); assert.equal(shellViewModel.createShellSessionHandoffSnapshot, createIniPanelShellSessionHandoffSnapshot); +assert.equal(shellViewModel.createShellSessionHandoffRenderState, createIniPanelShellSessionHandoffRenderState); assert.deepEqual(shellViewModel.controlPage.contract, createIniPanelShellControlPageContract()); assert.equal(shellViewModel.controlPage.isSupportedBrowserApiManifest, isSupportedIniPanelControlPageApiManifest); assert.equal(shellViewModel.controlPage.loadSessionState, loadMachineSessionForControlPageWorkflow);