Repository navigation
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to Mobile Chat can now open artifact paths and share PDF, audio, and video files through the system share sheet. Downloads are validated, size-bounded, and cancellable. No outstanding issues block merging. Pre-merge checks |
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
4e56e076-22cd-4efb-9c5e-af49766e9a25
⛔ Files ignored due to path filters (1)
mobile/pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (16)
mobile/package.jsonmobile/src/components/markdown-file-path-artifact-extensions.test.tsmobile/src/components/markdown-file-path-detection.tsmobile/src/files/MobileFileMediaHandoff.test.tsxmobile/src/files/MobileFileMediaHandoff.tsxmobile/src/files/MobileFilePreviewScreen.tsxmobile/src/files/file-preview-reply-schema.tsmobile/src/files/mobile-file-explorer-row.tsxmobile/src/files/mobile-file-media-handoff-device.tsmobile/src/files/mobile-file-media-handoff.test.tsmobile/src/files/mobile-file-media-handoff.tsmobile/src/files/mobile-file-preview-navigation.test.tsmobile/src/files/mobile-file-preview-navigation.tsmobile/src/files/mobile-file-preview-operations.tsmobile/src/files/mobile-file-preview-retry.test.tsxmobile/src/session/mobile-artifact-kind.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
…bile-files # Conflicts: # mobile/src/files/MobileFilePreviewScreen.tsx # mobile/src/files/mobile-file-explorer-row.tsx # mobile/src/files/mobile-file-preview-navigation.test.ts # mobile/src/files/mobile-file-preview-navigation.ts
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟡 Minor · Reject a zero-byte EOF after a continued chunk. · mobile-file-media-handoff.ts:121-147
mobile/src/files/mobile-file-media-handoff.ts:121-147
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick winReject a zero-byte EOF after a continued chunk.
files.readChunkcan return a non-empty chunk witheof: false, then return zero bytes witheof: trueafter the source shrinks. The downloader treats the zero-byte reply as successful completion, callssink.release(attempt), and makes the truncated file available for sharing.Track whether a previous chunk required continuation and discard the transfer when this contradictory terminal sequence occurs.
Suggested fix
+ let sawNonEofChunk = false + ... if (chunk.bytesRead === 0) { + if (sawNonEofChunk && chunk.eof) { + throw new Error('File changed during download') + } break } ... if (chunk.eof) { break } + sawNonEofChunk = true
🟡 Minor · Reset handoff state when the preview identity changes. · MobileFileMediaHandoff.tsx:42-97
mobile/src/files/MobileFileMediaHandoff.tsx:42-97
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winReset handoff state when the preview identity changes.
When
relativePathchanges on the mounted native preview, the cleanup cancels the oldfiles.readChunkattempt but leavesdownloadingset. The new handoff therefore renders noOpenbutton, andopenreturns until the old request settles. Guard stale callbacks before allowing them to change the new file's state.Suggested fix
useEffect(() => { return () => { activeAttempt.current?.cancel() activeAttempt.current = null + if (mounted.current) { + setDownloading(false) + } } }, [client, relativePath, worktreeId]) @@ attempt ) @@ (bytes) => { - if (mounted.current) { + if (mounted.current && activeAttempt.current === attempt && !attempt.cancelled) { setProgressBytes(bytes) } }, @@ } catch (error) { - if (mounted.current) { + if (mounted.current && activeAttempt.current === attempt && !attempt.cancelled) { setMessage(error instanceof Error ? error.message : 'Unable to open file') } } finally { if (activeAttempt.current === attempt) { activeAttempt.current = null - } - if (mounted.current) { - setDownloading(false) + if (mounted.current) { + setDownloading(false) + } } }
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
115ae0c8-d3db-4a08-a194-b8ffb344f6ec
⛔ Files ignored due to path filters (1)
mobile/pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (3)
src/main/runtime/structured-agent-launch-support.tssrc/renderer/src/components/native-chat/NativeChatComposer.tsxsrc/renderer/src/components/native-chat/NativeChatInterruptedContinue.test.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
- src/renderer/src/components/native-chat/NativeChatComposer.tsx
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
# Conflicts: # src/main/runtime/structured-agent-launch-support.ts
ELI5
Paths in Chat open the phone file viewer. Chat artifacts, text/image/HTML previews, main-player media previews, and supported external media use the file path authorized by the host. External media is downloaded to the app cache and handed to the system share sheet.
What Changed
[email protected]package addition required by the feature.Why
Reuse the file viewer, main-player route, chat-artifact route, and host authorization instead of introducing separate readers. The system share sheet handles media that needs another app. This builds on OS handoff work from #21839 by @dudupii.
Linked Issue
Fixes #25871.
Visual Proof
BEFORE/AFTER
Captured on an Android emulator with a fixed local RPC fixture; BEFORE/AFTER are successive states in this workflow.
BEFORE: the native Android Files chat with the file list expanded, then the media preview before invoking share.
AFTER: the native Android text preview, image preview and system share chooser after the file actions.
Source composite for this historical UI evidence:
e263d278b47dd6943f3f7f78d5b79cec5cbcb93e.Evidence: debug APK SHA-256
d607ae55d0c0dfc0a19d76ce60e88ff4898c863db416039f9d225437170c5604, source compositee263d278b47dd6943f3f7f78d5b79cec5cbcb93e, emulatoremulator-5566.Recorded media playback and system handoff
Recorded media playback and system handoff evidence from source
1a9bcb624876360782350fd18df66f80ab306911and debug APK SHA-256d607ae55d0c0dfc0a19d76ce60e88ff4898c863db416039f9d225437170c5604:Android PDF share evidence recorded at
da8e98d8df77333edb83472bf6d2b53acb89a9a6: the system chooser opened for a cached 592-byte PDF 1.4, one page, with SHA-256d82eb405dcd4a53f4272fd4f1c25023453e5ef0a9648a85b36ce690a3192b3aamatching the fixture. Runtime: cold Metro bundle fromda8e98d8df77333edb83472bf6d2b53acb89a9a6; existing debug-shell APK SHA-256d607ae55d0c0dfc0a19d76ce60e88ff4898c863db416039f9d225437170c5604and source composite.Testing
Validated after merging main
398cb846ff16a5abfb9350309842c16a3fe8148a; current head4d77656d19bc1529e4c2be42f120261961d664db.pnpm tc:node: exit 0.Independent review checked the scope cleanup and merge resolution.
AI Disclosure
Codex assisted with implementation, review and validation, including GPT-6 family/Codex and GPT-5.6-Luna workers.
Review
Independent review checked file-state validation, cache ownership, cancellation boundaries, identity changes and existing player compatibility.
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.This change does not copy or mechanically translate upstream skill-installer material.
Notes
[email protected]relative to base.Author
X: @SuHarvest
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)Local validation commands, test results and Android screenshots are listed above.