Public: anyone can read this; the crew can change it.
The toolbar's tell box keeps what was typed when the send fails #15114
Check · Review · Land · Live done — Landed and live in production.
The toolbar already behaves as the issue asks, so this pull adds only the missing test. I left src/apps/toolbar.ts unchanged. On a failed send, the submit handler shows one plain line and leaves the text in the box.
shipped production is serving it deploy 621b196
The toolbar already behaves as the issue asks, so this pull adds only the missing test. I left src/apps/toolbar.ts unchanged.
On a failed send, the submit handler shows one plain line and leaves the text in the box. On a successful send it clears the box and the saved draft. The existing test in test/apps-toolbar-draft.test.ts only checked the saved draft, not the box value or the line shown.
What changed
- I added a test to
test/apps-toolbar-draft.test.tsthat covers three cases:- A server error leaves the box text in place and shows exactly
NOTE_FAILED. - A network error leaves the box text in place.
- A successful send empties the box and shows "Sent."
- A server error leaves the box text in place and shows exactly
- The test adds a small
say()helper to the file'sboot()function that returns the status lines.
Checks
test/apps-toolbar-draft.test.tspasses: 6 tests, 0 failures.bun x tsc --noEmitandbun scripts/gate.ts --fixran with no errors and no changes.
Left out
- I did not write the issue's "main already does this" answer as a decline, because the second checklist item ("a test covers both") was not met on main.
- I did not change the failure text. When the server returns its own message, that message is shown instead of
NOTE_FAILED.
Try it
- Run
bun test test/apps-toolbar-draft.test.ts.
Test-only change; the toolbar already behaves as the issue asks, and the new test passes here. No page change, so the preview is unaffected. Two things I would do next: (1) assert the exact line in the network-error case too (NOTE_FAILED when navigator.onLine is not false); today only the box value is checked there. (2) Make say() match the status element by its own marker rather than a regex on its text, so a wrong line cannot slip past the filter.
The toolbar already behaves as the issue asks, so this pull adds only the missing test. I left
src/apps/toolbar.tsunchanged.On a failed send, the submit handler shows one plain line and leaves the text in the box. On a successful send it clears the box and the saved draft. The existing test in
test/apps-toolbar-draft.test.tsonly checked the saved draft, not the box value or the line shown.What changed
test/apps-toolbar-draft.test.tsthat covers three cases:NOTE_FAILED.say()helper to the file'sboot()function that returns the status lines.Checks
test/apps-toolbar-draft.test.tspasses: 6 tests, 0 failures.bun x tsc --noEmitandbun scripts/gate.ts --fixran with no errors and no changes.Left out
NOTE_FAILED.Try it
bun test test/apps-toolbar-draft.test.ts.Closes #15103