Skip to content

Spec: mobile Add project entry (clone / create / add existing) from the + sheet #7

Open

Description

@dudupii

Problem Statement

On mobile, the + button goes straight to the Create-worktree sheet, which only creates git worktrees of repositories already registered on the paired host. There is no way to bring a new repository or folder onto the host from the phone: pasting a GitHub URL into the source field just smart-matches known repos and dead-ends at "No results found."

On desktop, the + area exposes two actions — New workspace and Add project — and Add project opens a start screen with several ways to add (browse an existing local folder, clone from URL, create a new empty project, open from an SSH host). Mobile has only the first action; the entire add-project surface is missing. Starting work on a new repository from the phone therefore requires the desktop or a host terminal.

Solution

Split the mobile + button into a two-choice sheet that mirrors the desktop + area:

  • New workspace — exactly the current mobile behavior: the Create-worktree sheet.
  • Add project — a start screen mirroring the desktop Add-project start screen minus the SSH row:
    • Browse folder — add an existing host directory by typing its path.
    • Clone from URL — paste a repository URL; the paired host clones it (host-side default destination).
    • Create new project — name a new empty project; the host creates it (host-side default parent, Git-initialized like desktop).

When any of the three finishes, the new project is selected in the sheet and the flow continues with naming the worktree — the same continuation as the desktop composer ("after adding a project the next step is naming the worktree").

User Stories

  1. As a mobile user, I want + to offer both New workspace and Add project, so that the phone exposes the same two actions as the desktop + area.
  2. As a mobile user, I want choosing New workspace to open the Create-worktree sheet exactly as before, so that the common flow gains no friction beyond the choice itself.
  3. As a mobile user, I want the Add project screen to offer Browse folder, Clone from URL, and Create new project, so that all desktop ways of adding a local project (minus SSH) work from the phone.
  4. As a mobile user, I want to paste a GitHub repository URL and confirm, so that I can clone a brand-new repository without touching the desktop.
  5. As a mobile user, I want a confirmation step showing the URL and the derived repository name before the clone starts, so that I can catch a mis-pasted URL before any network work happens.
  6. As a mobile user, I want the clone to run on the paired host, so that the repository lands next to my other repos with the host's git credentials and configuration.
  7. As a mobile user, I want the host to pick a sensible default destination for clones and a default parent for new projects (the same policies as the desktop flows), so that I never have to type host filesystem paths unless I choose Browse folder.
  8. As a mobile user, I want to add an existing host folder by typing its path, so that projects already on the host can be registered from the phone even without a host file browser.
  9. As a mobile user, I want to create a new project by typing just a name, so that an empty Git-initialized project is one field away, exactly like desktop's Create new project.
  10. As a mobile user, I want the Add project entry hidden when my paired host is an older version without mobile add-project support, so that I never see actions that would just error.
  11. As a mobile user, I want a spinner with elapsed time while the clone runs, so that I know the request is alive during a large clone.
  12. As a mobile user, I want the clone to be allowed up to ten minutes, so that large repositories over slow links don't fail an arbitrary timeout.
  13. As a mobile user, I want a clear error message in the sheet when an add fails (bad URL, auth required, path missing, name taken), so that I can fix the cause and retry.
  14. As a mobile user, I want a repeated clone of the same URL to return the already-cloned repository instead of failing, so that an accidental double-tap is harmless.
  15. As a mobile user, I want the added project selected in the sheet when the operation finishes, so that I continue straight into naming the worktree, exactly like the desktop composer.
  16. As a mobile user, I want the added project to appear in my host's project list, so that future sessions find it without re-adding.
  17. As a mobile user pairing to an older host, I want the rest of the app to work exactly as before, so that the feature addition cannot regress existing flows.
  18. As a desktop user, I want the existing Add Repo flows unchanged, so that my desktop workflow is unaffected by the mobile entry.
  19. As a desktop user on an updated host, I want my explicit clone destination and create parent to keep being honored, so that the new default-resolution behavior never overrides a caller-provided path.
  20. As a GitLab user, I want GitLab repository URLs to work in the same paste-and-clone flow, so that the feature is provider-neutral.
  21. As a host operator, I want mobile-initiated adds to reuse the same in-flight path locking and cleanup discipline as desktop ones, so that concurrent or interrupted operations cannot corrupt the repo catalog.

