ZMAX-GUI-CORE // ENGINEERING REPORT

// webui layout · action map · PTY-bridge protocol · widget inventory · test status

zmax-gui-core ships the embeddable webview GUI surface for zmax-gui: the MacVim-style menu/dialog/shortcut layer that drives the zmax CLI editor (a Helix fork) through its embedded PTY. It is webui-only — no Rust crate, no IPC of its own — so the standalone app and any embedding host serve identical assets.

webui layout

FileRole
webui/menu.jswindow.ZmaxMenumount(shell) builds the menu bar + ⌘-shortcuts + dialogs + drag-drop; settingsExtra(panel) adds the editor language picker + toggles to the host's settings panel.
webui/zmax.cssStyles for the menu surface (layout only; colours/fonts come from zgui-core tokens).
webui/menu.test.cjsHeadless node --test of the menu→PTY bridge (loads menu.js in a VM context; no DOM).

Action map → PTY

Every menu item, ⌘-shortcut and dialog action is bridged to the editor by writing bytes into the PTY. Esc is sent on its own and the rest follows after a short delay (longer than the editor's esc-disambiguation window), so the editor treats Esc as a discrete keypress rather than parsing ESC<byte> as Alt+<byte>.

// run an ex-command from any mode: Esc -> :cmd -> Enter
afterEsc(":w\r");        // Save
afterEsc(":q\r");        // Quit
ptyWrite("\x13");        // raw control byte for a keymap-bound action

zgui-core widget inventory

SurfaceWidget
Menu bar / context menuZGui.menubar + ZGui.contextMenu
Open / Save-As / HelpZGui.modal + ZGui.tree (file browser) / ZGui.modal.prompt
Drag-and-drop filesZGui.fileDrag.initDrop

Verification

node --test webui/menu.test.cjs exercises the menu→PTY bridge headlessly (142 tests). It is wired into zmax-gui's test:js / scripts/test.sh so the single source is tested in place.