Flush the description's pending autosave on every close path - #351
Merged
Merged
Conversation
…'s own exits The row committed on its three own exits — Save description, Escape, the trash — but pages closed it for their own reasons, and each of those dropped the last half-second of typing on the floor: the chip toggle, the review window starting (worst case: Post pressed mid-word and the note publishes without the tail), an account moving under the tab (the old account's draft persisted without it). The row exposes its pending autosave now, and closeAltEditor flushes it by default. Two closes deliberately do not: removing the image (the slot is gone; flushing would write one image's words onto another) and the drag, which closes BEFORE the splice so the flush still lands in the right slot. The tab's account switch closes before the old draft is persisted, which is that account's last chance to take the tail. Fixes #342.
This was referenced Sep 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #342. Stacked on #341 — review and merge that first; this PR's base is
feat/imeta-alt-text, so the diff shown here is just this fix.The gap
The ALT row committed on its three own exits (Save description, Escape, trash) — but pages closed it for their own reasons, and each dropped the last half-second of the debounced autosave:
The fix
buildAltEditorRowexposesflushPending()on the row: fires the pendingonChangeif the 500ms debounce is live.closeAltEditor(flush)flushes by default.false(the slot is gone — flushing would write one image's words onto another), and the drag closes before the splice so the flush still lands in the slot the row was opened for.flushDraft(), the old account's last chance to take the tail.Tests pin all of it: the exposed flush, the
flush !== falseguard, removal'sfalse, drag-before-splice ordering, and the two load-bearing call sites.