Implementation Decisions

  • Reuse the existing runtime RPC methods repo.clone, repo.create, and repo.add rather than adding new ones; mobile gains access via three new mobile-allowlist entries.
  • repo.clone's destination and repo.create's parentPath become optional. When absent, the host resolves defaults with the same policies as the desktop flows (clone: effective workspace directory with a trailing workspaces segment stripped, falling back to the home-based default projects directory; create: the desktop create-flow default parent). The default helpers move to shared code so desktop and host use one implementation. repo.add is unchanged — its path is the user's typed input.
  • One new runtime capability string (style: repo.add-project-mobile.v1) is advertised through the existing status probe; mobile gates the Add project entry on it. Mixed versions are safe: an older host never advertises the capability, so the entry stays hidden and the methods are never called.
  • Clone rides the existing ten-minute long-workspace-operation timeout budget from the mobile client; create and add are fast local operations and use the standard request timeout. The host imposes no request deadline (unchanged).
  • Create follows the desktop create step: Git-initialized (kind: git), blocked when Git is unavailable on the host (the already-allowlisted repo.gitAvailable probe powers this on mobile).
  • Cloning remains idempotent by path: an existing repo at the derived clone path is returned rather than duplicated, which also makes an accidental retry safe.
  • After a successful add the new project is inserted and selected in the sheet (desktop selectAddedProjectRepo parity) and the user continues naming the worktree; the existing reposChanged/worktreesChanged pushes keep host catalog and mobile lists converged.
  • Progress reporting in v1 is indeterminate (spinner + elapsed timer); no streaming progress frames.
  • SSH-host projects and destinations remain refused/excluded by the existing runtime guards and the entry list; everything lands on the paired host's local filesystem.
  • Wire compatibility: loosening required fields to optional plus a new capability string; no protocol-version bump, per the remote wire compatibility rules.

Testing Decisions

  • Good tests assert external behavior at the RPC boundary (params sent, result/error shape, timeout budget) and user-visible behavior (entry visibility, navigation after add), not implementation details.
  • Host side: unit tests for the default resolvers (workspace-dir variants, fallbacks, no-default error) and for the clone and create controllers' default paths (existing-repo idempotency retained); the mobile-allowlist guard test automatically covers the new mobile calls.
  • Mobile side: fake-RPC-client tests (pattern of the existing worktree-create retry tests) asserting clone omits destination, create omits parentPath, and the long clone timeout is passed; pure-logic tests for the entry gating on the capability; component render tests for the + chooser, the Add project screen, and each form following the existing modal test pattern.
  • The renderer's clone-default tests continue to pass against the relocated shared helper.

Out of Scope

  • The desktop Add-project SSH row ("Project on SSH host"): opening or cloning onto SSH execution hosts from mobile (the runtime guards keep refusing ssh:* targets).
  • A host filesystem browser for Browse folder: v1 accepts a typed path only.
  • Nested repository import (desktop browse's folder-with-many-repos scan) from mobile.
  • Streaming clone progress (phase/percent frames).
  • Editing the clone destination or create parent path on mobile.
  • Auto-opening the added project's default checkout session instead of continuing in the sheet (that is the desktop sidebar Add Repo behavior; the composer-integrated path is the parity target here).
  • Creating folder (non-git) workspaces from mobile.
  • A paste-no-match "Clone" row inside the workspace-creation source drawer (rejected: desktop routes add-project through its own start screen, not the source field).

Further Notes

  • Upstream feature request: [Feature]: Mobile - clone a new repository from a GitHub URL stablyai/orca#21669. The implementing branch is feat/mobile-clone-from-url on this fork; the upstream PR will reference both.
  • A personal integration branch (personal/android) merges this feature with the pending slash-command feature for the user's own APK/desktop builds; that branch is not part of this spec.
  • Design revisions (2026-09-19): v2 a dedicated header button; v3 an "Add project" row in the + sheet's Project picker (mirroring the desktop composer's picker footer row); v4 — final — a two-choice + sheet mirroring the desktop + area's two actions, with the Add project screen mirroring the desktop Add-project start screen minus the SSH row. v4 supersedes v3's picker-row entry; the picker row may return later as a convenience alias.

Activity

  1. added
    ready-for-agent
    on Sep 19, 2026
  2. changed the title [-]Spec: mobile clone-from-URL entry in the new-workspace sheet[/-] [+]Spec: mobile Add project entry (clone / create / add existing) from the + sheet[/+] on Sep 19, 2026
  3. dudupii commented on Sep 20, 2026

    @dudupii
    OwnerAuthor

    Design amendment (2026-09-20): v4's post-add continuation ("insert + select the new repo in the sheet and continue") was the wrong desktop parity — that path (selectAddedProjectRepo) belongs to the composer-nested Add project, which returns to a composer. The desktop standalone Add project lands on the added repo's default checkout session. Follow-up commit 6ca196383 (PR stablyai#21698) corrects the mobile handoff: await the refreshed catalog, open the repo's main worktree session; with no main row, stay on the refreshed list.

    🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions