feat(menu): Phase E - wire menu content via windowTypes manifest (legacy parity)#688
Merged
Merged
Conversation
…acy parity)
Final phase of the menu-port plan. Achieves functional parity with the
legacy Frontier GUI menu system in the headless REPL.
What ships:
- New "frontier" menubar with File / Edit / View menus, installed at
REPL boot via the Phase C bridge -> windowTypes framework -> new
ReplWindow.openWindow handler
- File menu: New, Open, Close, Save, Save As, Quit
- Edit menu: Find, Find Next, Replace, Replace and Find Next,
Insert Date/Time
- View menu: Huge, Medium, Tiny, Readable
- Adapters under system.menus.handlers.repl that bridge the kernel-fired
system.callbacks.openWindow("<path>") to the windowTypes framework
(strips @ prefix that address() rejects)
- File>Quit and REPL>Exit dispatch-target-identical (both call
repl.exit) - resolves task #21
Palette strip at boot: "Edit File View REPL" (alphabetical union of
the two installed bars, matching Phase A's enumeration contract).
Design decisions:
- Bar named "frontier" sorts before "repl" so File/Edit/View lead the
strip per legacy convention
- File>Quit wired directly to repl.exit (not commands.quit which walks
GUI windows that don't exist in headless)
- Edit Cut/Copy/Paste deferred - no terminal analog in classic Frontier
- Adapter scripts (not inline lambdas) because UserTalk does not support
taking the address of a script inside a bundle block
- Adapter strips leading @ from WINDOW_BRIDGE_REPL_PATH because address()
rejects strings with a leading @
Tests:
- 6 new behavioral integration tests in replwindow_openwindow_menus_phase_e.yaml
- All 9 Phase D regression tests continue to pass
- Unit: 492/492; Integration: +6 new tests, all green; pre-existing
html/tcp baseline unchanged
Virgin.root: regenerated + compacted (10.5 MB, +9.5 KB net for 3 new
scripts + 1 modified). Live-tested by JES before commit per task #15.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Three items from /gate round-1: bar-raiser P1-1: Tighten File>Quit script-payload assertion (test #6) Was `contains "repl.exit"` -- matches repl.exitNow, repl.exit2, etc. Now `contains "repl.exit ("` to lock down the exact dispatch contract. bar-raiser P1-2: Adapter parameter mutation -> local copy windowTypesOpenAdapter and windowTypesCloseAdapter were mutating the formal parameter `name` in place. UserTalk parameter-passing semantics for shared buffers are not formally guaranteed; defensive idiom is to copy to a local. Matches the convention used elsewhere in Frontier.tools.windowTypes.* security P1: closeWindow adapter discards framework veto Was unconditional `return (true)`. Framework's closeWindow returns false when a save-confirmation dialog is cancelled -- the kernel-level close chain interprets that as "abort the close". Phase E (REPL only) has no save dialog so it's moot today, but Phase F editor windows with unsaved-change prompts would silently close + lose user edits with the old code. One-line correctness fix: return (Frontier.tools.windowTypes.callbacks.closeWindow (adr)) Virgin.root regenerated to pick up the new adapter bodies, then re-compacted: 10.5 MB -> 13.4 MB (install churn) -> 11.0 MB (compact). Tests: 492/492 unit, 15/15 Phase D+E. P2 items deferred to issue #686 (Phase F hardening). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Owner
Author
/gate — PR #688 (Phase E — final)Round 1
Round 2 (after fix commit
|
| ID | Item | Status |
|---|---|---|
| bar-raiser P1-1 | Tighten test #6 repl.exit assertion |
FIXED (contains "repl.exit (") |
| bar-raiser P1-2 | Adapter mutates parameter in place | FIXED (local copy in both adapters) |
| security P1 | closeWindow adapter discards framework veto (Phase F data-loss risk) | FIXED (return Frontier.tools.windowTypes.callbacks.closeWindow(adr)) |
P2s deferred to issue #686 (Phase F hardening)
- View menu items have no failure path on click (silent thread.callScript drops)
- File>Quit silently skips guest-DB save flow (Phase F+ guest DBs)
- Trust contract for adapter input (Phase F editor windows)
- Slot name
windowTypesAdaptercollision risk - Doc drift in MENU_PORT_PLAN.md line-count claims (cosmetic)
Tests
- Unit: 492/492 (cached at 2c44794)
- Phase E behavioral: 6/6
- Phase D regression: 9/9
- Integration full suite: pre-existing html/tcp/startup-pollution baseline maintained
Virgin.root
- Pre-fix: 10.5 MB
- After adapter reinstall: 13.4 MB (install churn)
- After re-compact: 11.0 MB
Convergence: PASS — ready to merge
🤖 Generated with Claude Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Final phase of the menu-port plan. Achieves functional parity with the legacy Frontier GUI menu system in the headless REPL.
Predecessors merged: #678 (Phase A multi-bar enumeration), #680 (Phase B1 getsystemtablescript), #683 (Phase C bridge), #687 (Phase D primitives). This PR ships the actual menu content that makes the REPL look + behave like legacy.
What ships
frontiermenubar installed at REPL boot with File / Edit / View menussystem.menus.handlers.replthat bridge the Phase C kernel-firedsystem.callbacks.openWindow("path")to the windowTypes framework's address-expectingopenWindow(adr)handlerinstallReplMenubar.utextended to register the adapters inuser.callbacks.openWindow/closeWindow(the missing wire from Phase C)repl.exit); resolves task docs: capture headless daemon vision #21Palette strip at boot:
Edit File View REPL(alphabetical union of two installed bars per Phase A enumeration contract).Test plan
replwindow_openwindow_menus_phase_e.yamlall passsequential: truestate pollution can show transient failures in a fully-parallel suite run; reproduced clean on develop's baseline)Design decisions
frontier— sorts beforereplso File/Edit/View leads the strip per legacy conventioncommands.quitwhich walks GUI windows that don't exist in headless)@prefix from kernel-supplied path —WINDOW_BRIDGE_REPL_PATHcarries@butaddress()rejects strings with a leading@Issues filed during development (deferred)
thread.sleepforarity issue from non-Virgin Frontier.rootcstr_to_bigstringsilent truncation hardening🤖 Generated with Claude Code