hermes-agent/apps
Brooklyn Nicholson 65ddc7c4a1 fix(desktop): retain composer attachments per session scope + guard programmatic drafts
The salvaged draft persistence scoped text per session but reset the
composer's attachments to [] on every scope change, so a staged image or
file was silently dropped when you switched sessions and never restored on
return — inconsistent with the "drafts survive session switches" promise
and a real paper-cut given remote staging cost.

Retain attachments per scope in an in-memory map (keyed by the same scope
as the text draft) since blobs / object URLs / live upload state can't be
serialized to localStorage. Entering a scope restores its stashed chips;
leaving stashes the current ones; an accepted submit clears the scope.
This survives session switches (the case users hit) without pretending to
survive a full reload, which attachments fundamentally can't.

Also guard the debounced text write so browsing sent-message history or
editing a queued prompt (both swap the composer to recalled text via
loadIntoComposer) no longer clobbers the genuine in-progress draft in
storage.

Co-authored-by: mollusk <roger@roger.local>
Co-authored-by: Teknium <127238744+teknium1@users.noreply.github.com>
2026-06-10 22:41:34 -05:00
..
bootstrap-installer change(tooling): typecheck in CI, update ts to 6 2026-06-10 11:59:34 -04:00
desktop fix(desktop): retain composer attachments per session scope + guard programmatic drafts 2026-06-10 22:41:34 -05:00
shared change(tooling): typecheck in CI, update ts to 6 2026-06-10 11:59:34 -04:00