Public: anyone can read this; the crew can change it.

Tab forge: the whole tab, the whole forge, and this machine put to work #18290

opened this in answer to

Merged 3h 49m ago, live in production

This pull makes the tab forge fill the tab once it is started and gives it three honest pages. It is a first step: the tab-forge pages are not yet the hosted forge's pages, and the runner switch is not built.

Notes

opened this

This pull makes the tab forge fill the tab once it is started and gives it three honest pages. It is a first step: the tab-forge pages are not yet the hosted forge's pages, and the runner switch is not built.

I ran no browser, so none of the full-tab look, reload behaviour, storage prompt or two-tab behaviour has been seen working. The tests, bun x tsc --noEmit, the gate and the design lint are green. The forge's own check on this push has not reported back yet.

What changed

  • Fills the tab. When the forge is running, /tab hides its own chrome and the forge's frame takes the width and the height. The shell is wider (56rem, was 36rem). Nothing has been checked at 390, 820 or 1440.
  • One quiet line. Every tab-forge page ends with where the data lives, whether the browser promised to keep it, and Export. /tab/f/storage has the longer version.
  • What works (/tab/f/pages). It lists every top-level page of the hosted forge as works, works differently, cannot work in a tab (with why and "use your hosted forge"), or not here yet. Cannot-work pages are not linked.
  • Held to the hosted list. test/tab-whole.test.ts fails if the hosted forge's page list gains a page this list does not name.
  • Runners (/tab/f/runners). It says what a tab can run (JavaScript and WebAssembly in a worker) and cannot (git, a shell, native programs, listening, surviving a closed tab). It has no switch, because a switch that did nothing would be a dead click. The real runner waits on #18257's tab spike.
  • It survives.
    • A reload or reopened tab starts the forge again and returns to the last page read.
    • Start asks the browser to keep the storage (persist()), and the footer says "promised" or "may clear it".
    • A second tab on the same forge says another tab holds the store and what to do.
  • Terminal. The palette entry says the same words (TAB_WHOLE). The docs are in docs/features/tab.md.

Chosen / left out

  • The page does not become the forge: the /tab page still holds the database and relays the service worker's requests. The frame covers it, so it only looks like one page.
  • Not built:
    • a topbar matching the hosted forge's
    • Search, Notes, Board, Archive and Waiting (marked "not here yet")
    • an export of the whole database file (the export is the app and its issues)
    • a hosted forge reading that file
    • the runner switch
    • the cold read by a no-context agent
  • I trimmed /tab's script strings to stay under its 4096-byte test budget. I did not raise the budget. The wording of a few status messages changed.
  • I reused test/support/tab-db.ts in the new test. The Looks line is "No look", because /tab is not among the pages in app.looks.

Try it Open /tab on the preview and press Start it. Then read What works, Runners and the footer line, reload, and open a second tab.

[
 {"go":"/tab","look":"press Start it: the forge takes the whole tab, no page around it","expect":"nav shows Home, Issues, Runners, What works; the footer says where the data is, with Export"},
 {"go":"/tab/f/pages","look":"every hosted page is listed with works / works differently / cannot (with why) / not here yet","expect":"only pages that work are links"},
 {"go":"/tab/f/runners","look":"what a tab can and cannot run","expect":"no switch, and a plain note that it waits on #18257"},
 {"go":"/tab","look":"reload","expect":"the forge starts again on the page you were on"}
]

🤖 Generated with Claude Code

Closes #18259

3 earlier comments
commented

This pull makes the tab forge fill the tab once it is started and gives it three honest pages. It is a first step: the tab-forge pages are not yet the hosted forge's pages, and the runner switch is not built.

I ran no browser, so none of the full-tab look, reload behaviour, storage prompt or two-tab behaviour has been seen working. The tests, bun x tsc --noEmit, the gate and the design lint are green. The forge's own check on this push has not reported back yet.

What changed

  • Fills the tab. When the forge is running, /tab hides its own chrome and the forge's frame takes the width and the height. The shell is wider (56rem, was 36rem). Nothing has been checked at 390, 820 or 1440.
  • One quiet line. Every tab-forge page ends with where the data lives, whether the browser promised to keep it, and Export. /tab/f/storage has the longer version.
  • What works (/tab/f/pages). It lists every top-level page of the hosted forge as works, works differently, cannot work in a tab (with why and "use your hosted forge"), or not here yet. Cannot-work pages are not linked.
  • Held to the hosted list. test/tab-whole.test.ts fails if the hosted forge's page list gains a page this list does not name.
  • Runners (/tab/f/runners). It says what a tab can run (JavaScript and WebAssembly in a worker) and cannot (git, a shell, native programs, listening, surviving a closed tab). It has no switch, because a switch that did nothing would be a dead click. The real runner waits on #18257's tab spike.
  • It survives.
    • A reload or reopened tab starts the forge again and returns to the last page read.
    • Start asks the browser to keep the storage (persist()), and the footer says "promised" or "may clear it".
    • A second tab on the same forge says another tab holds the store and what to do.
  • Terminal. The palette entry says the same words (TAB_WHOLE). The docs are in docs/features/tab.md.

Chosen / left out

  • The page does not become the forge: the /tab page still holds the database and relays the service worker's requests. The frame covers it, so it only looks like one page.
  • Not built:
    • a topbar matching the hosted forge's
    • Search, Notes, Board, Archive and Waiting (marked "not here yet")
    • an export of the whole database file (the export is the app and its issues)
    • a hosted forge reading that file
    • the runner switch
    • the cold read by a no-context agent
  • I trimmed /tab's script strings to stay under its 4096-byte test budget. I did not raise the budget. The wording of a few status messages changed.
  • I reused test/support/tab-db.ts in the new test. The Looks line is "No look", because /tab is not among the pages in app.looks.

Try it Open /tab on the preview and press Start it. Then read What works, Runners and the footer line, reload, and open a second tab.

[
 {"go":"/tab","look":"press Start it: the forge takes the whole tab, no page around it","expect":"nav shows Home, Issues, Runners, What works; the footer says where the data is, with Export"},
 {"go":"/tab/f/pages","look":"every hosted page is listed with works / works differently / cannot (with why) / not here yet","expect":"only pages that work are links"},
 {"go":"/tab/f/runners","look":"what a tab can and cannot run","expect":"no switch, and a plain note that it waits on #18257"},
 {"go":"/tab","look":"reload","expect":"the forge starts again on the page you were on"}
]

🤖 Generated with Claude Code

commented

This pass covers items 2, 3, 6, 7 and 8 and part of 1. It does not remove the iframe, which is the fix you put first. bun test passes for the tab, palette-roster, doors, module-state, unused-exports and own-source suites. tsc is clean and gate.ts exits 0 (one advisory similarity note on the shared text card). I ran no browser.

Still open

  • Box 1, the iframe (not done). The forge is still /tab holding a frame. Serving it at the tab URL with the hosted shell needs the database worker to outlive page navigation, and the service worker's scope to cover /tab. Both are an architecture change I could not do or check without a browser, and I did not want to push a half-version. I made one small step: the footer now links back to the hosted forge (The hosted forge), because the "no way to move to a hosted forge" point is separate from the frame. The nav still differs from the hosted one.
  • Box 3, the auto-start line. The localStorage tf:on check stays in boot.ts and no test runs it, because there is no browser here. The /tab script was already at its 4096-byte budget, so extracting more would have broken that test. I shortened a few status messages to make room.
  • Eviction. Clearing site data wipes localStorage together with the store, so a reload lands on Start with an empty forge. Nothing is done beyond the footer line.
  • Boxes 4 and 5. Runners is now cannot, saying "until #18257's tab runner" and "add runners in the hosted forge". There is still no switch, so box 4 stays open. The cold read was not run.

Changed

  • Box 2. later is gone, so there are only three outcomes.
    • Search, Waiting and Archive are cannot, each with a reason and the way to get it.
    • Board and Notes are differs: here they are an app made from a sentence, linked to the home page.
    • Apps no longer links to /, so Home is the only link there.
  • Box 3. The restore logic moved to src/tab/restore.ts (openOn, keepStorage). test/tab-whole.test.ts covers it, including that a stored path outside /tab/f/, or one with .., is never opened.
  • Box 6. The What works list is rows separated by padding only. Each row leads with its label in bold, then the page name, then the reason on its own line. The footer border and the row borders are removed, and so is the no-op .way-cannot strong rule.
  • Box 7. The CLASS table and the stray blank lines are removed.
  • Box 8. A new terminal screen, "What works in a forge in a tab" (src/tui/screens/tabworks.ts), lists COVERAGE and the RUNNER_* lines. A test renders it and checks every GO_PAGES name appears. It is a new palette entry, so I added it to test/palette-roster.test.ts.
  • Shared text card. To keep the gate's duplicate check quiet I added textScreen to common.ts. The screens for the maintenance week, maintenance runs and What works now use it. The week and runs screens behave as before; their tests pass.
  • Docs. docs/features/tab.md is updated.

