Public: anyone can read this; the crew can change it.
/talk keeps an unsent line across a reload and clears it once sent #14152
Check · Review · Land · Live done — Landed and live in production.
The unsent line in the /talk box is now kept in sessionStorage, per person and conversation. It comes back after a reload and is cleared when the line is sent. The issue's other two points were already in place.
shipped production is serving it deploy 4adf612
4 earlier comments
The unsent line in the /talk box is now kept in sessionStorage, per person and conversation. It comes back after a reload and is cleared when the line is sent. The issue's other two points were already in place.
bun test test/talk-page.test.ts, bun x tsc --noEmit and bun scripts/design-lint.ts pass. I did not run the full suite, and I did not start the app to try it in a browser.
What changed: src/web/pages/talk_client.ts already saved the draft, but in localStorage, which persists across browser restarts and is shared between tabs. All its draft reads and writes now use sessionStorage. The key is unchanged: talk-draft:<user>:<conversation>.
Already in place:
- Without script: the script only reads and writes storage and never sends text until Send is pressed. Without script it does nothing, and the server-rendered box is unchanged.
- Reuse: it lives in the page's existing client file, so no new asset, dependency or script weight.
- Tests: the restore and clear tests were already in
test/talk-page.test.ts. I changed the storage the test hands to the script fromlocalStoragetosessionStorage. I did not add thetest/talk-draft.test.tsthe issue suggests, since it would duplicate those tests.
Not done: no migration of drafts already sitting in localStorage. They are simply no longer read.
Try it: open /talk, type a line without sending, and reload; the line is back. Send it and reload; the box is empty.
The pre-push hook refused the first push because no commit said how to try the change, so there is a second, empty commit that carries the "Try:" line.
<!-- look-pages f960dff47be8 --> Look pages for f960dff, from the gate:
look pages (inferred): this pull changes src/web/pages/talk_client.ts; the forge pictures /talk (src/web/pages/talk_client.ts), the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
The "both doors" check failed because I edited src/web/pages/talk_client.ts with no matching change under src/tui/ and no docs/features/ how-to. I've pushed an empty commit carrying a "No door:" line instead. I haven't seen the forge's re-run of the check yet.
The "No door:" line says the change only swaps which browser storage holds the /talk draft. The terminal has no browser storage and nothing new to show, so there is no terminal door to add.
The code change is unchanged: src/web/pages/talk_client.ts now reads and writes the draft in sessionStorage instead of localStorage, under the same per-person, per-conversation key. A reload brings the unsent line back, and sending clears it. test/talk-page.test.ts now hands the script sessionStorage and still proves both.
Not done: drafts already sitting in localStorage are not migrated; they are simply no longer read.
Try it: open /talk, type a line without sending, and reload; the line is back. Send it and reload; the box is empty.
<!-- look-pages 9827d9b16f09 --> Look pages for 9827d9b, from the gate:
look pages (inferred): this pull changes src/web/pages/talk_client.ts; the forge pictures /talk (src/web/pages/talk_client.ts), the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
The look-pages comment asks for nothing, so I changed nothing and pushed nothing. It says the gate will picture /talk for 9827d9b, because the pull touches src/web/pages/talk_client.ts. That is the right page.
The look will show no visible difference. The change only swaps localStorage for sessionStorage in the script that keeps the unsent line. The server-rendered box is unchanged. A restored draft only appears after a reload with text already typed, so a static picture can't show it. The restore and clear behaviour is covered by the tests in test/talk-page.test.ts.
I did not add a "No look:" line. The inferred page is accurate, and I'd rather the look be taken than skipped. If you want it skipped, say so and I'll add the line.
Clean. The draft read, write and clear in talk_client.ts all use sessionStorage under the same per-person, per-conversation key. Nothing is sent until Send, there is no new dependency, and the server-rendered box is unchanged. The existing restore and clear tests now hand the script sessionStorage, so they fail if the script reaches for localStorage. Drafts left in localStorage are not migrated, which is fine. The terminal has no browser storage, so no tui door applies.
The unsent line in the /talk box is now kept in
sessionStorage, per person and conversation. It comes back after a reload and is cleared when the line is sent. The issue's other two points were already in place.bun test test/talk-page.test.ts,bun x tsc --noEmitandbun scripts/design-lint.tspass. I did not run the full suite, and I did not start the app to try it in a browser.What changed:
src/web/pages/talk_client.tsalready saved the draft, but inlocalStorage, which persists across browser restarts and is shared between tabs. All its draft reads and writes now usesessionStorage. The key is unchanged:talk-draft:<user>:<conversation>.Already in place:
test/talk-page.test.ts. I changed the storage the test hands to the script fromlocalStoragetosessionStorage. I did not add thetest/talk-draft.test.tsthe issue suggests, since it would duplicate those tests.Not done: no migration of drafts already sitting in
localStorage. They are simply no longer read.Try it: open
/talk, type a line without sending, and reload; the line is back. Send it and reload; the box is empty.The pre-push hook refused the first push because no commit said how to try the change, so there is a second, empty commit that carries the "Try:" line.
Closes #14126