You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7b8713b
Browse filesBrowse the repository at this point in the historyBrowse files
refactor(mobile): composer pastes and picks are cancelled by their draft, not by the composer
Mobile's composer guarded late async results (a context paste import, a
photo/file pick, a pasted-image conversion) with component state: the
attachment actions hook mirrored the draft key into a ref from a
useLayoutEffect, and ComposerEditor aborted its import from an effect
cleanup keyed on draftKey while keeping a local `importing` flag next to
the per-draft importing atom it also wrote.
Async work that writes into a draft now registers with
composerDraftOperations under that draft's key. Whoever discards the draft
or moves the composer off it aborts the work: clearComposerDraft,
clearComposerDraftsEnvironment (including empty thread drafts with no
stored entry), beginQueuedRunEdit for the thread draft, and the new-task
submit. ComposerEditor reads `importing` from composerContextImportsAtom.
Effects: use-composer-attachment-actions 1 -> 0 (useLayoutEffect key
mirror), ComposerEditor 1 -> 0 (abort-on-key-change cleanup; one useState
mirror of the atom removed). No effects added.
Behavior change: unmounting the composer or switching it to another draft
no longer cancels a paste/pick; the result lands in the draft it started
for. It is dropped only when that draft is cleared, its environment is
removed, a queued-run edit takes over the thread composer, or a new task
is submitted. Clearing a thread draft (send) now also drops a pick still
running for it, where before the result landed in the emptied draft.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
0 commit comments