推进 INI 面板 launch entry

This commit is contained in:
2026-06-14 23:12:22 +08:00
parent 59ffacb64e
commit c18aa21d70
5 changed files with 203 additions and 0 deletions

View File

@@ -1268,3 +1268,62 @@ host_wasm_opfs_browser_smokes=ok
`runtime/ui/ini-panel/launch.html`,把编辑/运行面板 `index.html` 与只读控制页
`control-page.html` 作为并列入口暴露,并用 browser smoke 验证两个入口链接可达;仍不新增
控制按钮,不解析 G-code。
十五、2026-06-14 继续执行记录INI panel launch entry
本轮按“加快实质性推进”新增只读 launcher 入口页,把编辑/运行面板和只读控制页作为并列
入口统一暴露,并把 launcher 可达性接入 browser smoke。
完成内容:
- 新增 `wasm-port/runtime/ui/ini-panel/launch.html`
- launcher 提供两个并列入口:
- `./index.html` 编辑/运行面板;
- `./control-page.html` 只读控制视图;
- 新增 `wasm-port/tests/browser/ini_panel_launch_smoke.html`
- `wasm-port/tests/browser/verify_ini_panel_browser.sh` 现在同时验证:
- `browser_ini_opfs_smoke=ok`
- `browser_ini_control_page_smoke=ok`
- `browser_ini_launch_smoke=ok`
- `wasm-port/docs/ui-panel-state-summary.md` 补充 launcher 入口说明;
- 未新增控制按钮;
- 未解析 G-code
- 未解释 canonical events
- 未改变 OPFS/session persistence、LinuxCNC interpreter、tool、parameter、planner 或
LinuxCNC-owned runtime semantics。
验证已通过:
```bash
git diff --check
wasm-port/tests/browser/verify_ini_panel_browser.sh
wasm-port/tests/ui/node/verify_ui_node_smokes.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
browser_ini_opfs_smoke=ok
browser_ini_control_page_smoke=ok
browser_ini_launch_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
```
下一步建议:
继续保持实质 UI workflow 优先。下一批建议把 launcher 中的入口清单抽成一个小的
`entry-manifest.js`,供 launcher、docs 或未来外层 shell 共用,并用 node/browser smoke 验证
入口 href 与标题一致;仍保持只读,不新增控制按钮,不解析 G-code。

View File

@@ -32,6 +32,7 @@ and mirrors the same control view into the visible page.
The page uses `createMachineSessionControlPageController(...)` from
`runtime/ui/ini-panel/control-page-controller.js` so other read-only shells can
reuse the same iframe/API polling contract.
For a light navigation entry, open `runtime/ui/ini-panel/launch.html`.
## `createIniPanelStateSummary(input)`

View File

@@ -0,0 +1,76 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>LinuxCNC INI Panel Launch</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;
}
.links {
display: grid;
gap: 8px;
}
a {
color: var(--accent);
text-decoration: none;
font: 14px/1.4 "Segoe UI", "Noto Sans", sans-serif;
}
a:hover {
text-decoration: underline;
}
p {
margin: 0;
color: var(--muted);
font: 13px/1.5 "Segoe UI", "Noto Sans", sans-serif;
}
</style>
</head>
<body>
<main>
<section class="panel">
<h1>LinuxCNC INI Panel</h1>
<p>Choose the editable panel or the read-only control view.</p>
<div class="links">
<a href="./index.html">Open edit and run panel</a>
<a href="./control-page.html">Open read-only control view</a>
</div>
</section>
</main>
</body>
</html>

View File

@@ -0,0 +1,48 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>LinuxCNC INI Launch 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 loadLaunchFrame() {
const frame = document.createElement("iframe");
frame.src = "../../runtime/ui/ini-panel/launch.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 launchDoc = await loadLaunchFrame();
assertEqual(
launchDoc.querySelector('a[href="./index.html"]').textContent,
"Open edit and run panel",
"launch panel edit link",
);
assertEqual(
launchDoc.querySelector('a[href="./control-page.html"]').textContent,
"Open read-only control view",
"launch panel control link",
);
status.textContent = "browser_ini_launch_smoke=ok";
console.log("browser_ini_launch_smoke=ok");
} catch (error) {
status.textContent = `browser_ini_launch_smoke=failed: ${error.message}`;
console.error(error);
throw error;
}
</script>
</body>
</html>

View File

@@ -62,8 +62,10 @@ fi
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"
OUT="$TMP_DIR/chromium.out"
CONTROL_OUT="$TMP_DIR/chromium-control.out"
LAUNCH_OUT="$TMP_DIR/chromium-launch.out"
"$CHROMIUM" \
--headless=new \
@@ -98,3 +100,20 @@ if ! grep -Fq "browser_ini_control_page_smoke=ok" "$CONTROL_OUT"; then
fi
echo "browser_ini_control_page_smoke=ok"
"$CHROMIUM" \
--headless=new \
--disable-gpu \
--no-sandbox \
--user-data-dir="$CHROME_PROFILE" \
--virtual-time-budget=10000 \
--dump-dom \
"$LAUNCH_URL" >"$LAUNCH_OUT" 2>&1
if ! grep -Fq "browser_ini_launch_smoke=ok" "$LAUNCH_OUT"; then
echo "browser INI launch smoke failed" >&2
sed -n '1,220p' "$LAUNCH_OUT" >&2
exit 1
fi
echo "browser_ini_launch_smoke=ok"