Spaces:
Running
One page: the document is the app, and a switcher replaces the index
The index page listed documents and registered agents. Agents already live in a header popover on the document itself, so all it really carried was the list — a whole page, and a round trip through it every time you changed document.
That list is now a popover under the title at top left: every document you can reach, the one you are in marked, creator-only delete where it was before, and New document / Playground.
Switching is still a navigation rather than a client-side swap. Swapping the Yjs document in place would have been easy, but then one URL would mean several documents and sharing a link stops working. The shell is cheap; one document stays one URL.
/ is no longer a page:
| visitor | what happens |
|---|---|
| signed out | shell + sign-in overlay, as /d/<id> already did |
| signed in, has documents | 302 to their most recently updated one |
| signed in, no documents | shell served bare, switcher opens itself, "Nothing here yet" |
The redirect is deliberately a redirect and not a create: a GET that makes a document means every crawler, link preview and health check leaves an empty one behind.
That third row is the one state the old index handled that a document-shaped app otherwise cannot, and it needed building rather than deleting. It also had a bug worth mentioning, since the fix is in here: the shell ships the loading skeleton up and the sync that normally takes it down never happens on that path, so a first sign-in showed a document apparently stuck loading, with the "create your first document" message sitting underneath it. The test now asserts the skeleton is down and the message is on the sheet.
Deletions. client/index.html and client/src/home.js go, with the build entry and the static index that served them. public/index.html and public/home.js go too, and that part matters: npm run build writes its outputs but does not remove stale ones, so leaving the built pair in the repo means /index.html still serves a working copy of the deleted UI — outside the switcher and outside every test. (I shipped exactly that bug in my own fork before catching it.)
Nothing from the old page was dropped except the page itself — list, delete, new-doc and playground all moved into the switcher.
Test drives the switcher where it used to drive the index, and gains a case for listing/marking/switching and one for / resolving.
The largest of the four PRs in this set, and the one most likely to conflict with the others — it touches client/src/doc.js, client/app.css, client/doc.html, client/src/common.js, server/index.js, scripts/build.js and test/browser.js. Merging it last is probably easiest.