Skip to content

feat(mobile): upload files from the phone into a workspace folder - #51506

Merged
AmoabaKelvin merged 2 commits into
mainfrom
mobile-files-upload-ui
Nov 28, 2026
Merged

AmoabaKelvin merged 2 commits into
mainfrom
mobile-files-upload-ui

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Nov 28, 2026 •

Copy link
Copy Markdown
Collaborator

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.

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.
  • Folder workspaces and SSH-managed servers use the same host methods (feat(files): host methods to upload a file from the phone into a workspace folder #51195, tested there).

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)

@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Note

Reviews paused

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.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review

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: Passed 4

Check name Status Explanation
Title check Passed 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 Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed 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.

Share

Recent 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: 13126097-2c10-4b6b-a706-0ef3d19d6195
Commits

Reviewing files that changed from the base of the PR and between b2c1824 and 6230994.

Files selected for processing: 4

  • mobile/src/files/explorer/mobile-file-explorer-row-actions-sheet.tsx
  • mobile/src/files/explorer/mobile-file-explorer-rows.tsx
  • mobile/src/files/explorer/mobile-file-explorer-upload-rows.ts
  • mobile/src/files/explorer/use-mobile-file-explorer-uploads.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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.

Files selected for processing: 32

  • config/scripts/build/mobile-web-app/verify-mobile-web-app-bundle.mjs
  • mobile/src/files/explorer/MobileFileExplorerPanel.tsx
  • mobile/src/files/explorer/mobile-file-explorer-mutation-operations.ts
  • mobile/src/files/explorer/mobile-file-explorer-mutations.ts
  • mobile/src/files/explorer/mobile-file-explorer-name-sheet.tsx
  • mobile/src/files/explorer/mobile-file-explorer-row-actions-sheet.tsx
  • mobile/src/files/explorer/mobile-file-explorer-upload-progress.ts
  • mobile/src/files/explorer/mobile-file-explorer-upload-queue.ts
  • mobile/src/files/explorer/mobile-file-explorer-upload-row.tsx
  • mobile/src/files/explorer/mobile-file-explorer-upload-run.ts
  • mobile/src/files/explorer/mobile-file-explorer-upload.ts
  • mobile/src/files/explorer/use-mobile-file-explorer-actions.tsx
  • mobile/src/files/explorer/use-mobile-file-explorer-uploads.tsx
  • mobile/src/i18n/en-runtime-required.json
  • 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
  • mobile/src/platform/media-picking/media-picker-contract.ts
  • mobile/src/platform/media-picking/media-picker.web.ts
  • mobile/src/worktree/execution-hosts/use-route-capability.ts
  • src/main/runtime/rpc/server/runtime-rpc-mobile-method-routing.ts
  • src/renderer/src/components/right-sidebar/file-explorer/mutations/useFileDuplicate.ts
  • src/shared/file-access/files-runtime-capabilities.ts
  • src/shared/file-import/import-copy-name.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

@AmoabaKelvin
AmoabaKelvin force-pushed the mobile-files-upload-ui branch from 5eae283 to 359400d Compare November 28, 2026 06:32

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 12

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: 362a3b9d-d3a0-4ddd-83b6-a59034eb1d77
Commits

Reviewing files that changed from the base of the PR and between 5eae283 and 359400d.

Files selected for processing: 26

  • config/scripts/build/mobile-web-app/verify-mobile-web-app-bundle.mjs
  • mobile/src/files/explorer/MobileFileExplorerPanel.tsx
  • mobile/src/files/explorer/file-tree.ts
  • mobile/src/files/explorer/mobile-file-explorer-mutation-operations.ts
  • mobile/src/files/explorer/mobile-file-explorer-mutations.ts
  • mobile/src/files/explorer/mobile-file-explorer-name-sheet.tsx
  • mobile/src/files/explorer/mobile-file-explorer-row-actions-sheet.tsx
  • mobile/src/files/explorer/mobile-file-explorer-row.tsx
  • mobile/src/files/explorer/mobile-file-explorer-rows.tsx
  • mobile/src/files/explorer/mobile-file-explorer-upload-row.tsx
  • mobile/src/files/explorer/mobile-file-explorer-upload-rows.ts
  • mobile/src/files/explorer/use-mobile-file-explorer-actions.tsx
  • mobile/src/files/explorer/use-mobile-file-explorer-uploads.tsx
  • 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
  • src/main/runtime/rpc/server/runtime-rpc-mobile-method-routing.ts
  • src/shared/file-access/files-runtime-capabilities.ts
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.

@AmoabaKelvin
AmoabaKelvin force-pushed the mobile-files-upload-ui branch from 359400d to 4023dbe Compare November 28, 2026 07:46

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

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: 045e1156-6052-4837-9a75-d5d795f98cd8
Commits

Reviewing files that changed from the base of the PR and between 359400d and 4023dbe.

Files selected for processing: 1

  • mobile/src/files/explorer/mobile-file-explorer-upload-row.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@AmoabaKelvin
AmoabaKelvin force-pushed the mobile-files-upload-ui branch 3 times, most recently from 6230994 to 05013fa Compare November 28, 2026 11:16
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.
…ithout retry, and make the upload row's controls reachable
@AmoabaKelvin
AmoabaKelvin force-pushed the mobile-files-upload-ui branch from 05013fa to 2a3aa1e Compare November 28, 2026 11:45
@AmoabaKelvin
AmoabaKelvin merged commit 3564bbc into main Nov 28, 2026
28 checks passed
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