Repository navigation
Description
Problem or use case
In the Orca Mobile app (iOS / Android), tapping the floating + button (NewWorkspaceFab) opens NewWorktreeModal, which only lets users create a worktree inside repositories that have already been imported on the connected desktop/relay host (repo.list).
If a user connects to their host from mobile and wants to start working on a repository or folder that exists on the host's filesystem but has not yet been added to Orca's project list (or when the host currently has zero imported projects and shows "No projects found"), there is no way to browse the host's directories and register a new project from the mobile client.
Proposed solution
Add a host directory browser (HostDirectoryBrowserDrawer) to the mobile NewWorktreeModal flow, reusing the existing workspace-scoped host RPCs (files.browseServerDir and repo.add):
- Entry points in
NewWorktreeModal:- Add a
+ Add projectfooter action inside the Project picker (PickerListDrawer). - Show an
Add projectaction button directly inNewWorktreeFormSheetwhen the connected host has no imported projects (!hasRepos), or allow opening the project picker / directory browser.
- Add a
- Cross-platform host directory browsing (
files.browseServerDir):- Open at the host user's home directory (
~). - Support navigating into subdirectories, going up to the parent directory (
..), jumping back to~, and typing/filtering paths directly. - Respect the
pathFlavor: 'win32' | 'posix'field returned byfiles.browseServerDirusing pure string path utilities (mobile/src/components/host-directory-browser-paths.ts— nonode:pathdependency in the React Native bundle). On Windows hosts (win32), navigating up from a drive root (C:\) requests'/', which triggers the host'slistWindowsDrives()so users can switch between mounted drives (C:\,D:\, etc.).
- Open at the host user's home directory (
- Registering and selecting the project (
repo.add):- Allow choosing project kind (
gitrepository or plainfolderworkspace, defaulting togit). - Call
repo.add({ path: resolvedPath, kind }), upsert the returnedMobileWorkspaceRepointo the mobile repository state + cache, auto-select it, and return to the New Workspace form sheet.
- Allow choosing project kind (
Alternatives or additional context
- Existing host capability: Both
files.browseServerDir(src/main/runtime/rpc/methods/files.ts) andrepo.add(src/main/runtime/rpc/methods/repo.ts) already exist on the host withpermission: 'workspace', which paired mobile clients already hold, and already support Windows drive enumeration (listWindowsDrives) as well as POSIX paths on macOS/Linux/SSH relays. No backend RPC or wire breaking changes are needed. - Alternative considered: Requiring users to type a raw absolute host path in a text box without directory browsing. Rejected because typing full host paths on a phone keyboard is error-prone and requires knowing the exact directory layout across Windows/macOS/Linux hosts.
Activity