A card's notes for tonight are sent when the field goes away mid-save (#536) #1035
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/536-tonight-notes-flush-on-unmount"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #536.
What was wrong
A card's notes for tonight save 1.5 s after the last keystroke, or at once on blur. The field's unmount clean-up cancelled that timer and dropped what it was about to save. So when the field left the page without a blur inside that 1.5 s, the last thing typed was lost: the opened card closing, or the stage moving to another card (the field is keyed by its card). Neither is a page unload, so the unsaved-changes prompt never asked.
What changed
pages/table/TonightNotes.jsx: the clean-up sends a waiting save, to the card it was typed on, and sends nothing when nothing is waiting or the text is back as it was.Checks
Unit: new
TonightNotes.test.jsx, five tests (unmount inside the debounce; a change of card saves to the first card; nothing waiting; typed and put back; the debounce still saves by itself). Full vitest: 3715 passed, 1 skipped. ESLint: 0 errors.In a browser (local e2e stack built from this branch, 1440×900, as the GM on the table), watching the PATCH that carries
tonight_notes:No console errors or warnings. In practice a real click on "Show less" or another card blurs the field first, which already saved; the lost case needed the field to go without a blur (a keyboard activation, or the stage being moved from elsewhere). The no-blur rows above were driven by script for that reason.
Not checked at phone width: the change has no layout, and the phone table has no notes field of its own.
🤖 Generated with Claude Code
CI on
0b7ef56e, run https://git.rhoving.com/rbrooks/Quest-Board/actions/runs/1799 : the three CI / End-to-end journeys jobs (desktop, keyboard, phone) failed before any test ran. The runner ran out of disk while building the journey stack, at 04:57–04:59 UTC:Nothing in this PR causes it. Not re-pushed: once the runner has space, those three jobs want a re-run.