You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(mobile): upload files from the phone into a workspace folder - #51506
On the phone you could look at a workspace's files but not add one. Now a folder's long-press sheet has Upload Here, and the Files bar has a + with Upload Files for the workspace root. Pick files on the phone and they show up inside that folder with a progress bar, then land in the workspace on the computer. If a name is already taken you choose Keep Both or Skip; nothing on the computer is ever replaced.
Files
Added
Deleted
Net
Test
0
0
0
0
Prod
29
$\color{#1a7f37}{\Huge{\mathbf{+}}}$1699
$\color{#cf222e}{\Huge{\mathbf{−}}}$113
$\color{#1a7f37}{\Huge{\mathbf{+}}}$1586
What Changed
Where: "Upload Here" is the first row of a folder's long-press sheet. The Files nav bar's menu is now a + with Upload Files, New File and New Folder, since the root has no row to long-press. Both open the system file picker (several files at once).
How the bytes move: picked files stay in the phone shell's cache, behind handles (native.media.pick('files')). The page streams one native.media.read (384 KiB) at a time straight into the host's staged upload (files.uploadBegin / files.saveChunk / files.uploadCommit, from feat(files): host methods to upload a file from the phone into a workspace folder #51195). Each shell read's base64 goes to the host unchanged, and the page never holds a whole file. The host keeps the bytes outside the workspace until the commit, and the commit never replaces a file.
Progress: each file appears at the top of its folder with a thin bar and "2.4 of 8.1 MB", the download bar's look and caption. The others say Waiting. Files go one at a time, and leaving Files doesn't stop the queue. When the pick is done, a toast names the folder and the folder refreshes.
Name taken: the host refuses, and a sheet offers Keep Both ("Saves as report copy.pdf", desktop's duplicate naming, shared with Duplicate) or Skip. Several clashes from one pick ask once, and that choice also covers clashes that come later in the same pick.
Problems stay on the row: a failed row says why and "Tap to retry", with × to dismiss. When the connection drops, rows say "Waiting for connection" and start that file over when it comes back, because the host drops a partial upload. A path switch mid-file (relay to LAN) restarts it, at most three times.
A commit that gets no answer is never guessed: the row says "Couldn't confirm the upload. Check the folder." and the folder refreshes. That row doesn't retry; × lets it go.
Shell limits: a file over the shell's 18 MiB staging cap gets a toast ("Files over 18 MB can't be uploaded from the phone yet."). A pick of more than 8 files gets "You can upload up to 8 files at a time." Files queued behind an upload are kept alive in the shell's cache while they wait. A stalled queue lets them go after the shell's five idle minutes, which frees the page's picked-file slots, and those rows end with "pick them again".
Gating: Upload is offered only when the route's host advertises files.upload.staged.v1; relayed routes also need the paired computer to forward it. The shell must also grant the media pick/read/release verbs. Older hosts and shells don't show it. No store build is needed: the shell already has these verbs, and this is OTA page code.
Why
The phone could only attach files to a chat, where they're stored outside the workspace. #51195 added host methods that stage an upload outside the worktree and commit it without replacing anything. This is the phone side, built from the approved design:
Rows in the tree, not a separate Uploads sheet: the tree shows where each file goes.
Streaming shell reads straight to the host: the existing chat-attachment path reads a whole file into page memory first. Here neither the page nor the host ever holds more than one chunk.
One queue for the page: a file keeps its place when Files closes and reopens.
No settling a commit with no reply: earlier versions tried to work out from the file's size whether it had landed. They could either report a refused file as uploaded or make a second copy. Asking the user to check is the only answer that can't do either.
Linked Issue
#31892: this adds uploading from the phone's Files browser. Downloading and sharing a workspace file is still to come.
Visual Proof
iOS simulator (iPhone 17 Pro, iOS 27.2, released 0.0.71 OTA shell) against orca serve built from this branch.
Light
Dark
Files today (main)
—
Folder sheet today (main)
Files: + in the nav bar
Root + menu
Folder sheet: Upload Here
Uploading: the file in progress and the next one waiting (dark: one already landed)
Name taken: Keep Both / Skip
Done (light: Keep Both made "copy"; dark: Skip)
Failure stays on the row (tap to retry, × to dismiss)
Over the 18 MiB shell cap
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
On the iOS simulator against a headless orca serve built from this branch, paired as a phone:
Upload Here on src with two files, one whose name was taken. The other landed byte-for-byte (sha256 matched the phone's copy). Keep Both saved quarterly-report copy.pdf with identical bytes; Skip left the host's quarterly-report.pdf untouched (its old contents still there). The toast named the folder, and the singular and plural forms both read right.
Upload Files at the root (three files): progress showed "1.2 of 8.1 MB" while the next file waited. All landed, and nothing (no .orca-upload-* file) was left beside them or in the host's staging folder.
Folder deleted on the host before the upload: the row showed the host's reason with Tap to retry. After restoring the folder, the retry landed the file. × dismissed a failed row and nothing was written.
A 20 MB file gave the 18 MB toast and nothing was sent.
Not run: Android (same page code; the shell verbs are shared), Windows and Linux hosts, relayed servers.
No unit test added: the behaviour is a page flow over real shell verbs and host methods, proven on the simulator above. The host's no-clobber and staging invariants are pinned by #51195's tests.
Performance
None when nothing is uploading: no timers, RPCs, shell reads or listeners, and the Files list gets back the same rows it had. During an upload, each 384 KiB chunk is one shell read and one host RPC, and it repaints only that file's row (progress has its own store), not the Files list. A keep-alive timer (every 2 min) runs only while a transfer is in flight and other files wait behind it. Each landed file refreshes its folder once, as New File and Rename do.
Risk
Level: Medium
The riskiest part is anything that writes into the user's workspace. The host refuses a taken name at begin and at commit, and nothing is in the folder until the commit, so a failed or abandoned upload leaves nothing behind. On the phone, the risk is the queue getting into a state the user can't leave: every non-uploading row can be dismissed, which frees its picked file. Older hosts and shells don't offer upload at all. The root menu's ⋯ became a + with Upload first; New File and New Folder are unchanged. Back out with a plain revert (OTA page code; no stored state).
AI Disclosure
Review
Agent skill upstream boundary
Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.
Notes
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Hosts: works for local, orca serve and SSH-managed servers, and folder workspaces, because the host methods resolve the workspace the same way other file writes do. Names show as the host has them; Windows hosts refuse a : in a name. SSH-provider workspaces aren't offered upload (the host refuses them, like other runtime file writes).
Relayed server: if it drops while the paired computer stays connected, uploads wait and resume when Files sees it back. With Files closed they resume on the next visit.
The shell refuses a whole pick if any file is over 18 MiB and doesn't say which, so "too large" is one message, not a row.
Checklist
This PR is small and focused
I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
I stated the risk: what could break, for whom, and how to back it out
Before/after screenshots or videos attached for UI changes, or N/A with reason
Self-reviewed for correctness, security, and performance
Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)
It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.
No actionable comments were generated in the recent review.
Walkthrough
The mobile file explorer adds create, rename, duplicate, delete, and upload actions. Staged uploads stream through RPC and appear in the explorer with progress, offline, failure, and conflict states. The changes also add route capability checks, copy-name generation shared with the renderer, and translations for explorer actions and upload messages.
Merge Risk: Low · previous review 62309
This adds phone-to-workspace uploads and explorer file operations. Ordinary flows look sound. Several edge-case concerns remain open: recovery after a lost reply, queue behavior across reconnects, and accessibility of the upload rows. They are mostly narrow and recoverable, so the merge is low risk with follow-ups worth tracking.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title 'feat(mobile): upload files from the phone into a workspace folder' matches the main change. The changeset adds phone-side staged uploads into workspace folders, including the Upload Here fo…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description check
The description follows the repository template closely. It fills in ELI5, What Changed, Why, Linked Issue (#31892, though it says the issue is the feature scope rather than a 'Fixes' link), Visual Pr…
Full details: Title check
Explanation
The title 'feat(mobile): upload files from the phone into a workspace folder' matches the main change. The changeset adds phone-side staged uploads into workspace folders, including the Upload Here folder action, the root + menu Upload Files entry, a serialized upload queue, progress rows, and clash handling. The title is specific and concise, and it omits only secondary parts such as the file create, rename, copy, and delete mutations.
Full details: Description check
Explanation
The description follows the repository template closely. It fills in ELI5, What Changed, Why, Linked Issue (#31892, though it says the issue is the feature scope rather than a 'Fixes' link), Visual Proof with before/after tables, Testing with manual simulator steps, Performance with a concrete explanation, Risk with level Medium and a revert path, and Notes. Gaps: the Testing checklist marks the automated-tests item as checked, but the text says no unit test was added, which is explained in the body, so this is acceptable. The AI Disclosure section is empty, and the template says to fill it in for non-team contributors. The lint/typecheck/test/build checklist item is unchecked, with a note that CI will cover it. The Linked Issue section uses 'Fixes #' with no number, and the author cites #31892 in prose instead of as a 'Fixes' link. The Review section is empty. These are minor, non-critical omissions.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 7
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
⚠️ Outside diff range comments (1)
Minor · Ignore expansion updates from an obsolete workspace scope. · MobileFileExplorerPanel.tsx:172
mobile/src/files/explorer/MobileFileExplorerPanel.tsx:172 Minor · Functional Correctness · Quick win
Ignore expansion updates from an obsolete workspace scope.
The new mutation callbacks can call this setter after an await. If a create starts in workspace A, the panel switches to B, and the user expands a folder in B, A's completion replaces B's expansion state with { scope: A, ... }. B then reads NO_FOLDERS and loses its expanded folders.
Check the current live scope before applying a captured setter. Ignore obsolete completions, but preserve updates for the current workspace.
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 0bc797dd-c0d7-4adf-a69e-b8e53c2e55fb
Commits
Reviewing files that changed from the base of the PR and between b807f1f and 5eae283.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
Files skipped from review as they are similar to previous changes: 11
mobile/src/i18n/locales/de.json
mobile/src/i18n/locales/en.json
mobile/src/i18n/locales/es.json
mobile/src/i18n/locales/fr.json
mobile/src/i18n/locales/ja.json
mobile/src/i18n/locales/ko.json
mobile/src/i18n/locales/pt.json
mobile/src/i18n/locales/ru.json
mobile/src/i18n/locales/tr.json
mobile/src/i18n/locales/zh-Hant.json
mobile/src/i18n/locales/zh.json
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Files gets Upload Here as the first row of a folder's long-press sheet, and a + menu
(Upload Files, New File, New Folder) for the workspace root. Picked files stay in the
shell's cache and stream one 384 KiB read at a time into the host's staged upload, so the
page never holds a whole file and nothing lands in the folder until the host commits it,
without replacing anything. Rows inside the folder show progress; a taken name asks Keep
Both or Skip; failures stay on the row. A commit that gets no answer is never retried or
assumed: the row asks the user to check and the folder refreshes. Gated on
files.upload.staged.v1 and on the shell's media verbs; the shell's 18 MiB cap still applies.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
On the phone you could look at a workspace's files but not add one. Now a folder's long-press sheet has Upload Here, and the Files bar has a + with Upload Files for the workspace root. Pick files on the phone and they show up inside that folder with a progress bar, then land in the workspace on the computer. If a name is already taken you choose Keep Both or Skip; nothing on the computer is ever replaced.
What Changed
native.media.pick('files')). The page streams onenative.media.read(384 KiB) at a time straight into the host's staged upload (files.uploadBegin/files.saveChunk/files.uploadCommit, from feat(files): host methods to upload a file from the phone into a workspace folder #51195). Each shell read's base64 goes to the host unchanged, and the page never holds a whole file. The host keeps the bytes outside the workspace until the commit, and the commit never replaces a file.files.upload.staged.v1; relayed routes also need the paired computer to forward it. The shell must also grant the media pick/read/release verbs. Older hosts and shells don't show it. No store build is needed: the shell already has these verbs, and this is OTA page code.Why
The phone could only attach files to a chat, where they're stored outside the workspace. #51195 added host methods that stage an upload outside the worktree and commit it without replacing anything. This is the phone side, built from the approved design:
Linked Issue
#31892: this adds uploading from the phone's Files browser. Downloading and sharing a workspace file is still to come.
Visual Proof
iOS simulator (iPhone 17 Pro, iOS 27.2, released 0.0.71 OTA shell) against
orca servebuilt from this branch.Testing
On the iOS simulator against a headless
orca servebuilt from this branch, paired as a phone:srcwith two files, one whose name was taken. The other landed byte-for-byte (sha256 matched the phone's copy). Keep Both savedquarterly-report copy.pdfwith identical bytes; Skip left the host'squarterly-report.pdfuntouched (its old contents still there). The toast named the folder, and the singular and plural forms both read right..orca-upload-*file) was left beside them or in the host's staging folder.Not run: Android (same page code; the shell verbs are shared), Windows and Linux hosts, relayed servers.
No unit test added: the behaviour is a page flow over real shell verbs and host methods, proven on the simulator above. The host's no-clobber and staging invariants are pinned by #51195's tests.
Performance
None when nothing is uploading: no timers, RPCs, shell reads or listeners, and the Files list gets back the same rows it had. During an upload, each 384 KiB chunk is one shell read and one host RPC, and it repaints only that file's row (progress has its own store), not the Files list. A keep-alive timer (every 2 min) runs only while a transfer is in flight and other files wait behind it. Each landed file refreshes its folder once, as New File and Rename do.
Risk
Level: Medium
The riskiest part is anything that writes into the user's workspace. The host refuses a taken name at begin and at commit, and nothing is in the folder until the commit, so a failed or abandoned upload leaves nothing behind. On the phone, the risk is the queue getting into a state the user can't leave: every non-uploading row can be dismissed, which frees its picked file. Older hosts and shells don't offer upload at all. The root menu's ⋯ became a + with Upload first; New File and New Folder are unchanged. Back out with a plain revert (OTA page code; no stored state).
AI Disclosure
Review
Agent skill upstream boundary
Notes
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
orca serveand SSH-managed servers, and folder workspaces, because the host methods resolve the workspace the same way other file writes do. Names show as the host has them; Windows hosts refuse a:in a name. SSH-provider workspaces aren't offered upload (the host refuses them, like other runtime file writes).Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)