推进 INI 面板 shell handoff checklist

This commit is contained in:
2026-06-15 10:07:44 +08:00
parent 2a7485c14d
commit c92021fa82
10 changed files with 402 additions and 5 deletions

View File

@@ -81,6 +81,7 @@
!launchApi?.getShellSessionHandoffSnapshot ||
!launchApi?.getShellSessionHandoffRenderState ||
!launchApi?.getShellSessionHandoffActionPlan ||
!launchApi?.getShellSessionHandoffChecklist ||
!launchApi?.getLauncherLinks ||
!launchApi?.getControlPageApiMethods
) {
@@ -120,7 +121,7 @@
);
assertEqual(
launchApiManifest.methods.join(","),
"isSupportedLaunchApiManifest,getLaunchApiSchema,getLaunchApiManifest,getShellIntegrationSchema,getShellIntegrationManifest,getShellIntegrationReadiness,getShellSessionHandoffSummarySchema,getShellSessionHandoffSummary,isSupportedShellSessionHandoffSummary,getShellSessionHandoffCompatibilityReport,getShellSessionHandoffDisplayViewModel,getShellSessionHandoffSnapshot,getShellSessionHandoffRenderState,getShellSessionHandoffActionPlan,getLauncherLinks,getControlPageApiMethods",
"isSupportedLaunchApiManifest,getLaunchApiSchema,getLaunchApiManifest,getShellIntegrationSchema,getShellIntegrationManifest,getShellIntegrationReadiness,getShellSessionHandoffSummarySchema,getShellSessionHandoffSummary,isSupportedShellSessionHandoffSummary,getShellSessionHandoffCompatibilityReport,getShellSessionHandoffDisplayViewModel,getShellSessionHandoffSnapshot,getShellSessionHandoffRenderState,getShellSessionHandoffActionPlan,getShellSessionHandoffChecklist,getLauncherLinks,getControlPageApiMethods",
"launch API manifest methods",
);
const shellIntegrationSchema = launchApi.getShellIntegrationSchema();
@@ -133,6 +134,7 @@
const shellSessionHandoffSnapshot = launchApi.getShellSessionHandoffSnapshot();
const shellSessionHandoffRenderState = launchApi.getShellSessionHandoffRenderState();
const shellSessionHandoffActionPlan = launchApi.getShellSessionHandoffActionPlan();
const shellSessionHandoffChecklist = launchApi.getShellSessionHandoffChecklist();
assertEqual(
shellIntegrationSchema.manifestVersion,
1,
@@ -263,6 +265,26 @@
"readControlPageStatus",
"shell session handoff action-plan read method",
);
assertEqual(
shellSessionHandoffChecklist.checklistVersion,
1,
"shell session handoff checklist version",
);
assertEqual(
shellSessionHandoffChecklist.ready,
true,
"shell session handoff checklist readiness",
);
assertEqual(
shellSessionHandoffChecklist.checks.map(({ status }) => status).join(","),
"pass,pass,pass,pass,pass",
"shell session handoff checklist checks",
);
assertEqual(
shellSessionHandoffChecklist.nextStepIds.join(","),
"open-control-page,read-readonly-status",
"shell session handoff checklist next step ids",
);
assertEqual(
JSON.stringify(shellSessionHandoffSnapshot.readiness),
JSON.stringify(shellIntegrationReadiness),
@@ -288,6 +310,11 @@
JSON.stringify(shellSessionHandoffRenderState.rows),
"shell session handoff action-plan rows",
);
assertEqual(
JSON.stringify(shellSessionHandoffChecklist.displayRows),
JSON.stringify(shellSessionHandoffRenderState.rows),
"shell session handoff checklist rows",
);
assertEqual(
launchDoc.querySelector("[data-handoff-status]").textContent,
"Ready: No blocking reasons",

View File

@@ -71,7 +71,8 @@ TOOL_TABLE = browser-shell-tool.tbl
!launchApi?.getShellSessionHandoffDisplayViewModel ||
!launchApi?.getShellSessionHandoffSnapshot ||
!launchApi?.getShellSessionHandoffRenderState ||
!launchApi?.getShellSessionHandoffActionPlan
!launchApi?.getShellSessionHandoffActionPlan ||
!launchApi?.getShellSessionHandoffChecklist
) {
throw new Error("launch API namespace did not expose shell integration helpers");
}
@@ -85,6 +86,7 @@ TOOL_TABLE = browser-shell-tool.tbl
const handoffSnapshot = launchApi.getShellSessionHandoffSnapshot();
const handoffRenderState = launchApi.getShellSessionHandoffRenderState();
const handoffActionPlan = launchApi.getShellSessionHandoffActionPlan();
const handoffChecklist = launchApi.getShellSessionHandoffChecklist();
assertEqual(handoffSummarySchema.summaryVersion, 1, "shell handoff summary schema version");
assertEqual(
launchApi.isSupportedShellSessionHandoffSummary(handoffSummary),
@@ -108,6 +110,18 @@ TOOL_TABLE = browser-shell-tool.tbl
"open-control-page,read-readonly-status",
"shell handoff action-plan next steps",
);
assertEqual(handoffChecklist.ready, true, "shell handoff checklist readiness");
assertEqual(handoffChecklist.checks.length, 5, "shell handoff checklist checks");
assertEqual(
handoffChecklist.checks.map(({ status }) => status).join(","),
"pass,pass,pass,pass,pass",
"shell handoff checklist check status",
);
assertEqual(
handoffChecklist.nextStepIds.join(","),
"open-control-page,read-readonly-status",
"shell handoff checklist next steps",
);
assertEqual(readiness.phase, "ready", "shell integration readiness phase");
assertEqual(readiness.ready, true, "shell integration readiness");
assertEqual(readiness.missing.join(","), "", "shell integration readiness missing checks");

