推进 INI 面板 entry doc

This commit is contained in:
2026-06-14 23:36:03 +08:00
parent 76e688d126
commit ef4769b4b4
6 changed files with 135 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
# INI Panel Entry
This page is the short entry map for the INI panel UI shell.
## Shell Module
Use the shell-facing module when an outer UI needs entry links or a read-only
control view:
```js
import {
getIniPanelEntryManifest,
createMachineSessionControlPageController,
renderMachineSessionControlView,
} from "../runtime/ui/ini-panel/ui-shell.js";
```
`ui-shell.js` re-exports the entry manifest, the read-only control-page
controller, and the control-view renderer. It does not implement CNC behavior.
## Pages
| Page | Path | Role |
| --- | --- | --- |
| 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. |
## Entry Manifest
The visible launch entries come from `getIniPanelEntryManifest()`:
| Entry id | Href | Title |
| --- | --- | --- |
| `edit-run` | `./index.html` | Open edit and run panel |
| `control-view` | `./control-page.html` | Open read-only control view |
## Boundary
The entry shell only links pages and renders already-observed panel state. It
does not parse G-code, infer canonical events, or implement LinuxCNC-owned
tool, parameter, planner, or kinematics behavior.

View File

@@ -36,6 +36,7 @@ For a light navigation entry, open `runtime/ui/ini-panel/launch.html`.
Its entry list is defined in `runtime/ui/ini-panel/entry-manifest.js`.
For a single shell-facing import, use `runtime/ui/ini-panel/ui-shell.js`, which
re-exports the entry manifest, control page controller, and control view renderer.
For the short page/entry map, see `docs/panel-entry.md`.
## `createIniPanelStateSummary(input)`

View File

@@ -0,0 +1,24 @@
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import { fileURLToPath } from "node:url";
import { dirname, resolve } from "node:path";
import {
getIniPanelEntryManifest,
} from "../../../runtime/ui/ini-panel/ui-shell.js";
const __dirname = dirname(fileURLToPath(import.meta.url));
const root = resolve(__dirname, "../../..");
const docText = readFileSync(resolve(root, "docs/panel-entry.md"), "utf8");
assert.match(docText, /runtime\/ui\/ini-panel\/ui-shell\.js/);
assert.match(docText, /createMachineSessionControlPageController/);
assert.match(docText, /renderMachineSessionControlView/);
assert.match(docText, /runtime\/ui\/ini-panel\/launch\.html/);
assert.match(docText, /runtime\/ui\/ini-panel\/control-page\.html/);
for (const entry of getIniPanelEntryManifest()) {
assert.match(docText, new RegExp(`\\| \`${entry.id}\` \\| \`${entry.href.replace(".", "\\.")}\` \\| ${entry.title} \\|`));
}
console.log("ini_panel_entry_docs_node_smoke=ok");

View File

@@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "$0")/../../.." && pwd)"
node "$ROOT_DIR/tests/ui/node/verify_ini_panel_entry_docs.mjs"

View File

@@ -12,5 +12,6 @@ ROOT_DIR="$(cd "$(dirname "$0")/../../.." && pwd)"
"$ROOT_DIR/tests/ui/node/verify_ini_panel_control_page_controller.sh"
"$ROOT_DIR/tests/ui/node/verify_ini_panel_entry_manifest.sh"
"$ROOT_DIR/tests/ui/node/verify_ini_panel_ui_shell.sh"
"$ROOT_DIR/tests/ui/node/verify_ini_panel_entry_docs.sh"
echo "ui_node_smokes=ok"