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⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (30)
🚧 Files skipped from review as they are similar to previous changes (30)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe change adds native mobile video previews for MP4, M4V, and MOV files. Runtime and relay readers now return video metadata and Base64 content. Mobile preview requests validate and normalize video responses. Mobile screens stage video data in cache files and play it with Expo Video. File rows show video icons, while WebM and MKV remain unsupported. Tests cover classification, transport, normalization, caching, and playback-related flows. Merge Risk: ⚪ Minimal · up to The PR adds mobile previews for supported video files while preserving existing size, authorization, and unsupported-format handling; no actionable merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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 |
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 2fdf175c-ac47-4e31-8e3b-3fa8ea48b69e
⛔ Files ignored due to path filters (1)
mobile/pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (30)
mobile/app/h/[hostId]/session/[worktreeId].tsxmobile/package.jsonmobile/src/files/MobileFilePreviewBody.tsxmobile/src/files/MobileFilePreviewScreen.tsxmobile/src/files/MobileFileVideoPreview.tsxmobile/src/files/file-tree.tsmobile/src/files/mobile-file-explorer-row.tsxmobile/src/files/mobile-file-preview-editability.tsmobile/src/files/mobile-file-preview-navigation.test.tsmobile/src/files/mobile-file-preview-navigation.tsmobile/src/files/mobile-file-preview-request.test.tsmobile/src/files/mobile-file-preview-request.tsmobile/src/files/mobile-file-preview-response.tsmobile/src/files/mobile-file-preview-styles.tsmobile/src/files/mobile-file-tab-doc.tsmobile/src/files/mobile-video-preview-cache-file.test.tsmobile/src/files/mobile-video-preview-cache-file.tsmobile/src/session/mobile-artifact-kind.test.tsmobile/src/session/mobile-artifact-kind.tsmobile/src/session/mobile-session-route-types.tssrc/main/providers/filesystem-provider-contract.tssrc/main/runtime/orca-runtime-files.tssrc/main/runtime/orca-runtime.test.tssrc/main/ssh/ssh-filesystem-stream-reader.tssrc/relay/fs-handler-file-read.tssrc/relay/fs-handler-previewable-media.test.tssrc/relay/fs-handler-terminal-artifact.tssrc/relay/fs-handler-utils.tssrc/shared/runtime-types.tssrc/shared/video-file-extensions.ts
|
Both actionable comments are addressed in 22bfd68, and the description now follows the repo template (Screenshots / AI Review Report / Security Audit sections filled in). On the Docstring Coverage pre-merge warning (23.68% vs 80%): I would rather not act on that one. This repo's Screenshots from the simulator run are coming in a follow-up comment. |
|
@coderabbitai full review |
✅ Action performedFull review finished. |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
mobile/src/files/mobile-file-preview-styles.ts (1)
155-156: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRemove comments that restate the code.
mobile/src/files/mobile-file-preview-styles.ts#L155-L156: Remove this comment.contentFit="contain"andflex: 1show the behavior.mobile/src/files/mobile-file-explorer-row.tsx#L87-L88: Remove or reduce this comment.canPreviewMobileFileRowandclassifyMobileArtifactshow the behavior.As per coding guidelines, “Comments must be concise, non-obvious, and brief—prefer one line; do not explain obvious behavior or walk through how the code works.”
Source: Coding guidelines
src/main/runtime/orca-runtime.test.ts (1)
3687-3708: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winCover
.m4vand.movat the runtime boundary.Line 3687 tests only
.mp4, although the shared allowlist also exposes.m4vand.mov. Add cases for those extensions and assertvideo/mp4for.m4vandvideo/quicktimefor.mov. This verifies every new MIME mapping throughOrcaRuntimeService.Based on the PR objective, the feature must support
.mp4,.m4v, and.mov.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 0296c167-4c7b-42d2-bd5c-1903c34ffd6f
⛔ Files ignored due to path filters (1)
mobile/pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (30)
mobile/app/h/[hostId]/session/[worktreeId].tsxmobile/package.jsonmobile/src/files/MobileFilePreviewBody.tsxmobile/src/files/MobileFilePreviewScreen.tsxmobile/src/files/MobileFileVideoPreview.tsxmobile/src/files/file-tree.tsmobile/src/files/mobile-file-explorer-row.tsxmobile/src/files/mobile-file-preview-editability.tsmobile/src/files/mobile-file-preview-navigation.test.tsmobile/src/files/mobile-file-preview-navigation.tsmobile/src/files/mobile-file-preview-request.test.tsmobile/src/files/mobile-file-preview-request.tsmobile/src/files/mobile-file-preview-response.tsmobile/src/files/mobile-file-preview-styles.tsmobile/src/files/mobile-file-tab-doc.tsmobile/src/files/mobile-video-preview-cache-file.test.tsmobile/src/files/mobile-video-preview-cache-file.tsmobile/src/session/mobile-artifact-kind.test.tsmobile/src/session/mobile-artifact-kind.tsmobile/src/session/mobile-session-route-types.tssrc/main/providers/filesystem-provider-contract.tssrc/main/runtime/orca-runtime-files.tssrc/main/runtime/orca-runtime.test.tssrc/main/ssh/ssh-filesystem-stream-reader.tssrc/relay/fs-handler-file-read.tssrc/relay/fs-handler-previewable-media.test.tssrc/relay/fs-handler-terminal-artifact.tssrc/relay/fs-handler-utils.tssrc/shared/runtime-types.tssrc/shared/video-file-extensions.ts
|
Both nitpicks addressed in 59fc42a:
|
59fc42a to
3ce3ac2
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
|
Rebased onto current Two things came out of the rebase:
Re-verified after the rebase: desktop typecheck clean, Also worth noting against the |
Tapping an .mp4/.m4v/.mov in the mobile file explorer showed "unavailable" because every previewable binary the host returned claimed isImage, and RN has no player. Previews now report which media kind they carry, and mobile renders video with expo-video's native player (controls, scrubbing, fullscreen). The bytes are staged in the app cache before playback: AVPlayer and ExoPlayer cannot open a base64 data URI, and the file extension is what AVPlayer picks its demuxer from. WebM/MKV stay on the unavailable-binary path since iOS cannot decode them, same reasoning as the existing SVG exclusion. Videos above the 10MB previewable-binary cap still report "File too large for mobile preview". Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Only .mp4 was exercised through OrcaRuntimeService, so the .m4v alias and the .mov quicktime mapping were covered on the mobile and relay sides only. The test also cleans up its temp workspace. Drops two comments that restated the code. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Threading isVideo through the stream reader pushed the file past the 300-line lint ceiling once main's own growth landed. Collapse the four locals the metadata frame fills into a single result object, which removes the duplicated optional-field spreads at both success paths. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
3ce3ac2 to
fd37338
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
|
Rebased onto current
Re-verified on top of the rebase: desktop typecheck clean, Still three commits, no behaviour change from the rebase. Happy to squash if you would prefer a single commit. |
|
Closing as superseded by merged mobile playback #26148, alongside desktop playback #26120. The mobile implementation supports both video and music, uses bounded authenticated chunk downloads, and includes rebuilt iOS simulator validation and visual proof. ChangJun Park, Lirone Levy, dupi, and John Cusack are credited with Co-authored-by trailers in both merge commits. |
Summary
Videos (
.mp4,.m4v,.mov) can now be previewed in the mobile file viewer. Tapping one previously showed "Binary preview unavailable", because the host reported every previewable binary asisImageand React Native has no player component.How it works:
isVideoon the preview payload.files.readPreview/files.readTerminalArtifactPreview(and the relay'sfs.readFile/fs.readFileStream/fs.readTerminalArtifact) now report which media kind they carry instead of claiming everything previewable is an image.src/shared/video-file-extensions.tsis the single source for the container→MIME map, andisVideois threaded through the SSH stream reader and the filesystem provider contract so SSH worktrees behave the same as local ones.MobileFileVideoPreviewwrites the preview into the app cache and hands the file toexpo-video. The cache file's extension matters — AVPlayer picks its demuxer from it — and it is named after the source path so re-opening reuses one slot instead of leaking a copy per visit.Wired into both the file-preview route and session file tabs; the explorer row gate and icon were updated to match.
Screenshots
An
.mp4opened from the mobile file explorer, playing throughexpo-video's native player. The transport (play/pause, ±10s, scrubber), fullscreen, AirPlay and mute all come from the OS; a 16:9 video letterboxes inside the portrait pane viacontentFit="contain".Verified on an iOS 26.5 simulator against a real paired desktop runtime built from this branch (not a mock);
.movwas checked the same way.Testing
pnpm lint— oxlint clean on both projects (also enforced by pre-commit on every changed file)pnpm typecheck—tsconfig.node.jsonand the mobile project both cleanpnpm test— mobile 3047 pass; desktopsrc/main/runtime,src/main/ssh,src/main/providers,src/relaypass. The twosrc/relay/agent-exec-handler.test.tsfailures reproduce unmodified onmainand are unrelated to this change.pnpm build—build:cli+build:electron-vitesucceeded; that build is what the simulator test ran against.AI Review Report
Reviewed with Claude Code while building, focused on: the preview transport contract (does anything else key off
isImage?), SSH/relay parity, memory behaviour of multi-MB base64 payloads, and player lifecycle.isImagewas audited before addingisVideo, so no consumer silently treats a video as an image. The text/image narrowing in the mobile preview types was replaced with an explicitisMobileFilePreviewTextResultguard, which made the compiler point at each affected site.fs-handler-file-read,fs-handler-terminal-artifact) and the SSH stream reader carryisVideotoo, so SSH worktrees are not silently degraded. Relays predating this simply omit the flag and fall back to the existing unavailable-binary message.expo-file-system'sPaths.cacheon mobile andnode:path'sextname/joinon desktop. The desktop and relay changes are plain Node fs/path work with no OS-specific behaviour, so the host side behaves identically on all three.expo-videouses ExoPlayer there and MP4/M4V/MOV are within its supported containers, but I had no Android device in this session. Worth a second pair of eyes before merge if that matters.docs/STYLEGUIDE.md: the player pane uses existingmobile-themetokens (colors.editorSurface) with no new hex values, and the loading state reuses the shared previewstate/errorTextstyles. The mobile palette is dark-only, so there is no light-mode variant to check. Playback controls are the OS player's, so they match platform conventions by construction.isVideoflag is carried through the relay and the SSH stream reader, so an SSH worktree previews video the same way a local one does; a relay predating this simply omits the flag and the client falls back to the existing message. Under SSH latency the preview shows the normal loading state until the bytes land — the same behaviour images already have — and the cap keeps the transfer bounded.statof the path.Security Audit
resolveFileExplorerPath+resolveAuthorizedPath, and terminal artifacts keep their existing grant checks (O_NOFOLLOW, canonical-path and stat-identity verification) — video reads reuse those paths unchanged.stat(above), closing a TOCTOU that could have allocated an unbounded buffer.expo-video55.0.19, a first-party Expo SDK package matching the project's Expo version. No new network access, no new permissions, and its config plugin is not enabled (no background playback or PiP).Notes
expo-video(SDK 55) — a dev-client rebuild is required for anyone running this branch.isVideotoo; that path was covered by unit tests rather than a live SSH host.files.open, which opens a tab on the desktop, and the desktop editor has no video viewer. Left alone deliberately rather than opening a broken desktop tab.X / Twitter: @Lironedev
🤖 Generated with Claude Code