Skip to content

feat(ios): support photo and file attachments in chat - #7388

Open
me2seeks wants to merge 2 commits into
feat/ios-chat-liquid-glassfrom
feat/ios-chat-attachments
Open

me2seeks wants to merge 2 commits into
feat/ios-chat-liquid-glassfrom
feat/ios-chat-attachments

Conversation

@me2seeks

@me2seeks me2seeks commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Stacked on #7383 (feat/ios-chat-liquid-glass, 2 clean commits separating transport and iOS UI).

  1. feat(remote-client): support binary ReadResource streaming (42bb6f250c):
    • Extends platform/remote-client ReadResource to carry both UTF-8 and raw binary payloads ({encoding: "bytes", resource: {name: "maka.bytes", version: 1}, length, metadata: {}}) streamed in <= 64 KiB chunks after Ready (with 0-byte resources emitting no chunks), while preserving existing UTF-8 credential chunking and character-boundary guarantees.
  2. feat(ios): support photo and file attachments in chat (71e138bd09):
    • Native zero-copy blob upload (src/attachments.rs, src/bridge.rs, src/lib.rs): Enables caps.picker = true (using iOS out-of-process PHPickerViewController and UIDocumentPickerViewController, zero photo/file permission prompts), adds a narrow VM-scoped blob_bytes() helper in NSH (documented in third-party/nsh/SOURCE.md, no upstream.json change) so arbitrary binary files are read directly from native shared bytes without copying into JS or hashing image cache keys on the VM thread, computes full SHA-256 on a background thread, and binds iosAttachments.upload / cancel via Registry::value scoped to agent.uploadAttachment.
    • Stage-aware cancel & receipt reconciliation: Cancels pre-confirm queued/uploading tasks immediately on Remove or leaving a chat to release native PickedBlob memory; once confirm begins, preserves the original operation reference and reconciles independently on reconnect (not starved behind stalled journal reads) with bounded 5s failure/timeout -> unconfirmed and zero duplicate re-uploads.
    • Host contract & UI/UX (app/state/attachments.ts, app/screens/chats/AttachmentStrip.tsx, app/state/chat.ts, ChatScreen.tsx):
      • Supports regular chats, Rooms (uploading to Room ID and sending via agent.send without emitting backend/expectedRunId keys), and forked Side Questions; leaves unforked Side Drafts without an attachment entry.
      • Enforces 4 attachments per message, 16 MiB per file, single concurrent upload slot, maxDimension: 2048 + format: "compatible" for photos (re-checked after processing), and per-file tooLarge handling.
      • Portrait left 44×44pt + menu (Photo Library / Choose Files) + single-row AttachmentStrip above the input (solid chips, no glass-on-content); compact landscape integrates pickers & scrollable attachment management sheet into chat-composer-actions. Preserves software keyboard Return newlines alongside ⌘↩ / Send gating.
      • Fixes groupHistoryTurns so attachment-only messages aren't dropped from history, and renders read-only HistoryAttachments chips in UserBubble and non-deleted RoomTranscriptItem.

Verification

  • maka-remote-client: 12 passed (8 unit covering 0 / 65,536 / 65,537 B binary framing and cross-chunk UTF-8 credentials + 4 integration including mid-upload cancel releasing Host budget).
  • maka-ios-shell: 120 passed (18 lib including receipt stream disconnect/timeout/cancel, independent reconnect recovery ahead of 3 stalled journal receipts, and pre-confirm cancel on leave; 98 behavior including real Host agent owner Room E2E upload of PNG + 65,537 B binary file verifying exact bytes/length/SHA-256, pure-attachment history, gating, retry reusing original IDs, and cross-root isolation; 4 language).
  • NSH zero-copy blob_bytes regression (16 MiB, cross-VM rejection, post-revoke retention): passed.
  • aarch64-apple-ios --locked check, tsc --noEmit, ASF license headers, Rust dependencies, migration lock, 12-locale i18n, Biome, cargo fmt --check, and git diff --check 20536b2de3..HEAD all passed.

Known test gaps

  • Physical iPhone UIKit PHPicker / UIDocumentPicker presentation, HEIC orientation rendering, live VoiceOver, and real RSS profiling were not performed; verification used headless NSH/Rust suites, wire fixtures, and real local Host E2E tests.

Screenshots

Captured on iPhone 18 Pro Simulator (iOS 27.2, integrated preview build):

Chat composer AttachmentStrip with photo thumbnail and file chip plus HistoryAttachments chips in transcript

@me2seeks
me2seeks force-pushed the feat/ios-chat-liquid-glass branch from 20536b2 to 40e0043 Compare November 28, 2026 02:22
@me2seeks
me2seeks force-pushed the feat/ios-chat-attachments branch from 71e138b to 153b5f7 Compare November 28, 2026 02:23

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant