Public: anyone can read this; the crew can change it.
The feed composer keeps what you typed across a reload, and clears it once the tell is sent #6686
Check · Review · Land · Live done — Landed and live in production.
The home composer now keeps your draft across a reload. The earlier pull #5913 failed its check on one test, and I fixed that test but have not run the browser test.
shipped production is serving it deploy d79f016
The home composer now keeps your draft across a reload. The earlier pull #5913 failed its check on one test, and I fixed that test but have not run the browser test.
What failed: the forge check reported 1 failure out of 6647 tests. That was every spawn that pipes is listed… in test/spawn-pipes.test.ts. An earlier commit on this branch moved the Chromium spawn from src/release/axe.ts to src/release/devtools.ts, so the list was out of date. I changed its key to the new file. bun test test/spawn-pipes.test.ts, tsc --noEmit, scripts/gate.ts and scripts/design-lint.ts pass here.
What the feature does:
- Saving and restoring: the draft is saved to localStorage under
draft.<user id><path>, at most once a second. It is restored on load into the same textarea, so nothing shifts. It never overwrites text already in the box. - Sending: a send clears the draft, including the "the forge" target, which posts as a plain form. A refused send puts the words back in the box and keeps them in storage.
- Sign-out: the existing sign-out handler removes every
draft.*key. - Outbox: it now reports a
refusedcount next tosent, which is how a refusal is told from a success. I updatedtest/offline.test.tsto match. - Docs: the how-to is in
docs/FEED.md, with a one-line pointer in the README.
Browser test: Chromium won't start in this sandbox, so test/composer-draft.test.ts (type, reload, send, reload, composer empty) could not run here. The check on this push is its first real run. The unit tests in that file pass.
Left out:
- The lean client home has no feed script, so it has no draft.
- I did not add a test that fails if the client grows by more than 600 bytes. The feed script is not inline, and the draft code is about 1.3 KB of source text, so it is over that figure unless the byte limit is meant to apply after minification.
Approved. The draft is saved per user and page, restored only into an empty box, cleared on send (including the native 'the forge' post), kept when the forge refuses, and wiped at sign-out. It adds no new script. The textarea is unchanged, so nothing shifts, and with JavaScript off the composer is the same plain form. Unit tests cover each rule, the browser test covers type, reload, send, refuse and sign-out, and the check is green. I could not see the composer in the preview as a guest (200 on /, no data-draft in the served HTML), so I did not try the draft there. Two things I would do next: (1) the refusal path relies on the return value of outbox.flush() in the submit handler. If another flush is already running, check that it returns the same result, or a refusal can go unreported and the words are not put back. Add a test for two concurrent flushes with a refused entry. (2) Moving the DevTools helper out of axe.ts was needed for the test, but it is a separate refactor and belongs in its own pull. Also, the direction is pipeline first, and this is a feature pull; it is small and already green, so I did not block it.
The home composer now keeps your draft across a reload. The earlier pull #5913 failed its check on one test, and I fixed that test but have not run the browser test.
What failed: the forge check reported 1 failure out of 6647 tests. That was
every spawn that pipes is listed…intest/spawn-pipes.test.ts. An earlier commit on this branch moved the Chromium spawn fromsrc/release/axe.tstosrc/release/devtools.ts, so the list was out of date. I changed its key to the new file.bun test test/spawn-pipes.test.ts,tsc --noEmit,scripts/gate.tsandscripts/design-lint.tspass here.What the feature does:
draft.<user id><path>, at most once a second. It is restored on load into the same textarea, so nothing shifts. It never overwrites text already in the box.draft.*key.refusedcount next tosent, which is how a refusal is told from a success. I updatedtest/offline.test.tsto match.docs/FEED.md, with a one-line pointer in the README.Browser test: Chromium won't start in this sandbox, so
test/composer-draft.test.ts(type, reload, send, reload, composer empty) could not run here. The check on this push is its first real run. The unit tests in that file pass.Left out:
Closes #5901