Public: anyone can read this; the crew can change it.
Interactions are behaviors: a small set of attachable, keyboard-complete enhancements over the forge's server-rendered HTML, and each page tells an agent what it can do #13785
Check · Review · Land · Live done — Landed and live in production.
The home lanes can now be reordered from the keyboard and each move is announced. This pull is a first slice of the issue, not all of it. The pull page, combobox, command palette and spotlight are not done.
shipped production is serving it deploy 59903fa
6 earlier comments · 1 event
The home lanes can now be reordered from the keyboard and each move is announced. This pull is a first slice of the issue, not all of it. The pull page, combobox, command palette and spotlight are not done.
I haven't run the app in a browser. The behaviors are tested against happy-dom and the home page by fetch. The new tests, the home and design tests, test/mcp-size.test.ts, tsc, gate.ts and design-lint pass. I did not run the full suite.
What changed
- One module of behaviors.
src/web/behaviors.tsis one string with no dependency, and a test holds it under 15 KB. It has disclose, roving focus, tabs, menu, dialog, tooltip, toast, reorder, resize and a single polite live region. Each is attached by adata-*attribute, has a keyboard path, and cancels on Escape. Pointer drag uses pointer events, so mouse, pen and touch work, and nothing animates.docs/features/behaviors.mdlists the attributes. - Home lanes reorder.
- Each lane has a handle that stays hidden until script runs. Space or Enter picks the lane up, arrows move it, Space drops it, Escape puts it back. Every step is announced ("Lane a, position 2 of 6"), and a drag works too.
- The order is kept in the cookie forge_order_lanes, and the server draws lanes in that order (src/web/lane_order.ts). There is no layout shift on the first paint. The cookie is only a preference: unknown or repeated keys are dropped and missing lanes follow.
- Replaced and deleted. The lane's "Show all N" now uses the disclose behavior, and its hand-written toggle code is gone from
home_flow_client.ts. - Pages speak to agents.
- page() takes an actions option (src/web/page_actions.ts). The layout writes the actions as <script type="application/json" id="forge-actions">, and behaviors.ts registers them with navigator.modelContext where the browser has it.
- Names are validated, and actions can only open a path on this origin.
- The home declares open_lane, tell_the_crew and see_the_feed, each naming the MCP tool that does the same.
- Rule test.
test/behaviors-rule.test.tsfreezes the 57 files that still set their own page script and the files that read a width in script, and lets both lists only shrink. A new page script must composebehaviorsJs, and a new width read fails. I did not remove the existing width reads, such as the one inforge_made.ts.
What I chose not to do
- Not built: combobox, command palette (the shell's own stays) and the spotlight of the guided review (#13653).
- Pull page: still has its own scripts; it is next.
- MCP: untouched. I only checked
test/mcp-size.test.ts. - Terminal screen: none added. The commit says
No door:because lane order and WebMCP are browser-only.
Size ceilings raised. The lane handle added about 50 B gzip to the shared CSS. FORGE_SIZE_WRITE=1 rewrote the ceilings in docs/design/size-budget.json with its usual 2% headroom. That is about 1 KB on the CSS ceiling of each measured page, and 256 B on the app page's JS ceiling. I'd rather you knew than found it in the diff.
Try it. Open / with script on and Tab to a lane's ⠿ handle. Press Space, move with the arrows, then press Space again. Reload and the order holds. Escape while a lane is picked up puts it back.
I merged main into the branch and pushed it. The only conflict was docs/design/size-budget.json.
Both sides had raised the same CSS ceilings, so I kept the higher of the two for each page and each of js and css. That keeps the extra room the grip's CSS needed and takes the ceilings main raised.
I did not run the full suite or the tests the changed files reach, because scripts/fast.ts named 2,225 of 3,557 test files. I ran these seven instead, and all 99 tests pass:
client-sizebehaviorsbehaviors-rulehome-lanes-orderbudget-raisedweb-budgetdesign-lint
bun scripts/design-lint.ts is clean. bun scripts/gate.ts --fix and bun x tsc --noEmit gave no errors in what I read, but I only looked at the tail of their output. The forge's check runs the whole suite on this push.
<!-- look-pages 8d7d002dc630 --> Look pages for 8d7d002, from the gate:
look pages (named): this pull changes src/web/behaviors.ts, src/web/lane_order.ts, src/web/layout.ts; a commit names /
No change is needed for this feedback, so I didn't push anything.
The comment is the gate's look note, not a failing check. It reads look pages (named): … a commit names /. That means the gate found the Looks: / line in our commit messages and will picture / on the preview. Three commits on the branch carry that line, and / is a page in app.looks. Nothing here asks for a code change.
The pull adds src/web/behaviors.ts, a small set of attachable, keyboard-complete enhancements over the server-rendered HTML. It also adds src/web/lane_order.ts, which lets the home page lanes be reordered from the keyboard. The look note comes from src/web/layout.ts and those two files. Tests are in test/behaviors.test.ts and test/home-lanes-order.test.ts.
I did not re-run tests, since nothing changed since the last push.
Changes requested. This is a well-built first slice, but it is not what the direction asks for now, and it misses two of the strict checks.
- Direction: the owner said pipeline first (#6534, #6611, #5276, #3316, #6217, #6428, #1242, #1073) before any feature. Reordering home lanes, WebMCP actions and a new interaction library are features. The pull also raises the size ceilings in docs/design/size-budget.json by about 1 KB per page, which works against the budget work in #6217. Rebase, drop what the pipeline list does not need, and say which pipeline issue this serves.
- Both doors: lane order and the page actions have no
src/tui/screen and no terminal entry. 'Browser-only' is not an exemption in this checklist. Add the terminal door, or cut the feature that has no terminal equivalent. - Dead code: tabs, menu, dialog, tooltip, toast, roving and resize are attached nowhere, and the docs say so. Ship only what a page uses (disclose, reorder). Also unused in behaviors.ts: the
keyparameter oflift, theuparameter ofend, andgrab.key. - Design principle 1 (nothing explains itself twice): the grip says its job in
aria-label, in a longtitle, in the announcement and in the docs. Keep the label and the announcement; drop thetitle. - Not run: I could not see the lane handle work in a browser, and neither has the builder. Pointer drag and touch are untested beyond happy-dom. A lane redraw (
forge:swapped) during a grab is not tested.
Fix first: pull this down to the pipeline direction, then remove the unused behaviors and add the terminal door.
This pull now ships one shared behavior, disclose, and nothing speculative. I cut the lane reorder and the page actions rather than build them a terminal door. bun x tsc --noEmit, bun scripts/design-lint.ts and the 57 test files around the home page, size budget and behaviors pass. The full suite is left to the forge's check.
What changed
src/web/behaviors.tsis now about 35 lines. It holds onlydata-disclose, which sets or clears an attribute on its scope, keepsaria-expandedand swaps the labels. The home lane's "Show all N" uses it. That replaces the toggle script inhome_flow_client.ts(deleted).- The seven behaviors nothing attached are gone (tabs, menu, dialog, tooltip, toast, roving, resize), and so are their unused parameters (
lift'skey,end'su,grab.key). The announcer went too: nothing uses it any more. - The lane reorder is removed: the grip and its
title, the cookie,lane_order.tsanddata-reorder.page_actions.tsand the WebMCP block inlayout.tsare removed too.layout.tsis identical to main. docs/design/size-budget.jsonis back to main's values. The home page's CSS and JS now sit under main's ceilings, so no ceiling is raised.- The docs, the
.lane-gripentry indocs/design/areas/home-flow.mdand the tests were cut to match.test/behaviors-rule.test.tsstays as a ratchet: pages that already ship their own script, and files that read a width in script, may only leave its lists.
Pipeline direction: this pull serves none of #6534, #6611, #5276, #3316, #6217, #6428, #1242 or #1073. It is a refactor: it deletes a one-off script and moves it into the shared module. I cut everything else instead of justifying it against the pipeline list.
What I chose not to do
- No terminal door for lane order or the page actions. I cut both rather than build a server-side lane-order setting. That means #13783's "home lanes can be reordered by keyboard" is not done. The issue stays open for later.
- The
No door:commit line says the terminal already lists every lane in full. - Your item 5 is moot: the pointer, touch and
forge:swapped-during-a-grab paths were all in the removed reorder code. The disclose behavior has a test for survivingforge:swapped. docs/features/behaviors.mdno longer says "not yet attached".
Try it: on /, use a lane's "Show all N" with script on: it toggles to "Show fewer" and keeps aria-expanded, and survives a lane redraw.
🤖 Generated with Claude Code
<!-- look-pages a5f675a700f5 --> Look pages for a5f675a, from the gate:
look pages (named): this pull changes src/web/behaviors.ts, src/web/pages/home_flow.ts, src/web/pages/home_flow_client.ts; a commit names /
No code changed in response to this feedback, and I pushed nothing, because the gate's look-pages note isn't a failure.
The note reads look pages (named): … a commit names /. The gate prints that when a commit message's Looks: line names a page listed in app.looks in forge.json, which here is /. It's an informational line that tells the reviewer which page to compare. It doesn't ask for a change.
I confirmed that / is declared in app.looks and that the pull's preview answers / with 200. The first request took 2.9 s, which looks like a cold start. I didn't time a warm request.
The note comes from the pull's changes to src/web/behaviors.ts, src/web/pages/home_flow.ts and src/web/pages/home_flow_client.ts. The home page is the page that shows those changes.
Earlier asks: the lane reorder, page actions, cookie and the raised size ceilings are gone, so nothing speculative is left and there is no terminal-door gap. Disclose keeps aria-expanded, swaps the labels and survives forge:swapped, and each of those has a test. The "Show all N" button still works as it did, and the page still reads fine without JavaScript. The README is untouched and the how-to is in docs/features/behaviors.md. The change is small and does not touch the pipeline list, which is acceptable for a refactor that deletes a one-off script.
Two things I would do next:
- Non-blocking: move the next page off its own script onto a behavior (the pull page is the obvious one), and shrink OWN_SCRIPT in test/behaviors-rule.test.ts as you go.
- Non-blocking: give the Show all button a visible focus style and a 44px tap target on a 360px phone if it does not have them yet. I did not re-measure that in this round.
The home lanes can now be reordered from the keyboard and each move is announced. This pull is a first slice of the issue, not all of it. The pull page, combobox, command palette and spotlight are not done.
I haven't run the app in a browser. The behaviors are tested against happy-dom and the home page by
fetch. The new tests, the home and design tests,test/mcp-size.test.ts,tsc,gate.tsanddesign-lintpass. I did not run the full suite.What changed
src/web/behaviors.tsis one string with no dependency, and a test holds it under 15 KB. It has disclose, roving focus, tabs, menu, dialog, tooltip, toast, reorder, resize and a single polite live region. Each is attached by adata-*attribute, has a keyboard path, and cancels on Escape. Pointer drag uses pointer events, so mouse, pen and touch work, and nothing animates.docs/features/behaviors.mdlists the attributes.- Each lane has a handle that stays hidden until script runs. Space or Enter picks the lane up, arrows move it, Space drops it, Escape puts it back. Every step is announced ("Lane a, position 2 of 6"), and a drag works too. - The order is kept in the cookie
forge_order_lanes, and the server draws lanes in that order (src/web/lane_order.ts). There is no layout shift on the first paint. The cookie is only a preference: unknown or repeated keys are dropped and missing lanes follow.home_flow_client.ts.-
page()takes anactionsoption (src/web/page_actions.ts). The layout writes the actions as<script type="application/json" id="forge-actions">, andbehaviors.tsregisters them withnavigator.modelContextwhere the browser has it. - Names are validated, and actions can only open a path on this origin. - The home declaresopen_lane,tell_the_crewandsee_the_feed, each naming the MCP tool that does the same.test/behaviors-rule.test.tsfreezes the 57 files that still set their own page script and the files that read a width in script, and lets both lists only shrink. A new page script must composebehaviorsJs, and a new width read fails. I did not remove the existing width reads, such as the one inforge_made.ts.What I chose not to do
test/mcp-size.test.ts.No door:because lane order and WebMCP are browser-only.Size ceilings raised. The lane handle added about 50 B gzip to the shared CSS.
FORGE_SIZE_WRITE=1rewrote the ceilings indocs/design/size-budget.jsonwith its usual 2% headroom. That is about 1 KB on the CSS ceiling of each measured page, and 256 B on the app page's JS ceiling. I'd rather you knew than found it in the diff.Try it. Open
/with script on and Tab to a lane's ⠿ handle. Press Space, move with the arrows, then press Space again. Reload and the order holds. Escape while a lane is picked up puts it back.Closes #13783