diff --git a/text12.txt b/text12.txt index 7da7e4c..ac11125 100644 --- a/text12.txt +++ b/text12.txt @@ -2247,3 +2247,82 @@ host_wasm_opfs_browser_smokes=ok 继续推进 browser/UI workflow。下一批建议把 shell handoff package display view-model 接入 launch 页面当前 `[data-handoff-rows]` 渲染路径,或增加一个 package render-state helper,让 launch 页可显示 package 级 schema/report 状态;仍保持只读,不新增控制按钮,不解析 G-code。 + +二十八、2026-06-15 继续执行记录:INI panel shell handoff package render-state + +本轮按“第一原则:加快实质性推进”继续推进 browser/UI workflow,把 shell handoff package +display view-model 压缩成 launch-side package render-state,并让真实 launch 页面首屏渲染 package +级 schema/report 状态。 + +完成内容: + +- `ui-shell.js` 新增 `createIniPanelShellSessionHandoffPackageRenderState()`; +- `createIniPanelShellViewModel()` 新增 `shellSessionHandoffPackageRenderState`; +- shell view-model 暴露 `createShellSessionHandoffPackageRenderState` helper; +- `createIniPanelLaunchApiManifest().methods` 新增 + `getShellSessionHandoffPackageRenderState`; +- `launch.html` 的 `[data-handoff-status]` 和 `[data-handoff-rows]` 改为从 package + render-state 渲染; +- `launch.html` 的 `[data-handoff-shell]` 新增 `data-handoff-scope="package"`; +- `launch.html` 的 `window.linuxCncIniPanelLaunchApi` 新增真实 browser 入口 + `getShellSessionHandoffPackageRenderState()`; +- `ini_panel_launch_smoke.html` 校验真实 launch API 返回的 package render-state,并校验 DOM + 已显示 package schema/report rows; +- `ini_panel_shell_integration_workflow_smoke.html` 在真实 shell handoff workflow 中校验 package + render-state; +- `verify_ini_panel_ui_shell.mjs` 覆盖 helper 导出、shell view-model 字段和 render-state shape; +- `verify_ini_panel_shell_integration_manifest.mjs` 覆盖 ready/blocked package render-state; +- `verify_ini_panel_launch_api_manifest.mjs` 覆盖 launch manifest 与 launch page API 暴露; +- `verify_ini_panel_entry_docs.mjs` 与 `docs/panel-entry.md` 同步记录和校验新 helper; +- 未新增控制按钮; +- 未解析 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_ui_shell.sh +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_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_integration_manifest_node_smoke=ok +ini_panel_launch_api_manifest_node_smoke=ok +ini_panel_entry_docs_node_smoke=ok +browser_ini_opfs_smoke=ok +browser_ini_control_page_smoke=ok +browser_ini_launch_smoke=ok +browser_ini_shell_integration_workflow_smoke=ok +ui_node_smokes=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 与 OPFS/session persistence 的交界。下一批建议增加一个 +`createIniPanelShellSessionHandoffPackageMountState()` 或等价 helper,把 launch-side package +render-state、target control page、required readonly methods 与首帧 control-page session readiness +合并为外部 shell 可消费的 mount-state;仍保持只读,不新增控制按钮,不解析 G-code。 diff --git a/wasm-port/docs/panel-entry.md b/wasm-port/docs/panel-entry.md index c9399dc..fc5fe66 100644 --- a/wasm-port/docs/panel-entry.md +++ b/wasm-port/docs/panel-entry.md @@ -28,6 +28,7 @@ import { createIniPanelShellSessionHandoffPackage, createIniPanelShellSessionHandoffPackageDisplayViewModel, createIniPanelShellSessionHandoffPackageReport, + createIniPanelShellSessionHandoffPackageRenderState, createIniPanelShellSessionHandoffPackageSchema, createIniPanelShellSessionHandoffRenderState, createIniPanelShellSessionHandoffSnapshot, @@ -203,6 +204,12 @@ Use `createIniPanelShellSessionHandoffPackageDisplayViewModel()` or `linuxCncIniPanelLaunchApi.getShellSessionHandoffPackageDisplayViewModel()` when an outer shell needs the package report compressed into stable read-only label/value rows for DOM display. +Use `createIniPanelShellSessionHandoffPackageRenderState()` or +`linuxCncIniPanelLaunchApi.getShellSessionHandoffPackageRenderState()` when an +outer shell needs the package display view-model compressed into launch-side +DOM state. The launch page renders `[data-handoff-status]` and +`[data-handoff-rows]` from the package render-state so the first page shows +package-level schema/report status. 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 2052951..3fc3908 100644 --- a/wasm-port/runtime/ui/ini-panel/launch.html +++ b/wasm-port/runtime/ui/ini-panel/launch.html @@ -114,10 +114,11 @@ link.textContent = linkModel.label; link.href = linkModel.href; } - const handoffRenderState = shellViewModel.shellSessionHandoffRenderState; + const handoffRenderState = shellViewModel.shellSessionHandoffPackageRenderState; const handoffShell = document.querySelector("[data-handoff-shell]"); handoffShell.dataset.handoffPhase = handoffRenderState.dataset.handoffPhase; handoffShell.dataset.handoffReady = handoffRenderState.dataset.handoffReady; + handoffShell.dataset.handoffScope = handoffRenderState.dataset.handoffScope; document.querySelector("[data-handoff-status]").textContent = handoffRenderState.statusLine; const handoffRows = document.querySelector("[data-handoff-rows]"); for (const row of handoffRenderState.rows) { @@ -150,6 +151,7 @@ getShellSessionHandoffPackage: () => shellViewModel.shellSessionHandoffPackage, getShellSessionHandoffPackageReport: () => shellViewModel.shellSessionHandoffPackageReport, getShellSessionHandoffPackageDisplayViewModel: () => shellViewModel.shellSessionHandoffPackageDisplayViewModel, + getShellSessionHandoffPackageRenderState: () => shellViewModel.shellSessionHandoffPackageRenderState, isSupportedShellSessionHandoffPackage: shellViewModel.isSupportedShellSessionHandoffPackage, 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 d9c39d1..1700cf2 100644 --- a/wasm-port/runtime/ui/ini-panel/ui-shell.js +++ b/wasm-port/runtime/ui/ini-panel/ui-shell.js @@ -139,6 +139,7 @@ export function createIniPanelLaunchApiManifest(entries = getVisibleIniPanelEntr "getShellSessionHandoffPackage", "getShellSessionHandoffPackageReport", "getShellSessionHandoffPackageDisplayViewModel", + "getShellSessionHandoffPackageRenderState", "isSupportedShellSessionHandoffPackage", "getLauncherLinks", "getControlPageApiMethods", @@ -905,6 +906,38 @@ export function createIniPanelShellSessionHandoffPackageDisplayViewModel( }; } +export function createIniPanelShellSessionHandoffPackageRenderState( + displayViewModel = createIniPanelShellSessionHandoffPackageDisplayViewModel(), +) { + const rows = Array.isArray(displayViewModel?.rows) + ? displayViewModel.rows.map(({ id, label, value }) => ({ + id, + label, + value: value == null ? "" : String(value), + })) + : []; + const ready = displayViewModel?.phase === "ready" && displayViewModel?.statusText === "Ready"; + const statusText = displayViewModel?.statusText ?? (ready ? "Ready" : "Blocked"); + const detailText = displayViewModel?.detailText ?? "No blocking reasons"; + + return { + apiName: "ini-panel-shell-session-handoff-package-render-state", + renderStateVersion: 1, + phase: ready ? "ready" : "blocked", + ready, + title: displayViewModel?.title ?? "Shell handoff package", + statusText, + detailText, + statusLine: `${statusText}: ${detailText}`, + rows, + dataset: { + handoffPhase: ready ? "ready" : "blocked", + handoffReady: ready ? "true" : "false", + handoffScope: "package", + }, + }; +} + export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries()) { const shellIntegrationManifest = createIniPanelShellIntegrationManifest(entries); const shellIntegrationReadiness = createIniPanelShellIntegrationReadiness(shellIntegrationManifest); @@ -955,6 +988,9 @@ export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries const shellSessionHandoffPackageDisplayViewModel = createIniPanelShellSessionHandoffPackageDisplayViewModel( shellSessionHandoffPackageReport, ); + const shellSessionHandoffPackageRenderState = createIniPanelShellSessionHandoffPackageRenderState( + shellSessionHandoffPackageDisplayViewModel, + ); return { pages: entries.map(({ id, href, title }) => ({ id, @@ -978,6 +1014,7 @@ export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries shellSessionHandoffPackageSchema: createIniPanelShellSessionHandoffPackageSchema(), shellSessionHandoffPackageReport, shellSessionHandoffPackageDisplayViewModel, + shellSessionHandoffPackageRenderState, launchApiSchema: createIniPanelLaunchApiSchema(), launchApiManifest: createIniPanelLaunchApiManifest(entries), isSupportedShellIntegrationManifest: isSupportedIniPanelShellIntegrationManifest, @@ -996,6 +1033,7 @@ export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries createShellSessionHandoffPackageSchema: createIniPanelShellSessionHandoffPackageSchema, createShellSessionHandoffPackageReport: createIniPanelShellSessionHandoffPackageReport, createShellSessionHandoffPackageDisplayViewModel: createIniPanelShellSessionHandoffPackageDisplayViewModel, + createShellSessionHandoffPackageRenderState: createIniPanelShellSessionHandoffPackageRenderState, isSupportedShellSessionHandoffPackage: isSupportedIniPanelShellSessionHandoffPackage, controlPage: { browserApiSchema: createControlPageBrowserApiSchema(), diff --git a/wasm-port/tests/browser/ini_panel_launch_smoke.html b/wasm-port/tests/browser/ini_panel_launch_smoke.html index 3177e6d..7e0588e 100644 --- a/wasm-port/tests/browser/ini_panel_launch_smoke.html +++ b/wasm-port/tests/browser/ini_panel_launch_smoke.html @@ -86,6 +86,7 @@ !launchApi?.getShellSessionHandoffPackage || !launchApi?.getShellSessionHandoffPackageReport || !launchApi?.getShellSessionHandoffPackageDisplayViewModel || + !launchApi?.getShellSessionHandoffPackageRenderState || !launchApi?.isSupportedShellSessionHandoffPackage || !launchApi?.getLauncherLinks || !launchApi?.getControlPageApiMethods @@ -126,7 +127,7 @@ ); assertEqual( launchApiManifest.methods.join(","), - "isSupportedLaunchApiManifest,getLaunchApiSchema,getLaunchApiManifest,getShellIntegrationSchema,getShellIntegrationManifest,getShellIntegrationReadiness,getShellSessionHandoffSummarySchema,getShellSessionHandoffSummary,isSupportedShellSessionHandoffSummary,getShellSessionHandoffCompatibilityReport,getShellSessionHandoffDisplayViewModel,getShellSessionHandoffSnapshot,getShellSessionHandoffRenderState,getShellSessionHandoffActionPlan,getShellSessionHandoffChecklist,getShellSessionHandoffPackageSchema,getShellSessionHandoffPackage,getShellSessionHandoffPackageReport,getShellSessionHandoffPackageDisplayViewModel,isSupportedShellSessionHandoffPackage,getLauncherLinks,getControlPageApiMethods", + "isSupportedLaunchApiManifest,getLaunchApiSchema,getLaunchApiManifest,getShellIntegrationSchema,getShellIntegrationManifest,getShellIntegrationReadiness,getShellSessionHandoffSummarySchema,getShellSessionHandoffSummary,isSupportedShellSessionHandoffSummary,getShellSessionHandoffCompatibilityReport,getShellSessionHandoffDisplayViewModel,getShellSessionHandoffSnapshot,getShellSessionHandoffRenderState,getShellSessionHandoffActionPlan,getShellSessionHandoffChecklist,getShellSessionHandoffPackageSchema,getShellSessionHandoffPackage,getShellSessionHandoffPackageReport,getShellSessionHandoffPackageDisplayViewModel,getShellSessionHandoffPackageRenderState,isSupportedShellSessionHandoffPackage,getLauncherLinks,getControlPageApiMethods", "launch API manifest methods", ); const shellIntegrationSchema = launchApi.getShellIntegrationSchema(); @@ -144,6 +145,7 @@ const shellSessionHandoffPackage = launchApi.getShellSessionHandoffPackage(); const shellSessionHandoffPackageReport = launchApi.getShellSessionHandoffPackageReport(); const shellSessionHandoffPackageDisplayViewModel = launchApi.getShellSessionHandoffPackageDisplayViewModel(); + const shellSessionHandoffPackageRenderState = launchApi.getShellSessionHandoffPackageRenderState(); assertEqual( shellIntegrationSchema.manifestVersion, 1, @@ -339,6 +341,21 @@ shellSessionHandoffPackageReport.rows.length, "shell session handoff package display rows", ); + assertEqual( + shellSessionHandoffPackageRenderState.renderStateVersion, + 1, + "shell session handoff package render-state version", + ); + assertEqual( + shellSessionHandoffPackageRenderState.ready, + true, + "shell session handoff package render-state readiness", + ); + assertEqual( + shellSessionHandoffPackageRenderState.rows.length, + shellSessionHandoffPackageDisplayViewModel.rows.length, + "shell session handoff package render-state rows", + ); assertEqual( shellSessionHandoffPackage.ready, true, @@ -405,9 +422,24 @@ "shell session handoff DOM ready", ); assertEqual( - launchDoc.querySelector('[data-handoff-value="missing-fields"]').textContent, + launchDoc.querySelector("[data-handoff-shell]").dataset.handoffScope, + "package", + "shell session handoff DOM scope", + ); + assertEqual( + launchDoc.querySelector('[data-handoff-value="package-supported"]').textContent, + "supported", + "shell session handoff DOM package support", + ); + assertEqual( + launchDoc.querySelector('[data-handoff-value="package-ready"]').textContent, + "ready", + "shell session handoff DOM package readiness", + ); + assertEqual( + launchDoc.querySelector('[data-handoff-value="missing-package-fields"]').textContent, "none", - "shell session handoff DOM missing fields", + "shell session handoff DOM missing package fields", ); assertEqual( launchDoc.querySelector('[data-handoff-value="blocking-reasons"]').textContent, 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 e64794f..a4e8531 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 @@ -77,6 +77,7 @@ TOOL_TABLE = browser-shell-tool.tbl !launchApi?.getShellSessionHandoffPackage || !launchApi?.getShellSessionHandoffPackageReport || !launchApi?.getShellSessionHandoffPackageDisplayViewModel || + !launchApi?.getShellSessionHandoffPackageRenderState || !launchApi?.isSupportedShellSessionHandoffPackage ) { throw new Error("launch API namespace did not expose shell integration helpers"); @@ -96,6 +97,7 @@ TOOL_TABLE = browser-shell-tool.tbl const handoffPackage = launchApi.getShellSessionHandoffPackage(); const handoffPackageReport = launchApi.getShellSessionHandoffPackageReport(); const handoffPackageDisplay = launchApi.getShellSessionHandoffPackageDisplayViewModel(); + const handoffPackageRenderState = launchApi.getShellSessionHandoffPackageRenderState(); assertEqual(handoffSummarySchema.summaryVersion, 1, "shell handoff summary schema version"); assertEqual( launchApi.isSupportedShellSessionHandoffSummary(handoffSummary), @@ -148,6 +150,13 @@ TOOL_TABLE = browser-shell-tool.tbl handoffPackageReport.rows.length, "shell handoff package display rows", ); + assertEqual(handoffPackageRenderState.ready, true, "shell handoff package render-state readiness"); + assertEqual(handoffPackageRenderState.statusLine, "Ready: No blocking reasons", "shell handoff package render-state status"); + assertEqual( + handoffPackageRenderState.rows.length, + handoffPackageDisplay.rows.length, + "shell handoff package render-state rows", + ); assertEqual(handoffPackage.checklist.ready, handoffChecklist.ready, "shell handoff package checklist"); assertEqual( handoffPackage.actionPlan.nextSteps.map(({ id }) => id).join(","), 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 29f1c27..6198110 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 @@ -25,6 +25,7 @@ import { createIniPanelShellSessionHandoffPackage, createIniPanelShellSessionHandoffPackageDisplayViewModel, createIniPanelShellSessionHandoffPackageReport, + createIniPanelShellSessionHandoffPackageRenderState, createIniPanelShellSessionHandoffPackageSchema, createIniPanelShellSessionHandoffRenderState, createIniPanelShellSessionHandoffSnapshot, @@ -86,6 +87,7 @@ const requiredShellExports = [ "createIniPanelShellSessionHandoffPackage", "createIniPanelShellSessionHandoffPackageDisplayViewModel", "createIniPanelShellSessionHandoffPackageReport", + "createIniPanelShellSessionHandoffPackageRenderState", "createIniPanelShellSessionHandoffPackageSchema", "createIniPanelShellSessionHandoffRenderState", "createIniPanelShellSessionHandoffSnapshot", @@ -244,6 +246,12 @@ assert.deepEqual( createIniPanelShellViewModel().shellSessionHandoffPackageReport, ), ); +assert.deepEqual( + createIniPanelShellViewModel().shellSessionHandoffPackageRenderState, + createIniPanelShellSessionHandoffPackageRenderState( + createIniPanelShellViewModel().shellSessionHandoffPackageDisplayViewModel, + ), +); assert.equal(isSupportedIniPanelShellSessionHandoffPackage(createIniPanelShellViewModel().shellSessionHandoffPackage), true); assert.equal(isSupportedIniPanelShellIntegrationManifest(createIniPanelShellViewModel().shellIntegrationManifest), true); assert.deepEqual(createIniPanelShellViewModel().launchApiSchema, createIniPanelLaunchApiSchema()); 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 2cf2cd1..3893979 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 @@ -59,6 +59,7 @@ assert.deepEqual(manifest, { "getShellSessionHandoffPackage", "getShellSessionHandoffPackageReport", "getShellSessionHandoffPackageDisplayViewModel", + "getShellSessionHandoffPackageRenderState", "isSupportedShellSessionHandoffPackage", "getLauncherLinks", "getControlPageApiMethods", @@ -173,6 +174,7 @@ assert.match(launchText, /\bgetShellSessionHandoffPackageSchema\b/); assert.match(launchText, /\bgetShellSessionHandoffPackage\b/); assert.match(launchText, /\bgetShellSessionHandoffPackageReport\b/); assert.match(launchText, /\bgetShellSessionHandoffPackageDisplayViewModel\b/); +assert.match(launchText, /\bgetShellSessionHandoffPackageRenderState\b/); assert.match(launchText, /\bisSupportedShellSessionHandoffPackage\b/); assert.match(launchText, /\blinuxCncIniPanelLaunchApi\b/); 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 64e1771..0e490e7 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 @@ -21,6 +21,7 @@ import { createIniPanelShellSessionHandoffPackage, createIniPanelShellSessionHandoffPackageDisplayViewModel, createIniPanelShellSessionHandoffPackageReport, + createIniPanelShellSessionHandoffPackageRenderState, createIniPanelShellSessionHandoffPackageSchema, createIniPanelShellSessionHandoffRenderState, createIniPanelShellSessionHandoffSnapshot, @@ -75,6 +76,9 @@ const handoffPackageReport = createIniPanelShellSessionHandoffPackageReport(hand const handoffPackageDisplayViewModel = createIniPanelShellSessionHandoffPackageDisplayViewModel( handoffPackageReport, ); +const handoffPackageRenderState = createIniPanelShellSessionHandoffPackageRenderState( + handoffPackageDisplayViewModel, +); assert.deepEqual(schema, { apiName: "ini-panel-shell-integration", @@ -130,7 +134,7 @@ assert.deepEqual(readiness, { counts: { pages: 2, launcherLinks: 2, - launchMethods: 22, + launchMethods: 23, controlPageMethods: 11, persistenceCapabilities: 3, }, @@ -192,7 +196,7 @@ assert.deepEqual(handoffSummary, { counts: { pages: 2, launcherLinks: 2, - launchMethods: 22, + launchMethods: 23, controlPageMethods: 11, persistenceCapabilities: 3, }, @@ -555,6 +559,22 @@ assert.deepEqual(handoffPackageDisplayViewModel, { detailText: "No blocking reasons", rows: handoffPackageReport.rows, }); +assert.deepEqual(handoffPackageRenderState, { + apiName: "ini-panel-shell-session-handoff-package-render-state", + renderStateVersion: 1, + phase: "ready", + ready: true, + title: "Shell handoff package", + statusText: "Ready", + detailText: "No blocking reasons", + statusLine: "Ready: No blocking reasons", + rows: handoffPackageDisplayViewModel.rows, + dataset: { + handoffPhase: "ready", + handoffReady: "true", + handoffScope: "package", + }, +}); assert.equal(isSupportedIniPanelShellSessionHandoffPackage(handoffPackage), true); assert.equal( isSupportedIniPanelShellSessionHandoffPackage({ ...handoffPackage, packageVersion: 2 }), @@ -601,6 +621,58 @@ assert.equal( ).statusText, "Blocked", ); +assert.deepEqual( + createIniPanelShellSessionHandoffPackageRenderState(createIniPanelShellSessionHandoffPackageDisplayViewModel( + createIniPanelShellSessionHandoffPackageReport({ ...handoffPackage, packageVersion: 2 }), + )), + { + apiName: "ini-panel-shell-session-handoff-package-render-state", + renderStateVersion: 1, + phase: "blocked", + ready: false, + title: "Shell handoff package", + statusText: "Blocked", + detailText: "packageVersion", + statusLine: "Blocked: packageVersion", + rows: [ + { + id: "package-supported", + label: "Package schema", + value: "blocked", + }, + { + id: "package-ready", + label: "Package readiness", + value: "blocked", + }, + { + id: "missing-package-fields", + label: "Missing package fields", + value: "none", + }, + { + id: "missing-manifest-fields", + label: "Missing manifest fields", + value: "none", + }, + { + id: "mismatch-fields", + label: "Mismatched fields", + value: "packageVersion", + }, + { + id: "blocking-reasons", + label: "Blocking reasons", + value: "none", + }, + ], + dataset: { + handoffPhase: "blocked", + handoffReady: "false", + handoffScope: "package", + }, + }, +); assert.deepEqual( createIniPanelShellSessionHandoffPackageReport(missingManifestField).missingManifestFields, ["controlPageMethods"], @@ -832,7 +904,7 @@ assert.deepEqual(createIniPanelShellIntegrationReadiness(blockedManifest), { counts: { pages: 2, launcherLinks: 2, - launchMethods: 22, + launchMethods: 23, controlPageMethods: 11, persistenceCapabilities: 3, }, @@ -999,6 +1071,7 @@ assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffDisp assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffPackage\b/); assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffPackageDisplayViewModel\b/); assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffPackageReport\b/); +assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffPackageRenderState\b/); assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffPackageSchema\b/); assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffRenderState\b/); assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffSnapshot\b/); @@ -1020,6 +1093,7 @@ assert.match(docText, /\bcreateIniPanelShellSessionHandoffDisplayViewModel\b/); assert.match(docText, /\bcreateIniPanelShellSessionHandoffPackage\b/); assert.match(docText, /\bcreateIniPanelShellSessionHandoffPackageDisplayViewModel\b/); assert.match(docText, /\bcreateIniPanelShellSessionHandoffPackageReport\b/); +assert.match(docText, /\bcreateIniPanelShellSessionHandoffPackageRenderState\b/); assert.match(docText, /\bcreateIniPanelShellSessionHandoffPackageSchema\b/); assert.match(docText, /\bcreateIniPanelShellSessionHandoffRenderState\b/); assert.match(docText, /\bcreateIniPanelShellSessionHandoffSnapshot\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 d8916eb..91e2935 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 @@ -21,6 +21,7 @@ import { createIniPanelShellSessionHandoffPackage, createIniPanelShellSessionHandoffPackageDisplayViewModel, createIniPanelShellSessionHandoffPackageReport, + createIniPanelShellSessionHandoffPackageRenderState, createIniPanelShellSessionHandoffPackageSchema, createIniPanelShellSessionHandoffRenderState, createIniPanelShellSessionHandoffSnapshot, @@ -87,6 +88,7 @@ assert.equal(typeof createIniPanelShellSessionHandoffDisplayViewModel, "function assert.equal(typeof createIniPanelShellSessionHandoffPackage, "function"); assert.equal(typeof createIniPanelShellSessionHandoffPackageDisplayViewModel, "function"); assert.equal(typeof createIniPanelShellSessionHandoffPackageReport, "function"); +assert.equal(typeof createIniPanelShellSessionHandoffPackageRenderState, "function"); assert.equal(typeof createIniPanelShellSessionHandoffPackageSchema, "function"); assert.equal(typeof createIniPanelShellSessionHandoffRenderState, "function"); assert.equal(typeof createIniPanelShellSessionHandoffSnapshot, "function"); @@ -216,6 +218,10 @@ assert.deepEqual( shellViewModel.shellSessionHandoffPackageDisplayViewModel, createIniPanelShellSessionHandoffPackageDisplayViewModel(shellViewModel.shellSessionHandoffPackageReport), ); +assert.deepEqual( + shellViewModel.shellSessionHandoffPackageRenderState, + createIniPanelShellSessionHandoffPackageRenderState(shellViewModel.shellSessionHandoffPackageDisplayViewModel), +); assert.equal(isSupportedIniPanelShellSessionHandoffPackage(shellViewModel.shellSessionHandoffPackage), true); assert.deepEqual(shellViewModel.shellSessionHandoffDisplayViewModel, { phase: "ready", @@ -442,6 +448,22 @@ assert.deepEqual(shellViewModel.shellSessionHandoffPackageDisplayViewModel, { detailText: "No blocking reasons", rows: shellViewModel.shellSessionHandoffPackageReport.rows, }); +assert.deepEqual(shellViewModel.shellSessionHandoffPackageRenderState, { + apiName: "ini-panel-shell-session-handoff-package-render-state", + renderStateVersion: 1, + phase: "ready", + ready: true, + title: "Shell handoff package", + statusText: "Ready", + detailText: "No blocking reasons", + statusLine: "Ready: No blocking reasons", + rows: shellViewModel.shellSessionHandoffPackageDisplayViewModel.rows, + dataset: { + handoffPhase: "ready", + handoffReady: "true", + handoffScope: "package", + }, +}); assert.equal( isSupportedIniPanelShellIntegrationManifest(shellViewModel.shellIntegrationManifest), true, @@ -494,6 +516,10 @@ assert.equal( shellViewModel.createShellSessionHandoffPackageDisplayViewModel, createIniPanelShellSessionHandoffPackageDisplayViewModel, ); +assert.equal( + shellViewModel.createShellSessionHandoffPackageRenderState, + createIniPanelShellSessionHandoffPackageRenderState, +); assert.equal(shellViewModel.createShellSessionHandoffPackageReport, createIniPanelShellSessionHandoffPackageReport); assert.equal(shellViewModel.createShellSessionHandoffPackageSchema, createIniPanelShellSessionHandoffPackageSchema); assert.equal(shellViewModel.isSupportedShellSessionHandoffPackage, isSupportedIniPanelShellSessionHandoffPackage);