fix(mobile): show the files a bot sends — video, audio, documents (MOCA-155) - #2234
Conversation
…155) Since #1552 a bot can send any file with attach_file. Documents, audio and video arrive as kind:"file" attachments with a name; the phone only read kind:"image" and kind:"audio", so a file-only reply drew as an empty speech bubble. MessageImageAttachment now decodes `name`, and Message.attachedFiles lists a bot's file attachments (deduplicated, names basenamed). Each renders as the existing file card, which opens the full-screen viewer through the message-scoped file route: QuickLook plays mp4/mov video and audio and shows PDFs and Office documents. The card says "Tap to play" with a play or waveform icon for video and audio. A file-only message previews in the roster and on the Updates line as its file name instead of nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…OCA-155) Port of the iOS change. A bot's attach_file documents, audio and video arrive as kind:"file" attachments with a name; Android only read image and audio entries, so a file-only reply drew as an empty bubble. MessageImageAttachment decodes `name` (appended, so positional callers are unchanged) and Message.attachedFiles lists the bot's files. Each renders as the shared file card, now drawn in the bubble's own text colour (it was hard-coded white, unreadable on a light bot bubble) and labelled VIDEO or AUDIO with "Tap to play" where it plays. Tapping opens the existing file sheet through the message-scoped file route. A file-only message previews as its file name. New strings carry Simplified and Traditional Chinese. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
⛔ Files ignored due to path filters (1)
📒 Files selected for processing (5)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
⛔ Files ignored due to path filters (1)
📒 Files selected for processing (15)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughAndroid and iOS now expose file attachments from messages, classify them as video, audio, or documents, and render them as transcript cards. Message previews use the first attached file’s name when no webhook task or nonempty message text is available. ChangesFile attachments
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to The attachment changes are mergeable after normal checks; Android video and PDF behavior remains untested on a device or emulator. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to Bot files become easier to open, but they continue through message-scoped delivery with file containment and private preview controls. No authorization bypass was established. Remaining uncertainty concerns the complete baseline comparison and deployed enforcement, rather than a demonstrated vulnerability. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 14 functions across 11 files. (4 skipped: 4 unsupported.)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Fixes MOCA-155
Problem
Since #1552 a bot can send any file with
attach_file. Documents, audio and video arrive askind:"file"attachments with aname. Both phones only readimageandaudioentries, so a reply that carried only a file drew as an empty speech bubble. The roster and Updates line showed nothing for it either.Change
MessageImageAttachmentdecodesname, andMessage.attachedFileslists the bot's file attachments (deduplicated, names basenamed). Each one renders as the existing file card, and tapping it opens the full-screen viewer through the message-scoped file route. QuickLook plays mp4/mov video and audio, and shows PDFs and Office documents.nameappended so positional callers are unchanged. Each file renders as the shared file card and opens the existing file sheet. The card now uses the bubble's own text colour; it was hard-coded white, which was unreadable on a light bot bubble.Not in this PR
The server side works but has limits worth a separate PR: no HTTP Range requests (long videos download in full before playing), a 25 MB cap, and m4v/mkv are rejected.
Merge note
This PR and the MOCA-191 PR (#2235) both add strings to
ios/App/Localizable.xcstrings. Whichever merges second needs that catalog re-merged.Test plan
swift testpasses, 858 tests.demo-clip.mp4andweekly-report.pdf, both cards render (screenshot above). Tapping each opened it: the PDF previewed and the video played.:core:test(763 tests) and:app:testDebugUnitTest(1129 tests) pass, and the app compiles.Platforms
kind:"file"attachments (AttachmentGallery)🤖 Generated with Claude Code
Summary by CodeRabbit