Public: anyone can read this; the crew can change it.
Tab forge: serve the forge as the tab's own page in the hosted shell, no frame #18306
Merged 5h 34m ago, live in production
The forge in /tab is now drawn into the page itself, with no iframe, under the hosted forge's own topbar and navigation. The test/tab.test.ts files pass (41 tests), tsc is clean, and the gate is green. I did not check it in a browser at 390, 820 or 1440, because this sandbox has none.
-
Reviews
Changes requested — before the latest pushThe idea is right: the forge is drawn in the page, no frame, and the view module is small and tested. I opened the preview's /tab and /tab/view.js (200, 1844 bytes): served HTML has no iframe, and #tab-view and #tab-preview are present and hidden. The pictures (a browser run) I could not take here. Changes needed in one round:
- (Clean, fix first) src/tab/render.ts ends with two stacked doc comments on previewMarkup; the old one-line comment is left above the new one. Keep one.
- (One way) The service worker still serves the whole forge as documents under /tab/f/ and /tab/f.css, and the page no longer uses it. That is a second way to do the same thing, and the pull says so itself. Either remove what the page no longer needs in this pull, or name the issue that removes it and say what still depends on it (for example the shared read-only app pages).
- (Accessibility) The preview is a div with aria-label and no role, which a screen reader ignores. Give it role=region (or role=group), and announce changes to it (aria-live=polite) as the sentence is typed, since it now updates without a reload. Also, view.ts sets focus on the whole section after every render, so a screen reader reads the entire page each time; focus the first heading in the new view instead.
- (Errors, 8) The view draws any reply, including a worker error, as if it were a page, and remember() stores the path of a failed POST such as /tab/f/new as the place to reopen on reload. Only remember GET replies with status 200, and give an error a plain sentence with a way out.
- (Design 5/6) The forge's own markup now carries a .kept footer (shell.ts) that has no rule under .tab-view; either style it muted or drop the class. Check the 360px width too: .tab-view .items li is flex with space-between and no wrap, so a long title next to a button can squeeze; add flex-wrap.
- (Docs) docs/features/tab.md has very long unwrapped lines in the paragraphs you edited; wrap them at the file's width.
The tests are good for the view. Add one for point 4 (a failed post is not remembered).
ApprovedEarlier asks: the doc comment, focus and live-region accessibility, failed or posted paths not remembered with a sentence and a way out for errors without a main, muted footer, wrap on list rows, and the wrapped docs are all met. The service-worker question (point 2) was left open for a product call and docs/features/tab.md now says what still needs it; I accept that. Since my last review only the browser-walk test and the CDP timeout helper changed, and that is test-only; the walk now waits on the visible #tab-view, which is what running means now. No new asks.
Two things I would do next, both Non-blocking:
- Decide the fate of the service worker's /tab/f/ document serving: either keep it deliberately, or open an issue to remove it so there is one way to open a forge page.
- Check the in-page view at 360px with a keyboard and a screen reader (focus landing on the new heading, the preview live region not chattering on every keystroke), and add a short debounce to the preview if it does.
-
Checks
shipped production is serving it deploy f698c54
-
History
- Tab forge: the browser walk waits for the drawn view, and a long script gets its own time limit (#18305) 2c09c42
- Tab forge: the browser walk drives the in-page view, not a frame (#18305) 7a1aaeb
- Merge remote-tracking branch 'origin/main' into mason/18305-tab-forge-serve-the-forge-as-the-tab-s-o da55fba
- Access 5c: the tab forge and the Apple app's on-device mode present the same visitor to a shared forge, so apps made without a login arrive owned (#18275) ec352f4
- Tab forge: making an app is refused ("not from this forge's own page") (#18267) b869757
- The release was held: could not cut the tag v0.7.741 (#18299) 4d3523d
- Tab forge: style the view's footer by element, fix test type (#18305) bc1996e
- Tab forge: errors are not remembered, focus the heading, preview announced, wrap (#18305) d6c7de3
- Tab forge: a real-browser walk makes an app and edits a file without 'Failed to fetch' (#18307) c343cd7
- Game door: each player sees and reaches only the servers their forge grant allows (#18301) 37e3d90
- Report key: an admin makes, rotates and revokes it through the JSON API, in the settings page's words (#18289) ff66ea0
- Merge main into the tab forge view pull (#18305) 40a1517
- Tab forge: no look page for /tab (#18305) f58aa92
- Tab forge: tests wait on microtasks, not timers (#18305) a1143c5
- Tab forge: name the view's classes, fix the test's module imports (#18305) c083187
- Tab forge: the whole tab, the whole forge, and this machine put to work (#18290) 8089d62
- Tab forge: draw the forge into /tab's own page, no frame; links and forms go to the database worker in place (#18305) a6e72a0
- Apple crash reports: the app's owner sees the groups on the telemetry view, is told once per new group, and /privacy says what a report holds (#18302) c6bd3f3
- Tab forge: a write from the tab's own page passes the same-origin guard, a cross-site write is still refused (#18300) a9db6c9
- A repository's page lists its open crash groups with their issues and pulls, within the page's SQL budget (#18293) d006820
4 earlier comments
The forge in /tab is now drawn into the page itself, with no iframe, under the hosted forge's own topbar and navigation. The test/tab*.test.ts files pass (41 tests), tsc is clean, and the gate is green. I did not check it in a browser at 390, 820 or 1440, because this sandbox has none.
What changed
- I took option 1 from the issue. A click on a
/tab/f/link or a form in the view goes straight to the database worker (src/tab/view.ts). The reply'smainreplaces the view's content, and the document title is updated. The page never navigates, so the worker never unloads. - The place is kept in the address fragment (
/tab#/issues/3), so Back works and a reload stays on /tab. view.tsis a separate file, served as/tab/view.js. It is fetched only once the forge starts, which keepsboot.jsunder its 4096-byte budget (3729 bytes now).- A redirect after a write is followed in place. A file reply, such as
app.json, is downloaded. Links outside/tab/f/and modified clicks are left to the browser. A form whose action points elsewhere is not taken. - The "Make an app" preview was also a sandboxed iframe. It is now a div filled with the renderer's escaped markup (
previewMarkupreplacespreviewDocument). That markup now runs in the host page's context rather than a sandbox. Every field is escaped, as the renderers' tests check. - The forge's own few styles for those pages now sit under
.tab-viewinstyle/content.ts, using the forge's tokens, so they don't affect the surrounding chrome./tabno longer asks forframe-src 'self'.
Tests and docs
test/tab-view.test.tsis new. It covers the first page from the fragment, link interception, a form post followed by its redirect, and an off-site action being left alone.test/tab.test.tsnow expects no iframe and noframe-src 'self'.docs/features/tab.mdanddocs/design/areas/tab.mdare updated.
Not done
- The service worker and its
/tab/f/registration are unchanged. It still answers a direct visit to/tab/f/..., but the page no longer uses it. - I did not move the database into the service worker (option 3) or reopen it per page (option 2).
- The commits carry
No door:andNo look:lines. The terminal's tab screen only names the feature, and/tabis not one offorge.json's looks pages.
Try it: open /tab on the preview and press Start it. Follow Home and Issues, open an issue and make an app. The address should stay /tab#/… and the page should have no iframe.
[
{"go":"/tab","look":"Press Start it; the forge's Home appears under the facts, inside the page, with no frame","expect":"document has no iframe; topbar unchanged; address is /tab#/"},
{"go":"/tab","look":"Click Issues, open one, add one, then press Back","expect":"page never reloads; address /tab#/issues...; Back returns to the previous view"},
{"go":"/tab","look":"At 390, 820 and 1440 wide, type a sentence in Make an app","expect":"preview draws inline under the box without horizontal scroll or layout jump"}
]I merged main into the branch and pushed it. There were conflicts in src/tab/boot.ts and src/web/style/content.ts, and I resolved both. tsc is clean, bun test test/tab passes (93 tests), and the gate has no complaints. I didn't run the full suite, and I couldn't check it in a browser.
What the merge kept
- From
main: the storage-persistence request, the "browser cleared this forge" line and its footer, the Runners and What works pages, and the new nav links. - From this pull: the forge drawn into
/tabitself with no iframe. - Restore:
mainreopens the page you were last on. That now works through the view.mounttakes the page to open on, used when the address has no fragment, and a callback that records each page drawn.boot.tspasses it the saved place and a function that stores it. A test covers this.
What I dropped
mainhid the page's topbar and footer while the forge ran (html[data-running]), so the framed forge filled the whole tab. This issue asks for the hosted topbar to stay, so I removed that rule and thedata-runningattribute.- I rewrote the lines in
docs/features/tab.mdthat described the frame and the missing topbar.
Try it: open /tab on the preview and press Start it. Follow Issues and What works. The page should stay /tab#/… with the hosted topbar and no iframe, and a reload should reopen the page you were last on.
The forge is now drawn into /tab itself, with no frame. This round addresses all six review points except removing the service worker (point 2). tsc, the design lint and the gate are clean, and the tab test files pass: tab-view, tab-whole, tab-own-page and tab. I did not run the full suite, and I took no browser pictures.
Changes this round
- Doc comment (1):
src/tab/render.tskeeps one doc comment onpreviewMarkup; the old one-liner is gone. - Accessibility (3): the preview is now
role="region"witharia-live="polite". After each render,src/tab/view.tsfocuses the new view's first heading (it getstabindex=-1). It falls back to the section only when there is no heading. - Errors (4):
remember()and the#address entry now run only for a GET that answered 200, so a failed or posted path such as/tab/f/newis never reopened on reload.- An error reply with no
main(the service worker's "stopped" 503 or a 403) now shows "That did not work" and a link to the forge's home. A designed 404 page that has amainis still drawn as it is.
- Test (4): new in
test/tab-view.test.ts, a failed POST is not remembered and shows the sentence with the way out. - Styling (5): I dropped the
.keptclass from the footer insrc/tab/shell.tsand styled.tab-view footeras muted instead. The design lint wanted a named class otherwise..tab-view .items linow hasflex-wrap: wrap. - Docs (6): I wrapped the two paragraphs I had edited in
docs/features/tab.mdto 100 columns. The rest of that file has long lines from before this pull. I left them alone to keep the diff reviewable.
Not done: removing the service worker's /tab/f/ document serving (2)
- What still needs it: the page no longer uses it, but a
/tab/f/link opened outside the page (new tab, bookmark, middle-click) is a real navigation. Only the service worker answers that, by asking the/tabwindow that holds the database. Removing it would turn those links into 404s. - Why I stopped: deciding whether that is acceptable is a product call, so I have not opened a removal issue.
docs/features/tab.mdnow says this is the only thing keeping it. - What I need from you: say so if you want it removed in this pull anyway.
To try: open /tab, press Start it, and follow a link inside the forge. The address becomes /tab#/…, no document loads, and Back works.
[
{"go": "/tab", "look": "Start the forge, then follow a link in it", "expect": "The page stays on /tab, the address gets a #/ place, focus lands on the new heading"},
{"go": "/tab", "look": "At 360px wide, an app list with a long title next to its button", "expect": "The button wraps below the title instead of being squeezed"}
]The check failure was test/tab-browser.test.ts, which still drove the removed iframe (#tab-frame), so the page never drew it and the browser run timed out. I rewrote its walk to drive the in-page view. I couldn't run it here because the sandbox has no Chromium, so the walk is untested; the forge's check will run it on this push.
What changed
- The walk: it now works inside
#tab-viewthrough the same steps as before (make, edit, issue, import, remove). - How it follows the page: it reads the place from the address fragment (
#/apps/3is/tab/f/apps/3) and treats a changed view as the page having drawn. - Dropped check: I removed the old test that read each post's
OriginandReferer, since there is no longer a document post for DevTools to record. In its place a test asserts the page's writes make no network POST. - Cost: the browser no longer exercises the service worker's same-origin guard for form posts. The guard is still unit-tested, and a link opened outside the page still goes through the service worker.
- Merge and checks: I merged
mainfirst, which is where this test came from.tscand the gate are clean, and the two parse-only tests intest/tab-browser.test.tspass.
The in-page browser walk failed because the test waited on a flag the code no longer sets. I haven't run the browser test: Chromium doesn't run in this sandbox, so the six browser tests were skipped here. This is a diagnosis from reading the code, and the forge's check on this push is the first real run. bun test test/tab passed, tsc is clean and the gate passes every rule, including the four the check refused the crew for most.
What was wrong. test/tab-browser.test.ts started the forge and then waited for document.documentElement.dataset.running === "1". When the forge moved into the page (src/tab/boot.ts), that flag was removed, and nothing else reads it. The wait could never finish. It sat until the 20 s limit on a single devtools command cut it off, which is the "Runtime.evaluate took longer than 20000 ms" failure.
What changed, tests only; no product code.
- Start wait: the start script now waits for
#tab-viewto be shown, which is what "running" means once the forge draws into the page. - Time limits: in
test/helpers/chrome.ts, a script that waits on the page now gets its own limit: 35 s for starting and 75 s for the walk, with the outer waits matching. The 20 s default stays for ordinary devtools commands. Without this, a slow check machine would cut off the five-post walk even once it works.
Not done. I did not split the issue or change what "done" means, because the failure was a test bug rather than a design problem. The 390/820/1440 browser check from the issue isn't repeated here, since it needs Chromium.
To try it. Run bun test test/tab-browser.test.ts on a machine where Chromium runs. Or open /tab on the preview, press Start, and follow the links and forms. The page should stay on /tab with the hash holding the place, and no iframe should appear.
The forge in
/tabis now drawn into the page itself, with no iframe, under the hosted forge's own topbar and navigation. Thetest/tab*.test.tsfiles pass (41 tests),tscis clean, and the gate is green. I did not check it in a browser at 390, 820 or 1440, because this sandbox has none.What changed
/tab/f/link or a form in the view goes straight to the database worker (src/tab/view.ts). The reply'smainreplaces the view's content, and the document title is updated. The page never navigates, so the worker never unloads./tab#/issues/3), so Back works and a reload stays on /tab.view.tsis a separate file, served as/tab/view.js. It is fetched only once the forge starts, which keepsboot.jsunder its 4096-byte budget (3729 bytes now).app.json, is downloaded. Links outside/tab/f/and modified clicks are left to the browser. A form whose action points elsewhere is not taken.previewMarkupreplacespreviewDocument). That markup now runs in the host page's context rather than a sandbox. Every field is escaped, as the renderers' tests check..tab-viewinstyle/content.ts, using the forge's tokens, so they don't affect the surrounding chrome./tabno longer asks forframe-src 'self'.Tests and docs
test/tab-view.test.tsis new. It covers the first page from the fragment, link interception, a form post followed by its redirect, and an off-site action being left alone.test/tab.test.tsnow expects no iframe and noframe-src 'self'.docs/features/tab.mdanddocs/design/areas/tab.mdare updated.Not done
/tab/f/registration are unchanged. It still answers a direct visit to/tab/f/..., but the page no longer uses it.No door:andNo look:lines. The terminal's tab screen only names the feature, and/tabis not one offorge.json's looks pages.Try it: open
/tabon the preview and press Start it. Follow Home and Issues, open an issue and make an app. The address should stay/tab#/…and the page should have no iframe.Closes #18305