Files
archived-orca/mobile/src/mobile-web-shell
Kelvin Amoaba 35720d4e55 feat(mobile): keep unsent chat drafts and skill picks across an app restart (#38268)
* feat(mobile): keep unsent chat drafts across an app reload

Chat drafts and their skill picks lived only in the page document's
memory, so killing the app or an OTA reload lost them. Each
workspace's tab drafts are now saved in the page storage slot shells
since 0.0.59 already allow (left unused by #37900). A clear saves at
once so a sent draft never returns, and tabs the host stops listing
or the phone closes are dropped from storage. A restored draft that
leads with a skill loads the skill catalog so its chip shows again.

* fix(mobile): let a pre-load send win and keep skill scan retries

A send or clear made before a workspace's saved drafts finished
loading no longer gets overwritten by the saved text. A page whose
shell refuses the key stops re-reading it, a dropped write is retried
on the next save, and a failed skill scan is still retried the next
time the menu opens.

* fix(mobile): save pending chat typing when the app goes to the background

A write that fails partway no longer leaves a remembered value that
makes the next clear look already saved, and typing still inside the
250 ms window saves when the page is hidden.

* refactor(mobile): simplify chat draft persistence

Read the saved value back once per write through persistMirroredReadBack,
build the key with the allowlist's own workspaceScopedKey, keep tab-scope
parsing in one place, track the load as one state, stop holding
retirements once the load lands, and skip the per-draft size loop when
the whole value fits. Drops the test-only settle export.
2026-11-05 20:29:11 +00:00
..