Skip to content

feat: browse Host folders from the phone when the computer uses the system chooser - #2392

Merged
DoodleBears merged 2 commits into
mainfrom
claude/project-thread-gi4bet
Oct 20, 2026
Merged

DoodleBears merged 2 commits into
mainfrom
claude/project-thread-gi4bet

Conversation

@DoodleBears

Copy link
Copy Markdown
Contributor

Requested by Vain · project thread

Why the change

On a Host whose DSH picker is the OS folder dialog (Windows/macOS desktop), directoryPicker/list answers directory-picker/unavailable, so the phone's folder-grant sheet said "this computer uses the system folder picker" and only allowed typing a path. A Bot asking for a workspace from the phone was effectively blocked.

Modeled on T3 Code's filesystem.browse: the server lists directory names only, the phone navigates and picks, and the actual grant stays a separate confirmed step.

Issue / Discussion: none (project thread request).

Special things to note

  • Merge risk: additive and reversible (revert the commit). New read-only bridge method botharness/folderBrowse; the phone only calls it after DSH refuses. Security: the paired device already acts as the Host owner and can register any path with workspace/create, so browsing adds discoverability, not authority. The endpoint returns folder names/paths only (never files, sizes or contents), flags hidden folders (the phone hides them), caps at 500 entries, refuses relative paths and returns coded refusals (folder-browse/invalid-path|not-found|not-directory|denied). Review focus: packages/core/src/workspaces/folder-browse.ts and the fallback in apps/mobile/src/host/bot-settings.ts.
  • Also adds apps/mobile/src/ui/primitives/app-dialog-host.web.tsx: since feat(mobile): HIG and system-UI pass: glass sidebar, bottom search, chat soft edge, native dialogs and menus #2333 the Expo Web export crashed on load (resolveAssetSource.addCustomSourceTransformer from @expo/ui/jetpack-compose), which blocked every web screenshot journey. The web stub renders nothing, as the Android-only host already did off Android.
  • CLI parity: deepseekbot folder-browse [<path>], documented in docs/bot-cli.md / .zh.md, tested, and run against a live Host (listing, invalid-path, not-found).
  • Verification:
    • Automated: pnpm lint (incl. CLI parity, feature map, ci-plan), pnpm format:check, pnpm typecheck; vitest core folder-browse, bot-live-cli, bridge-rpc, plugin (73 pass); all mobile tests (936 pass).
    • Runtime: node scripts/e2e-mobile-folder-browse-web.mjs on an isolated Host with a real deepseek-v4.1-flash turn calling request_workspace_grant. The phone proxy answers directoryPicker/list with directory-picker/unavailable (this Linux Host's DSH lists folders natively, so the system-chooser case is simulated). Result pass: no typed-path fallback, home listed, subfolders only (no README.md, no .cache), Grant written on exactly the chosen folder.
    • Not run: native iOS/Android devices and the system font-size matrix (cloud session, no simulator). Windows drive listing is unit-tested with an injected win32 filesystem, not on a real Windows Host. Human QA on the Windows Host from the original report is needed.
  • CI test plan: affected. New e2e script is classified in scripts/verification-inventory.json and referenced from the workspace-request feature map.

Change outline

phone sheet ──directoryPicker/list──▶ DSH
     │  ◀── directory-picker/unavailable (system dialog Host)
     └──botharness/folderBrowse──▶ BotHarness Host: readdir → folders only
                                   {path, crumbs, entries, truncated, roots}
pick folder → workspace/create → confirm sheet → grantRequestApprove (unchanged)

Before (reported on the phone): "This computer uses the system folder picker and cannot list folders on the phone. Pick a registered folder or type the path."

After, Expo Web export at 390×844 (layout evidence, not native):

Light Dark
Home of the Host
Inside a folder, Other places
Confirm

UI reuses the existing sheet, SettingsRow, Crumbs and section headings; the only new UI is an "Other places" section (Home plus / or each Windows drive). A Host too old for folderBrowse keeps the typed-path fallback, whose copy now suggests updating DeepSeekBot.


Generated by Claude Code

…oser

DSH answers directoryPicker/list with directory-picker/unavailable on a Host
that opens the OS folder dialog, so the phone could only type a path. The Host
now lists folder names itself through botharness/folderBrowse (folders only,
hidden flagged, capped, coded refusals) and the phone falls back to it, with
Home and drives under "Other places". Adds `deepseekbot folder-browse`, a web
stub for the Android-only dialog host so the Expo Web export loads again, and
an e2e journey with a real model folder request.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GzQmtMAahcsx9doCNJgFLe
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GzQmtMAahcsx9doCNJgFLe
@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 12 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0e796c24-7332-4765-864a-4026d304dc3f
📥 Commits

Reviewing files that changed from the base of the PR and between 9540f76 and 5d4bf3a.

⛔ Files ignored due to path filters: 6
  • .github/pr-screenshots/mobile-folder-browse/1-browse-home-dark.png is excluded by !**/*.png
  • .github/pr-screenshots/mobile-folder-browse/1-browse-home-light.png is excluded by !**/*.png
  • .github/pr-screenshots/mobile-folder-browse/2-browse-folder-dark.png is excluded by !**/*.png
  • .github/pr-screenshots/mobile-folder-browse/2-browse-folder-light.png is excluded by !**/*.png
  • .github/pr-screenshots/mobile-folder-browse/3-confirm-dark.png is excluded by !**/*.png
  • .github/pr-screenshots/mobile-folder-browse/3-confirm-light.png is excluded by !**/*.png
📒 Files selected for processing: 23
  • .agents/skills/verify-deepseekbot/features/README.md
  • .agents/skills/verify-deepseekbot/features/workspace-request-write.md
  • apps/mobile/src/host/bot-settings.ts
  • apps/mobile/src/ui/chat/folder-picker-sheet.tsx
  • apps/mobile/src/ui/chat/workspace-sheet.tsx
  • apps/mobile/src/ui/primitives/app-dialog-host.web.tsx
  • apps/mobile/src/ui/strings.ts
  • apps/mobile/test/bot-settings.test.ts
  • apps/mobile/test/grant-request-card.test.ts
  • changes/2392-phone-folder-browse.md
  • docs/bot-cli.md
  • docs/bot-cli.zh.md
  • packages/core/src/bots/cli-live.ts
  • packages/core/src/bridge/methods.ts
  • packages/core/src/bridge/rpc.ts
  • packages/core/src/plugin.ts
  • packages/core/src/workspaces/folder-browse.ts
  • packages/core/test/bot-live-cli.test.ts
  • packages/core/test/bridge-rpc.test.ts
  • packages/core/test/folder-browse.test.ts
  • packages/core/test/plugin.test.ts
  • scripts/e2e-mobile-folder-browse-web.mjs
  • scripts/verification-inventory.json
  • 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

Comment @coderabbitai help to get the list of available commands.

@DoodleBears DoodleBears self-assigned this Oct 20, 2026
@DoodleBears
DoodleBears merged commit e3c7eba into main Oct 20, 2026
11 checks passed
@DoodleBears
DoodleBears deleted the claude/project-thread-gi4bet branch October 20, 2026 15:10
DoodleBears added a commit that referenced this pull request Oct 20, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

Copy link
Copy Markdown
Contributor Author

Android phone result: PASS with one UX finding (Xiaomi, Android 16 / HyperOS 3, isolated QA Host, deepseek-v4.1-flash), Host from this branch at 5d4bf3a

Screenshots: 2392-android-folders/phone (commit bcd5315)

Scene Files
Host home listing 1-home-{light,dark}.png
Folder view with Other places drives 2-drives-{light,dark}.png, 2b-folder-light.png
Confirm sheet 3-confirm-{light,dark}.png
Granted 4-granted-dark.png

The grant landed on the chosen empty test folder, then was revoked and the folder deleted.

Finding: tapping the "already registered on this computer" row at the top jumps straight to the confirm sheet. Pressing Back from there leaves the browser on the parent folder, and the primary button then grants that parent. During QA this granted the parent folder by mistake (test Bot on the isolated Host); it was revoked within a minute and nothing under it changed. Back should return to the folder the sheet was opened from, or the primary button should be disabled until a folder is picked again.


Generated by Claude Code

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.

2 participants