Nothing guards a draft: one click in the sidebar throws away an unsent cover letter #258
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
security
tier
1
tier
2
tier
3
tier/4
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Postulo/postulo#258
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
There is no
beforeunloadhandler anywhere inapp.js— 1,916 lines, none of them aboutlosing work — and no autosave. The cover letter body is an eighteen-row textarea
(
documents/forms.py:205); a CV summary is four, an override six, notes three. Navigationis a full page load almost everywhere, because htmx appears in seven of 182 templates. So
the sidebar, the search box, the back button and every link on the page are one click away
from discarding whatever is in that textarea, silently and with no way back.
Nothing in Postulo has ever asked somebody to retype a letter. It has simply never been
tested by anybody who clicked the wrong thing an hour in.
Two fixes, and they are not the same size
The guard. Mark a form dirty on first input; ask before unloading. It is a dozen lines
and it stops the whole class of loss. Three things it must get right:
infuriating;
for this project and worth saying out loud in the code rather than discovering later;
ddiscards and moves on,jskips) navigate too, and mustrespect the same dirty state or they become the fastest way to lose a correction.
The draft. Keeping what was typed, so the answer to a crash or a closed tab is not "start
again". That is a larger decision and should be made deliberately:
localStorageis data living outside the database, per-browser, invisible toexport and to every other device — which cuts against how the rest of Postulo treats a
person's data, and should be said plainly in the interface if it is done that way;
table, a rule for when it is cleared, and an answer for what a half-written letter means
when somebody looks at the list of letters;
back — never silently, because silently restoring stale text over something deliberate is
a worse failure than the one being fixed.
The guard is worth doing on its own and worth doing first. The draft can follow, or not.