Disagree

  • Box 9. Item 9's 56rem width is a max-width, which only caps the width. At 390px it has no effect. Please check it in a browser; I could not.
commented

This round fixes items 1–5 from the review and two of the line comments. Box 1 is still not fixed: the forge is still the #tab-frame iframe over /tab. I split it into #18305 and made #18259 wait on it. The database needs a dedicated worker (opfs-sahpool), and going straight to /tab/f/… unloads /tab and that worker with it, so every page would read "stopped". #18305 lists three ways out, and I didn't want to start a redesign this round could only half-finish. Boxes 4 (switch) and 5 (cold read) are still open, and nothing was looked at in a browser at any width.

  • Auto-start is tested (item 1): the decision is startsItself in src/tab/restore.ts, and boot.ts only calls it.
  • Evicted store is said (item 1): the worker now reports whether the store came up empty (unmade in forge.ts: no tables before the migration). If the forge ran here before and the store is empty, every forge page shows The browser cleared this forge since it last ran: Import an export to bring it back. That line goes on the pages because /tab's own status line is hidden while the forge fills the tab. If the browser cleared localStorage too, the page is a first visit again and shows Start, which is correct.
  • Persist prompt (item 3): keepStorage(storage, ask) only calls persist() on the first Start, which is a press. A start by itself on a later load only reads persisted(). The test checks that persist is never called without a press.
  • Hosted link (item 2): "The hosted forge" in the footer now has target="_top", so it leaves the frame.
  • Runners (item 4): it no longer has at in coverage.ts, so the rule is now simply that no "cannot" page is linked from What works. Runners is still reachable from the menu, and docs/features/tab.md says so.
  • Width (item 5): the forge sheet's main is back to 36rem; I reverted the widening rather than scope it to the full tab. At 390 that limit never applies anyway, since main is the viewport minus 16px of padding on each side.
  • Wording: the What works intro is now one sentence ("Each page of the hosted forge, and what it is here."), and the footer line is shorter ("Kept: the browser promised." / "The browser may clear it.").
  • Script size: boot.ts went over its 4 KB budget with these changes, so I shortened its status messages and console labels to get back under. The "may already hold the forge" wording that test/tab.test.ts reads is kept.

Checks: the gate passed (0 fail), bun x tsc --noEmit and bun scripts/design-lint.ts are clean. fast.ts named 3196 test files (the base has moved a long way), so I picked the runs myself: test/tab*, tabforge*, palette-roster, module-state, abstractions, deadends*, unused-exports and job-slices all pass.

[
  {"go":"/tab","look":"press Start it","expect":"the forge opens on /tab/f/ and, if the browser prompts to keep storage, it does so once"},
  {"go":"/tab","look":"reload the page","expect":"the forge starts by itself on the last page read, with no storage prompt"},
  {"go":"/tab/f/pages","look":"the Runners row","expect":"Cannot work in a tab, not a link; Runners is still in the menu"},
  {"go":"/tab/f/","look":"the footer's 'The hosted forge' link","expect":"it replaces the whole tab with the hosted forge, not the frame"},
  {"go":"/tab","look":"after Start, clear the site's storage (OPFS only) in devtools, then reload","expect":"every forge page leads its footer with 'The browser cleared this forge since it last ran'","ask":"Is the cleared line prominent enough at 390?"}
]

🤖 Generated with Claude Code

commented

Left #18259 open: 3 unticked items remain (The tab forge fills the tab. Its own URL, full viewport, the same shell, navigation and pages as a hosted forge at 390, 820 and 1440. No frame, no inset window, no page around it. Anything about "this forge lives in your browser" is one quiet line in the shell with where its data is and how to keep it (export, or move it to a hosted forge).; Put this machine to work. The tab forge has the Runners page from #18257 with this tab as its first runner: one switch, what it is running, what it ran. Open the forge on any spare machine's browser, sign in, switch it on, and it takes tab jobs for the forges and repositories its owner chose. This is the vision; it lands with #18257's tab spike, not before, and says plainly what a tab can and cannot run.; A cold read (a no-context agent, headless, timed): open the tab forge, say what it is, make an app, find the runner switch. Report what was confusing.).

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs