Files
opencode-mobile/app
Den 5b47f9ee13 fix: propagate send failures, guard image conversion, cleanup speech mic (#130)
Seven correctness bugs in the session composer:

- sessions.ts sendMessage: await the prompt submission and rethrow on
  failure instead of a fire-and-forget .catch(), so handleSend's existing
  restore-draft-and-alert catch actually runs.
- pasteFromClipboard: route pasted images through toJpeg() so they get
  the same resize/compress treatment as picked/captured photos.
- pickFromLibrary/pickFromCamera: wrap toJpeg() in try/catch (and switch
  to Promise.allSettled for the multi-select batch) so one bad asset
  doesn't silently drop the whole batch; surface a new imageFailed alert.
- pickFromLibrary: cap selection at 10 images.
- useSpeech: abort the native recognition session on unmount so the mic
  doesn't stay hot after leaving the screen.
- Surface useSpeech's error via Alert, keyed on the error value so it
  fires once per distinct error.
- Undo on the revert banner now also clears the composer, since it was
  prefilled by the edit flow and could otherwise be sent as a duplicate.


Claude-Session: https://claude.ai/code/session_01T12AhSnQVrSxNnvwfCx2z6

Co-authored-by: engineer <engineer@macbookpro.lan>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-18 15:01:36 -07:00
..