推进 INI 面板 shell handoff workflow overview surface
This commit is contained in:
@@ -80,6 +80,7 @@ and the control-view renderer. It does not implement CNC behavior.
|
||||
| Launch | `runtime/ui/ini-panel/launch.html` | Read-only entry page for available panel surfaces. |
|
||||
| Edit and run | `runtime/ui/ini-panel/index.html` | Editable INI panel and existing run workflow surface. |
|
||||
| Read-only control view | `runtime/ui/ini-panel/control-page.html` | Read-only control view backed by the panel API. |
|
||||
| Workflow overview | `runtime/ui/ini-panel/workflow-overview.html` | Read-only shell handoff workflow overview surface. |
|
||||
|
||||
## Visible Entries
|
||||
|
||||
@@ -89,6 +90,7 @@ The visible launch entries come from `getVisibleIniPanelEntries()`:
|
||||
| --- | --- | --- |
|
||||
| `edit-run` | `./index.html` | Open edit and run panel |
|
||||
| `control-view` | `./control-page.html` | Open read-only control view |
|
||||
| `workflow-overview` | `./workflow-overview.html` | Open shell handoff overview |
|
||||
|
||||
Launcher pages can render links from `createIniPanelLauncherLinkViewModel()`
|
||||
without reading manifest field names directly. Each item has `entryId`, `href`,
|
||||
|
||||
@@ -9,6 +9,11 @@ export const INI_PANEL_ENTRIES = [
|
||||
title: "Open read-only control view",
|
||||
href: "./control-page.html",
|
||||
},
|
||||
{
|
||||
id: "workflow-overview",
|
||||
title: "Open shell handoff overview",
|
||||
href: "./workflow-overview.html",
|
||||
},
|
||||
];
|
||||
|
||||
export function getIniPanelEntryManifest() {
|
||||
|
||||
@@ -86,10 +86,11 @@
|
||||
<main>
|
||||
<section class="panel">
|
||||
<h1>LinuxCNC INI Panel</h1>
|
||||
<p>Choose the editable panel or the read-only control view.</p>
|
||||
<p>Choose the editable panel, the read-only control view, or the shell handoff overview.</p>
|
||||
<div class="links">
|
||||
<a data-entry-id="edit-run" href="./index.html">Open edit and run panel</a>
|
||||
<a data-entry-id="control-view" href="./control-page.html">Open read-only control view</a>
|
||||
<a data-entry-id="workflow-overview" href="./workflow-overview.html">Open shell handoff overview</a>
|
||||
</div>
|
||||
<section class="handoff-status" aria-label="Shell handoff compatibility" data-handoff-shell>
|
||||
<p data-handoff-status>Checking shell handoff compatibility.</p>
|
||||
|
||||
124
wasm-port/runtime/ui/ini-panel/workflow-overview.html
Normal file
124
wasm-port/runtime/ui/ini-panel/workflow-overview.html
Normal file
@@ -0,0 +1,124 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>LinuxCNC INI Workflow Overview</title>
|
||||
<style>
|
||||
:root {
|
||||
color-scheme: light;
|
||||
--bg: #f2f5f8;
|
||||
--panel: #ffffff;
|
||||
--border: #cfd8e1;
|
||||
--text: #17212b;
|
||||
--muted: #5a6875;
|
||||
--accent: #1366a6;
|
||||
}
|
||||
* { box-sizing: border-box; }
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: "Segoe UI", "Noto Sans", sans-serif;
|
||||
background: var(--bg);
|
||||
color: var(--text);
|
||||
}
|
||||
main {
|
||||
max-width: 960px;
|
||||
margin: 0 auto;
|
||||
padding: 24px;
|
||||
display: grid;
|
||||
gap: 16px;
|
||||
}
|
||||
.panel {
|
||||
background: var(--panel);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 10px 30px rgba(17, 34, 51, 0.06);
|
||||
padding: 16px;
|
||||
display: grid;
|
||||
gap: 14px;
|
||||
}
|
||||
h1 {
|
||||
margin: 0;
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
}
|
||||
p {
|
||||
margin: 0;
|
||||
color: var(--muted);
|
||||
font: 13px/1.5 "Segoe UI", "Noto Sans", sans-serif;
|
||||
}
|
||||
.overview-status {
|
||||
border-top: 1px solid var(--border);
|
||||
padding-top: 12px;
|
||||
display: grid;
|
||||
gap: 8px;
|
||||
}
|
||||
.overview-status dl {
|
||||
margin: 0;
|
||||
display: grid;
|
||||
grid-template-columns: minmax(120px, 180px) 1fr;
|
||||
gap: 6px 12px;
|
||||
font: 13px/1.4 "Segoe UI", "Noto Sans", sans-serif;
|
||||
}
|
||||
.overview-status dt {
|
||||
color: var(--muted);
|
||||
}
|
||||
.overview-status dd {
|
||||
margin: 0;
|
||||
color: var(--text);
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<section class="panel">
|
||||
<h1>LinuxCNC INI Workflow Overview</h1>
|
||||
<p>Read-only shell handoff overview for mount, readonly status, and overall workflow readiness.</p>
|
||||
<section class="overview-status" aria-label="Shell handoff workflow overview" data-handoff-workflow>
|
||||
<p data-handoff-workflow-status>Checking shell handoff workflow summary.</p>
|
||||
<dl data-handoff-workflow-rows></dl>
|
||||
</section>
|
||||
</section>
|
||||
</main>
|
||||
<script type="module">
|
||||
import {
|
||||
createIniPanelShellViewModel,
|
||||
createIniPanelShellSessionHandoffWorkflowDomContract,
|
||||
createIniPanelShellSessionHandoffWorkflowDomReadiness,
|
||||
createIniPanelShellSessionHandoffWorkflowRenderState,
|
||||
renderIniPanelShellSessionHandoffWorkflowState,
|
||||
mountIniPanelShellSessionHandoffWorkflow,
|
||||
} from "./ui-shell.js";
|
||||
|
||||
const shellViewModel = createIniPanelShellViewModel();
|
||||
const workflowRenderState = shellViewModel.shellSessionHandoffWorkflowRenderState;
|
||||
renderIniPanelShellSessionHandoffWorkflowState(workflowRenderState, { documentRef: document });
|
||||
|
||||
window.linuxCncIniPanelWorkflowOverviewApi = {
|
||||
getWorkflowOverviewRenderState: () => shellViewModel.shellSessionHandoffWorkflowRenderState,
|
||||
getWorkflowOverviewDisplayViewModel: () => shellViewModel.shellSessionHandoffWorkflowDisplayViewModel,
|
||||
getWorkflowOverviewSummary: () => shellViewModel.shellSessionHandoffWorkflowSummary,
|
||||
getWorkflowOverviewDomContract: (options) => (
|
||||
createIniPanelShellSessionHandoffWorkflowDomContract(options)
|
||||
),
|
||||
getWorkflowOverviewDomReadiness: (options) => (
|
||||
createIniPanelShellSessionHandoffWorkflowDomReadiness(options ?? { documentRef: document })
|
||||
),
|
||||
renderWorkflowOverview: (renderState, options) => (
|
||||
renderIniPanelShellSessionHandoffWorkflowState(
|
||||
renderState ?? shellViewModel.shellSessionHandoffWorkflowRenderState,
|
||||
options ?? { documentRef: document },
|
||||
)
|
||||
),
|
||||
mountWorkflowOverview: (options) => (
|
||||
mountIniPanelShellSessionHandoffWorkflow(options ?? {
|
||||
renderState: shellViewModel.shellSessionHandoffWorkflowRenderState,
|
||||
documentRef: document,
|
||||
})
|
||||
),
|
||||
createWorkflowOverviewRenderState: createIniPanelShellSessionHandoffWorkflowRenderState,
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -36,9 +36,9 @@
|
||||
|
||||
try {
|
||||
const visibleEntries = getVisibleIniPanelEntries();
|
||||
assertEqual(visibleEntries.length, 2, "launch visible entry length");
|
||||
assertEqual(visibleEntries.length, 3, "launch visible entry length");
|
||||
const launcherLinks = createIniPanelLauncherLinkViewModel();
|
||||
assertEqual(launcherLinks.length, 2, "launcher link model length");
|
||||
assertEqual(launcherLinks.length, 3, "launcher link model length");
|
||||
assertEqual(launcherLinks[0].entryId, "edit-run", "launcher link entry id");
|
||||
assertEqual(launcherLinks[0].label, "Open edit and run panel", "launcher link label");
|
||||
assertEqual(launcherLinks[0].href, "./index.html", "launcher link href");
|
||||
@@ -48,6 +48,11 @@
|
||||
"Open read-only control view",
|
||||
"launch manifest control entry",
|
||||
);
|
||||
assertEqual(
|
||||
getIniPanelEntryByHref("./workflow-overview.html").title,
|
||||
"Open shell handoff overview",
|
||||
"launch manifest workflow entry",
|
||||
);
|
||||
assertEqual(
|
||||
createIniPanelShellViewModel().controlPage.browserApiMethods.join(","),
|
||||
createControlPageBrowserApiMethods().join(","),
|
||||
@@ -131,7 +136,7 @@
|
||||
);
|
||||
assertEqual(
|
||||
launchApiManifest.methods.join(","),
|
||||
"isSupportedLaunchApiManifest,getLaunchApiSchema,getLaunchApiManifest,getShellIntegrationSchema,getShellIntegrationManifest,getShellIntegrationReadiness,getShellSessionHandoffSummarySchema,getShellSessionHandoffSummary,isSupportedShellSessionHandoffSummary,getShellSessionHandoffCompatibilityReport,getShellSessionHandoffDisplayViewModel,getShellSessionHandoffSnapshot,getShellSessionHandoffRenderState,getShellSessionHandoffActionPlan,getShellSessionHandoffChecklist,getShellSessionHandoffPackageSchema,getShellSessionHandoffPackage,getShellSessionHandoffPackageReport,getShellSessionHandoffPackageDisplayViewModel,getShellSessionHandoffPackageRenderState,getShellSessionHandoffPackageMountState,getShellSessionHandoffPackageMountDisplayViewModel,getShellSessionHandoffPackageMountRenderState,renderShellSessionHandoffMountState,isSupportedShellSessionHandoffPackage,getLauncherLinks,getControlPageApiMethods",
|
||||
createIniPanelLaunchApiManifest().methods.join(","),
|
||||
"launch API manifest methods",
|
||||
);
|
||||
const shellIntegrationSchema = launchApi.getShellIntegrationSchema();
|
||||
@@ -540,7 +545,7 @@
|
||||
);
|
||||
assertEqual(
|
||||
launchApiManifest.visibleEntries.length,
|
||||
2,
|
||||
3,
|
||||
"launch API manifest visible entry count",
|
||||
);
|
||||
assertEqual(
|
||||
@@ -548,6 +553,11 @@
|
||||
"./control-page.html",
|
||||
"launch API manifest control target",
|
||||
);
|
||||
assertEqual(
|
||||
launchApiManifest.targetPages[2].href,
|
||||
"./workflow-overview.html",
|
||||
"launch API manifest workflow target",
|
||||
);
|
||||
assertEqual(
|
||||
launchApiManifest.persistenceCapabilities.length,
|
||||
3,
|
||||
@@ -573,9 +583,14 @@
|
||||
"Open read-only control view",
|
||||
"launch panel control link",
|
||||
);
|
||||
assertEqual(
|
||||
launchDoc.querySelector('a[href="./workflow-overview.html"]').textContent,
|
||||
"Open shell handoff overview",
|
||||
"launch panel workflow link",
|
||||
);
|
||||
assertEqual(
|
||||
launchApi.getLauncherLinks().length,
|
||||
2,
|
||||
3,
|
||||
"launch API launcher link count",
|
||||
);
|
||||
assertEqual(
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>LinuxCNC INI Workflow Overview Smoke</title>
|
||||
</head>
|
||||
<body>
|
||||
<pre id="status">running</pre>
|
||||
<script type="module">
|
||||
function assertEqual(actual, expected, label) {
|
||||
if (actual !== expected) {
|
||||
throw new Error(`${label}: expected ${expected}, got ${actual}`);
|
||||
}
|
||||
}
|
||||
|
||||
async function loadWorkflowOverviewFrame() {
|
||||
const frame = document.createElement("iframe");
|
||||
frame.src = "../../runtime/ui/ini-panel/workflow-overview.html";
|
||||
document.body.appendChild(frame);
|
||||
await new Promise((resolve, reject) => {
|
||||
frame.addEventListener("load", resolve, { once: true });
|
||||
frame.addEventListener("error", reject, { once: true });
|
||||
});
|
||||
return frame.contentDocument;
|
||||
}
|
||||
|
||||
try {
|
||||
const workflowDoc = await loadWorkflowOverviewFrame();
|
||||
const workflowApi = workflowDoc.defaultView.linuxCncIniPanelWorkflowOverviewApi;
|
||||
if (
|
||||
!workflowApi?.getWorkflowOverviewRenderState ||
|
||||
!workflowApi?.getWorkflowOverviewDisplayViewModel ||
|
||||
!workflowApi?.getWorkflowOverviewSummary ||
|
||||
!workflowApi?.getWorkflowOverviewDomContract ||
|
||||
!workflowApi?.getWorkflowOverviewDomReadiness ||
|
||||
!workflowApi?.renderWorkflowOverview ||
|
||||
!workflowApi?.mountWorkflowOverview ||
|
||||
!workflowApi?.createWorkflowOverviewRenderState
|
||||
) {
|
||||
throw new Error("workflow overview API namespace did not expose overview helpers");
|
||||
}
|
||||
|
||||
const renderState = workflowApi.getWorkflowOverviewRenderState();
|
||||
const displayViewModel = workflowApi.getWorkflowOverviewDisplayViewModel();
|
||||
const summary = workflowApi.getWorkflowOverviewSummary();
|
||||
const domContract = workflowApi.getWorkflowOverviewDomContract();
|
||||
const domReadiness = workflowApi.getWorkflowOverviewDomReadiness();
|
||||
const renderResult = workflowApi.renderWorkflowOverview();
|
||||
const mountResult = workflowApi.mountWorkflowOverview();
|
||||
|
||||
assertEqual(summary.summaryVersion, 1, "workflow overview summary version");
|
||||
assertEqual(displayViewModel.title, "Shell handoff workflow", "workflow overview display title");
|
||||
assertEqual(renderState.renderStateVersion, 1, "workflow overview render-state version");
|
||||
assertEqual(renderState.dataset.handoffScope, "workflow", "workflow overview render-state scope");
|
||||
assertEqual(domContract.selectors.mount, "[data-handoff-workflow]", "workflow overview DOM contract mount selector");
|
||||
assertEqual(domReadiness.ready, true, "workflow overview DOM readiness");
|
||||
assertEqual(renderResult.rendered, true, "workflow overview render result");
|
||||
assertEqual(renderResult.rowCount, 5, "workflow overview render row count");
|
||||
assertEqual(mountResult.ready, false, "workflow overview mount result readiness");
|
||||
assertEqual(mountResult.renderResult.rendered, true, "workflow overview mount result rendered");
|
||||
assertEqual(
|
||||
workflowDoc.querySelector("[data-handoff-workflow]").dataset.handoffScope,
|
||||
"workflow",
|
||||
"workflow overview DOM scope",
|
||||
);
|
||||
assertEqual(
|
||||
workflowDoc.querySelector("[data-handoff-workflow-status]").textContent,
|
||||
renderState.statusLine,
|
||||
"workflow overview DOM status line",
|
||||
);
|
||||
assertEqual(
|
||||
workflowDoc.querySelector('[data-handoff-workflow-value="blocking-reasons"]').textContent.includes("readonly-status"),
|
||||
true,
|
||||
"workflow overview DOM blocking reasons row",
|
||||
);
|
||||
|
||||
document.getElementById("status").textContent = "browser_ini_workflow_overview_smoke=ok";
|
||||
console.log("browser_ini_workflow_overview_smoke=ok");
|
||||
} catch (error) {
|
||||
document.getElementById("status").textContent = `browser_ini_workflow_overview_smoke=failed: ${error.message}`;
|
||||
console.error(error);
|
||||
throw error;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -63,10 +63,12 @@ PORT="$(cat "$PORT_FILE")"
|
||||
URL="http://127.0.0.1:$PORT/tests/browser/ini_panel_smoke.html"
|
||||
CONTROL_URL="http://127.0.0.1:$PORT/tests/browser/ini_panel_control_page_smoke.html"
|
||||
LAUNCH_URL="http://127.0.0.1:$PORT/tests/browser/ini_panel_launch_smoke.html"
|
||||
WORKFLOW_OVERVIEW_URL="http://127.0.0.1:$PORT/tests/browser/ini_panel_workflow_overview_smoke.html"
|
||||
SHELL_INTEGRATION_URL="http://127.0.0.1:$PORT/tests/browser/ini_panel_shell_integration_workflow_smoke.html"
|
||||
OUT="$TMP_DIR/chromium.out"
|
||||
CONTROL_OUT="$TMP_DIR/chromium-control.out"
|
||||
LAUNCH_OUT="$TMP_DIR/chromium-launch.out"
|
||||
WORKFLOW_OVERVIEW_OUT="$TMP_DIR/chromium-workflow-overview.out"
|
||||
SHELL_INTEGRATION_OUT="$TMP_DIR/chromium-shell-integration.out"
|
||||
|
||||
"$CHROMIUM" \
|
||||
@@ -120,6 +122,23 @@ fi
|
||||
|
||||
echo "browser_ini_launch_smoke=ok"
|
||||
|
||||
"$CHROMIUM" \
|
||||
--headless=new \
|
||||
--disable-gpu \
|
||||
--no-sandbox \
|
||||
--user-data-dir="$CHROME_PROFILE" \
|
||||
--virtual-time-budget=10000 \
|
||||
--dump-dom \
|
||||
"$WORKFLOW_OVERVIEW_URL" >"$WORKFLOW_OVERVIEW_OUT" 2>&1
|
||||
|
||||
if ! grep -Fq "browser_ini_workflow_overview_smoke=ok" "$WORKFLOW_OVERVIEW_OUT"; then
|
||||
echo "browser INI workflow overview smoke failed" >&2
|
||||
sed -n '1,220p' "$WORKFLOW_OVERVIEW_OUT" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "browser_ini_workflow_overview_smoke=ok"
|
||||
|
||||
"$CHROMIUM" \
|
||||
--headless=new \
|
||||
--disable-gpu \
|
||||
|
||||
@@ -168,6 +168,7 @@ const requiredPages = [
|
||||
["Launch", "runtime/ui/ini-panel/launch.html"],
|
||||
["Edit and run", "runtime/ui/ini-panel/index.html"],
|
||||
["Read-only control view", "runtime/ui/ini-panel/control-page.html"],
|
||||
["Workflow overview", "runtime/ui/ini-panel/workflow-overview.html"],
|
||||
];
|
||||
|
||||
for (const [label, path] of requiredPages) {
|
||||
|
||||
@@ -17,6 +17,11 @@ assert.deepEqual(INI_PANEL_ENTRIES, [
|
||||
title: "Open read-only control view",
|
||||
href: "./control-page.html",
|
||||
},
|
||||
{
|
||||
id: "workflow-overview",
|
||||
title: "Open shell handoff overview",
|
||||
href: "./workflow-overview.html",
|
||||
},
|
||||
]);
|
||||
|
||||
const manifest = getIniPanelEntryManifest();
|
||||
@@ -26,6 +31,7 @@ assert.notStrictEqual(manifest[0], INI_PANEL_ENTRIES[0]);
|
||||
|
||||
assert.deepEqual(getIniPanelEntryByHref("./index.html"), INI_PANEL_ENTRIES[0]);
|
||||
assert.deepEqual(getIniPanelEntryByHref("./control-page.html"), INI_PANEL_ENTRIES[1]);
|
||||
assert.deepEqual(getIniPanelEntryByHref("./workflow-overview.html"), INI_PANEL_ENTRIES[2]);
|
||||
assert.equal(getIniPanelEntryByHref("./missing.html"), null);
|
||||
|
||||
manifest[0].title = "changed";
|
||||
|
||||
@@ -91,6 +91,11 @@ assert.deepEqual(manifest, {
|
||||
href: "./control-page.html",
|
||||
title: "Open read-only control view",
|
||||
},
|
||||
{
|
||||
id: "workflow-overview",
|
||||
href: "./workflow-overview.html",
|
||||
title: "Open shell handoff overview",
|
||||
},
|
||||
],
|
||||
targetPages: [
|
||||
{
|
||||
@@ -101,6 +106,10 @@ assert.deepEqual(manifest, {
|
||||
entryId: "control-view",
|
||||
href: "./control-page.html",
|
||||
},
|
||||
{
|
||||
entryId: "workflow-overview",
|
||||
href: "./workflow-overview.html",
|
||||
},
|
||||
],
|
||||
controlPageApiMethods: createControlPageBrowserApiMethods(),
|
||||
persistenceCapabilities: [
|
||||
|
||||
@@ -159,8 +159,8 @@ assert.deepEqual(readiness, {
|
||||
},
|
||||
missing: [],
|
||||
counts: {
|
||||
pages: 2,
|
||||
launcherLinks: 2,
|
||||
pages: 3,
|
||||
launcherLinks: 3,
|
||||
launchMethods: 39,
|
||||
controlPageMethods: 11,
|
||||
persistenceCapabilities: 3,
|
||||
@@ -221,8 +221,8 @@ assert.deepEqual(handoffSummary, {
|
||||
phase: "ready",
|
||||
missing: [],
|
||||
counts: {
|
||||
pages: 2,
|
||||
launcherLinks: 2,
|
||||
pages: 3,
|
||||
launcherLinks: 3,
|
||||
launchMethods: 39,
|
||||
controlPageMethods: 11,
|
||||
persistenceCapabilities: 3,
|
||||
@@ -1156,8 +1156,8 @@ assert.deepEqual(createIniPanelShellIntegrationReadiness(blockedManifest), {
|
||||
},
|
||||
missing: ["launchCompatibility"],
|
||||
counts: {
|
||||
pages: 2,
|
||||
launcherLinks: 2,
|
||||
pages: 3,
|
||||
launcherLinks: 3,
|
||||
launchMethods: 39,
|
||||
controlPageMethods: 11,
|
||||
persistenceCapabilities: 3,
|
||||
|
||||
@@ -153,6 +153,11 @@ assert.deepEqual(createIniPanelLauncherLinkViewModel(), [
|
||||
href: "./control-page.html",
|
||||
label: "Open read-only control view",
|
||||
},
|
||||
{
|
||||
entryId: "workflow-overview",
|
||||
href: "./workflow-overview.html",
|
||||
label: "Open shell handoff overview",
|
||||
},
|
||||
]);
|
||||
const launcherLinks = createIniPanelLauncherLinkViewModel();
|
||||
launcherLinks[0].label = "changed";
|
||||
@@ -169,6 +174,11 @@ assert.deepEqual(shellViewModel.pages, [
|
||||
href: "./control-page.html",
|
||||
title: "Open read-only control view",
|
||||
},
|
||||
{
|
||||
id: "workflow-overview",
|
||||
href: "./workflow-overview.html",
|
||||
title: "Open shell handoff overview",
|
||||
},
|
||||
]);
|
||||
assert.deepEqual(shellViewModel.launcherLinks, createIniPanelLauncherLinkViewModel());
|
||||
assert.deepEqual(shellViewModel.shellIntegrationSchema, createIniPanelShellIntegrationSchema());
|
||||
|
||||
Reference in New Issue
Block a user