View File

@@ -19,6 +19,7 @@ import {
createIniPanelShellIntegrationSchema,
createIniPanelShellIntegrationWorkflowPlan,
createIniPanelShellSessionHandoffActionPlan,
createIniPanelShellSessionHandoffChecklist,
createIniPanelShellSessionHandoffCompatibilityReport,
createIniPanelShellSessionHandoffDisplayViewModel,
createIniPanelShellSessionHandoffRenderState,
@@ -74,6 +75,7 @@ const requiredShellExports = [
"createIniPanelShellIntegrationSchema",
"createIniPanelShellIntegrationWorkflowPlan",
"createIniPanelShellSessionHandoffActionPlan",
"createIniPanelShellSessionHandoffChecklist",
"createIniPanelShellSessionHandoffCompatibilityReport",
"createIniPanelShellSessionHandoffDisplayViewModel",
"createIniPanelShellSessionHandoffRenderState",
@@ -199,6 +201,13 @@ assert.deepEqual(
renderState: createIniPanelShellViewModel().shellSessionHandoffRenderState,
}),
);
assert.deepEqual(
createIniPanelShellViewModel().shellSessionHandoffChecklist,
createIniPanelShellSessionHandoffChecklist({
actionPlan: createIniPanelShellViewModel().shellSessionHandoffActionPlan,
renderState: createIniPanelShellViewModel().shellSessionHandoffRenderState,
}),
);
assert.equal(isSupportedIniPanelShellIntegrationManifest(createIniPanelShellViewModel().shellIntegrationManifest), true);
assert.deepEqual(createIniPanelShellViewModel().launchApiSchema, createIniPanelLaunchApiSchema());
assert.deepEqual(createIniPanelShellViewModel().launchApiManifest, createIniPanelLaunchApiManifest());
@@ -254,6 +263,7 @@ assert.match(shellText, /\bexport function createIniPanelShellIntegrationManifes
assert.match(shellText, /\bexport function createIniPanelShellIntegrationReadiness\b/);
assert.match(shellText, /\bexport function createIniPanelShellIntegrationWorkflowPlan\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffActionPlan\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffChecklist\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffCompatibilityReport\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffDisplayViewModel\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffRenderState\b/);
@@ -283,6 +293,7 @@ assert.match(launchText, /\bgetShellSessionHandoffDisplayViewModel\b/);
assert.match(launchText, /\bgetShellSessionHandoffSnapshot\b/);
assert.match(launchText, /\bgetShellSessionHandoffRenderState\b/);
assert.match(launchText, /\bgetShellSessionHandoffActionPlan\b/);
assert.match(launchText, /\bgetShellSessionHandoffChecklist\b/);
assert.match(launchText, /\bdata-handoff-shell\b/);
assert.match(launchText, /\bdata-handoff-status\b/);
assert.match(launchText, /\bdata-handoff-rows\b/);
@@ -305,6 +316,7 @@ assert.match(docText, /\bcreateIniPanelShellIntegrationReadiness\b/);
assert.match(docText, /\bcreateIniPanelShellIntegrationSchema\b/);
assert.match(docText, /\bcreateIniPanelShellIntegrationWorkflowPlan\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffActionPlan\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffChecklist\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffCompatibilityReport\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffDisplayViewModel\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffRenderState\b/);
@@ -329,6 +341,7 @@ assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getShellSessionHandoffDispla
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getShellSessionHandoffSnapshot\b/);
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getShellSessionHandoffRenderState\b/);
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getShellSessionHandoffActionPlan\b/);
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getShellSessionHandoffChecklist\b/);
assert.match(docText, /\bdata-handoff-shell\b/);
assert.match(docText, /\bdata-handoff-status\b/);
assert.match(docText, /\bdata-handoff-rows\b/);
@@ -343,6 +356,7 @@ assert.match(shellIntegrationWorkflowSmokeText, /\bgetShellSessionHandoffDisplay
assert.match(shellIntegrationWorkflowSmokeText, /\bgetShellSessionHandoffSnapshot\b/);
assert.match(shellIntegrationWorkflowSmokeText, /\bgetShellSessionHandoffRenderState\b/);
assert.match(shellIntegrationWorkflowSmokeText, /\bgetShellSessionHandoffActionPlan\b/);
assert.match(shellIntegrationWorkflowSmokeText, /\bgetShellSessionHandoffChecklist\b/);
assert.match(shellIntegrationWorkflowSmokeText, /\bhandoffSummary\.handoffMethods\.readStatus\b/);
assert.match(shellIntegrationWorkflowSmokeText, /\breadControlPageStatus\b/);
assert.match(shellIntegrationWorkflowSmokeText, /\bbrowser_ini_shell_integration_workflow_smoke=ok\b/);

View File

@@ -54,6 +54,7 @@ assert.deepEqual(manifest, {
"getShellSessionHandoffSnapshot",
"getShellSessionHandoffRenderState",
"getShellSessionHandoffActionPlan",
"getShellSessionHandoffChecklist",
"getLauncherLinks",
"getControlPageApiMethods",
],
@@ -162,6 +163,7 @@ assert.match(launchText, /\bgetShellSessionHandoffDisplayViewModel\b/);
assert.match(launchText, /\bgetShellSessionHandoffSnapshot\b/);
assert.match(launchText, /\bgetShellSessionHandoffRenderState\b/);
assert.match(launchText, /\bgetShellSessionHandoffActionPlan\b/);
assert.match(launchText, /\bgetShellSessionHandoffChecklist\b/);
assert.match(launchText, /\blinuxCncIniPanelLaunchApi\b/);
console.log("ini_panel_launch_api_manifest_node_smoke=ok");

View File

@@ -15,6 +15,7 @@ import {
createIniPanelShellIntegrationSchema,
createIniPanelShellIntegrationWorkflowPlan,
createIniPanelShellSessionHandoffActionPlan,
createIniPanelShellSessionHandoffChecklist,
createIniPanelShellSessionHandoffCompatibilityReport,
createIniPanelShellSessionHandoffDisplayViewModel,
createIniPanelShellSessionHandoffRenderState,
@@ -51,6 +52,10 @@ const handoffActionPlan = createIniPanelShellSessionHandoffActionPlan({
snapshot: handoffSnapshot,
renderState: handoffRenderState,
});
const handoffChecklist = createIniPanelShellSessionHandoffChecklist({
actionPlan: handoffActionPlan,
renderState: handoffRenderState,
});
assert.deepEqual(schema, {
apiName: "ini-panel-shell-integration",
@@ -106,7 +111,7 @@ assert.deepEqual(readiness, {
counts: {
pages: 2,
launcherLinks: 2,
launchMethods: 16,
launchMethods: 17,
controlPageMethods: 11,
persistenceCapabilities: 3,
},
@@ -168,7 +173,7 @@ assert.deepEqual(handoffSummary, {
counts: {
pages: 2,
launcherLinks: 2,
launchMethods: 16,
launchMethods: 17,
controlPageMethods: 11,
persistenceCapabilities: 3,
},
@@ -367,9 +372,52 @@ assert.deepEqual(handoffActionPlan, {
},
],
});
assert.deepEqual(handoffChecklist, {
apiName: "ini-panel-shell-session-handoff-checklist",
checklistVersion: 1,
phase: "ready",
ready: true,
statusLine: "Ready: No blocking reasons",
checks: [
{
id: "render-state",
label: "Render state",
status: "pass",
value: "Ready: No blocking reasons",
},
{
id: "target-page",
label: "Control target",
status: "pass",
value: "./control-page.html",
},
{
id: "load-session-method",
label: "Load session method",
status: "pass",
value: "loadControlPageSessionState",
},
{
id: "read-status-method",
label: "Read status method",
status: "pass",
value: "readControlPageStatus",
},
{
id: "blocking-reasons",
label: "Blocking reasons",
status: "pass",
value: "none",
},
],
displayRows: handoffActionPlan.displayRows,
nextStepIds: ["open-control-page", "read-readonly-status"],
blockingReasons: [],
});
assert.equal(createIniPanelShellSessionHandoffSnapshot().displayViewModel.rows.length, 5);
assert.equal(createIniPanelShellSessionHandoffRenderState().statusLine, "Ready: No blocking reasons");
assert.equal(createIniPanelShellSessionHandoffActionPlan().nextSteps.length, 2);
assert.equal(createIniPanelShellSessionHandoffChecklist().checks.length, 5);
assert.deepEqual(
createIniPanelShellSessionHandoffDisplayViewModel(
createIniPanelShellSessionHandoffCompatibilityReport({ ...handoffSummary, summaryVersion: 2 }),
@@ -510,6 +558,61 @@ assert.deepEqual(
},
],
);
assert.deepEqual(
createIniPanelShellSessionHandoffChecklist({
actionPlan: createIniPanelShellSessionHandoffActionPlan({
snapshot: createIniPanelShellSessionHandoffSnapshot({
summary: {
...handoffSummary,
summaryVersion: 2,
},
compatibilityReport: createIniPanelShellSessionHandoffCompatibilityReport({
...handoffSummary,
summaryVersion: 2,
}),
}),
renderState: createIniPanelShellSessionHandoffRenderState(createIniPanelShellSessionHandoffSnapshot({
compatibilityReport: createIniPanelShellSessionHandoffCompatibilityReport({
...handoffSummary,
summaryVersion: 2,
}),
})),
}),
renderState: createIniPanelShellSessionHandoffRenderState(createIniPanelShellSessionHandoffSnapshot({
compatibilityReport: createIniPanelShellSessionHandoffCompatibilityReport({
...handoffSummary,
summaryVersion: 2,
}),
})),
}).checks.map(({ id, status, value }) => ({ id, status, value })),
[
{
id: "render-state",
status: "blocked",
value: "Blocked: summaryVersion",
},
{
id: "target-page",
status: "pass",
value: "./control-page.html",
},
{
id: "load-session-method",
status: "pass",
value: "loadControlPageSessionState",
},
{
id: "read-status-method",
status: "pass",
value: "readControlPageStatus",
},
{
id: "blocking-reasons",
status: "pass",
value: "none",
},
],
);
const blockedManifest = {
...createIniPanelShellIntegrationManifest(),
compatibility: {
@@ -531,7 +634,7 @@ assert.deepEqual(createIniPanelShellIntegrationReadiness(blockedManifest), {
counts: {
pages: 2,
launcherLinks: 2,
launchMethods: 16,
launchMethods: 17,
controlPageMethods: 11,
persistenceCapabilities: 3,
},
@@ -692,6 +795,7 @@ assert.match(shellText, /\bexport function createIniPanelShellIntegrationManifes
assert.match(shellText, /\bexport function createIniPanelShellIntegrationReadiness\b/);
assert.match(shellText, /\bexport function createIniPanelShellIntegrationWorkflowPlan\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffActionPlan\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffChecklist\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffCompatibilityReport\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffDisplayViewModel\b/);
assert.match(shellText, /\bexport function createIniPanelShellSessionHandoffRenderState\b/);
@@ -707,6 +811,7 @@ assert.match(docText, /\bcreateIniPanelShellIntegrationManifest\b/);
assert.match(docText, /\bcreateIniPanelShellIntegrationReadiness\b/);
assert.match(docText, /\bcreateIniPanelShellIntegrationWorkflowPlan\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffActionPlan\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffChecklist\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffCompatibilityReport\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffDisplayViewModel\b/);
assert.match(docText, /\bcreateIniPanelShellSessionHandoffRenderState\b/);

View File

@@ -15,6 +15,7 @@ import {
createIniPanelShellIntegrationSchema,
createIniPanelShellIntegrationWorkflowPlan,
createIniPanelShellSessionHandoffActionPlan,
createIniPanelShellSessionHandoffChecklist,
createIniPanelShellSessionHandoffCompatibilityReport,
createIniPanelShellSessionHandoffDisplayViewModel,
createIniPanelShellSessionHandoffRenderState,
@@ -75,6 +76,7 @@ assert.equal(typeof createIniPanelShellIntegrationReadiness, "function");
assert.equal(typeof createIniPanelShellIntegrationSchema, "function");
assert.equal(typeof createIniPanelShellIntegrationWorkflowPlan, "function");
assert.equal(typeof createIniPanelShellSessionHandoffActionPlan, "function");
assert.equal(typeof createIniPanelShellSessionHandoffChecklist, "function");
assert.equal(typeof createIniPanelShellSessionHandoffCompatibilityReport, "function");
assert.equal(typeof createIniPanelShellSessionHandoffDisplayViewModel, "function");
assert.equal(typeof createIniPanelShellSessionHandoffRenderState, "function");
@@ -176,6 +178,13 @@ assert.deepEqual(
renderState: shellViewModel.shellSessionHandoffRenderState,
}),
);
assert.deepEqual(
shellViewModel.shellSessionHandoffChecklist,
createIniPanelShellSessionHandoffChecklist({
actionPlan: shellViewModel.shellSessionHandoffActionPlan,
renderState: shellViewModel.shellSessionHandoffRenderState,
}),
);
assert.deepEqual(shellViewModel.shellSessionHandoffDisplayViewModel, {
phase: "ready",
title: "Shell handoff compatibility",
@@ -259,6 +268,48 @@ assert.deepEqual(shellViewModel.shellSessionHandoffActionPlan, {
},
],
});
assert.deepEqual(shellViewModel.shellSessionHandoffChecklist, {
apiName: "ini-panel-shell-session-handoff-checklist",
checklistVersion: 1,
phase: "ready",
ready: true,
statusLine: "Ready: No blocking reasons",
checks: [
{
id: "render-state",
label: "Render state",
status: "pass",
value: "Ready: No blocking reasons",
},
{
id: "target-page",
label: "Control target",
status: "pass",
value: "./control-page.html",
},
{
id: "load-session-method",
label: "Load session method",
status: "pass",
value: "loadControlPageSessionState",
},
{
id: "read-status-method",
label: "Read status method",
status: "pass",
value: "readControlPageStatus",
},
{
id: "blocking-reasons",
label: "Blocking reasons",
status: "pass",
value: "none",
},
],
displayRows: shellViewModel.shellSessionHandoffActionPlan.displayRows,
nextStepIds: ["open-control-page", "read-readonly-status"],
blockingReasons: [],
});
assert.equal(
isSupportedIniPanelShellIntegrationManifest(shellViewModel.shellIntegrationManifest),
true,
@@ -305,6 +356,7 @@ assert.equal(
assert.equal(shellViewModel.createShellSessionHandoffSnapshot, createIniPanelShellSessionHandoffSnapshot);
assert.equal(shellViewModel.createShellSessionHandoffRenderState, createIniPanelShellSessionHandoffRenderState);
assert.equal(shellViewModel.createShellSessionHandoffActionPlan, createIniPanelShellSessionHandoffActionPlan);
assert.equal(shellViewModel.createShellSessionHandoffChecklist, createIniPanelShellSessionHandoffChecklist);
assert.deepEqual(shellViewModel.controlPage.contract, createIniPanelShellControlPageContract());
assert.equal(shellViewModel.controlPage.isSupportedBrowserApiManifest, isSupportedIniPanelControlPageApiManifest);
assert.equal(shellViewModel.controlPage.loadSessionState, loadMachineSessionForControlPageWorkflow);