推进 INI 面板 launch mount-state DOM 渲染

This commit is contained in:
2026-06-15 11:43:00 +08:00
parent df0773b431
commit 1375e0ddd5
5 changed files with 134 additions and 1 deletions

View File

@@ -224,7 +224,9 @@ when an outer shell needs mount-state checks as stable read-only label/value
rows. Use `createIniPanelShellSessionHandoffPackageMountRenderState()` or
`linuxCncIniPanelLaunchApi.getShellSessionHandoffPackageMountRenderState()`
when those rows need a status line and `[data-handoff-shell]` style dataset
flags for DOM rendering.
flags for DOM rendering. The launch page renders the default waiting mount
state into `[data-handoff-mount]`, `[data-handoff-mount-status]`, and
`[data-handoff-mount-rows]` without opening the control page.
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,

View File

@@ -95,6 +95,10 @@
<p data-handoff-status>Checking shell handoff compatibility.</p>
<dl data-handoff-rows></dl>
</section>
<section class="handoff-status" aria-label="Shell handoff mount readiness" data-handoff-mount>
<p data-handoff-mount-status>Checking shell handoff mount readiness.</p>
<dl data-handoff-mount-rows></dl>
</section>
</section>
</main>
<script type="module">
@@ -130,6 +134,24 @@
detail.textContent = row.value;
handoffRows.append(term, detail);
}
const handoffMountRenderState = shellViewModel.shellSessionHandoffPackageMountRenderState;
const handoffMount = document.querySelector("[data-handoff-mount]");
handoffMount.dataset.handoffPhase = handoffMountRenderState.dataset.handoffPhase;
handoffMount.dataset.handoffReady = handoffMountRenderState.dataset.handoffReady;
handoffMount.dataset.handoffScope = handoffMountRenderState.dataset.handoffScope;
document.querySelector("[data-handoff-mount-status]").textContent = handoffMountRenderState.statusLine;
const handoffMountRows = document.querySelector("[data-handoff-mount-rows]");
for (const row of handoffMountRenderState.rows) {
const term = document.createElement("dt");
term.dataset.handoffMountRow = row.id;
term.dataset.handoffMountStatus = row.status;
term.textContent = row.label;
const detail = document.createElement("dd");
detail.dataset.handoffMountValue = row.id;
detail.dataset.handoffMountStatus = row.status;
detail.textContent = row.value;
handoffMountRows.append(term, detail);
}
window.linuxCncIniPanelLaunchApi = {
isSupportedLaunchApiManifest: isSupportedIniPanelLaunchApiManifest,

View File

@@ -487,6 +487,36 @@
"none",
"shell session handoff DOM blocking reasons",
);
assertEqual(
launchDoc.querySelector("[data-handoff-mount-status]").textContent,
"Blocked: session-load-state",
"shell session handoff mount DOM status",
);
assertEqual(
launchDoc.querySelector("[data-handoff-mount]").dataset.handoffPhase,
"blocked",
"shell session handoff mount DOM phase",
);
assertEqual(
launchDoc.querySelector("[data-handoff-mount]").dataset.handoffReady,
"false",
"shell session handoff mount DOM ready",
);
assertEqual(
launchDoc.querySelector("[data-handoff-mount]").dataset.handoffScope,
"mount",
"shell session handoff mount DOM scope",
);
assertEqual(
launchDoc.querySelector('[data-handoff-mount-value="session-load-state"]').textContent,
"waiting-panel",
"shell session handoff mount DOM session state",
);
assertEqual(
launchDoc.querySelector('[data-handoff-mount-value="session-load-state"]').dataset.handoffMountStatus,
"blocked",
"shell session handoff mount DOM session status",
);
assertEqual(
shellSessionHandoffSummary.targetPage.href,
"./control-page.html",

View File

@@ -182,6 +182,9 @@ assert.match(launchText, /\bgetShellSessionHandoffPackageMountState\b/);
assert.match(launchText, /\bgetShellSessionHandoffPackageMountDisplayViewModel\b/);
assert.match(launchText, /\bgetShellSessionHandoffPackageMountRenderState\b/);
assert.match(launchText, /\bisSupportedShellSessionHandoffPackage\b/);
assert.match(launchText, /\bdata-handoff-mount\b/);
assert.match(launchText, /\bdata-handoff-mount-status\b/);
assert.match(launchText, /\bdata-handoff-mount-rows\b/);
assert.match(launchText, /\blinuxCncIniPanelLaunchApi\b/);
console.log("ini_panel_launch_api_manifest_node_smoke=ok");