Repository navigation
Conversation
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. Walkthrough
🚥 Pre-merge checks | ✅ 2 | ❌ 3
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.
ℹ️ Recent review info
|
There was a problem hiding this comment.
Actionable comments posted: 5
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 5359e4bb-118a-4207-92ce-7b2d6a711b8b
📥 Commits
Reviewing files that changed from the base of the PR and between 3ad6b7e and da62fd053d0b5a077b0f9ec9fd4680da93aeed1e.
📒 Files selected for processing (39)
mobile/rpc-foundation/goldens/host-worktree-actions-pin-open-delete.jsonmobile/rpc-foundation/goldens/host-worktree-delete-refused.jsonmobile/rpc-foundation/goldens/matrix-host.worktree-actions-worktree.activate-1.jsonmobile/rpc-foundation/goldens/matrix-host.worktree-actions-worktree.rm-1.jsonmobile/rpc-foundation/goldens/matrix-host.worktree-actions-worktree.set-1.jsonmobile/src/components/AddProjectModal.test.tsxmobile/src/components/AddProjectModal.tsxmobile/src/components/NewWorktreeModal.test.tsxmobile/src/components/NewWorktreeModal.tsxmobile/src/components/NewWorktreeModalController.tsxmobile/src/components/new-worktree-modal-types.tsmobile/src/components/use-new-workspace-repositories.tsmobile/src/host-screen/host-screen-action-error.test.tsxmobile/src/host-screen/host-screen-header.tsxmobile/src/host-screen/host-screen-overlays.tsxmobile/src/host-screen/host-workspace-list.tsxmobile/src/host-screen/use-host-screen-controller.tsmobile/src/host-screen/use-host-screen-state.tsmobile/src/host-screen/use-host-worktree-actions.tsmobile/src/tasks/repo-add-project-operations.test.tsmobile/src/tasks/repo-add-project-operations.tsmobile/src/tasks/repo-add-project-reply-schema.tsmobile/src/tasks/workspace-create-timeout.tsmobile/src/test-support/rpc-recording/adapters/host-worktree-action-mount-adapters.tssrc/main/ipc/repos-create.test.tssrc/main/ipc/repos/repo-creation-handlers.tssrc/main/runtime/rpc/methods/repo.test.tssrc/main/runtime/rpc/methods/repo.tssrc/main/runtime/runtime-repository-clone-controller.test.tssrc/main/runtime/runtime-repository-clone-controller.tssrc/main/runtime/runtime-repository-registration-controller.test.tssrc/main/runtime/runtime-repository-registration-controller.tssrc/main/runtime/runtime-rpc/runtime-rpc-mobile-method-allowlist.tssrc/renderer/src/components/sidebar/clone-defaults.test.tssrc/renderer/src/components/sidebar/clone-defaults.tssrc/shared/git/repo-default-locations.test.tssrc/shared/git/repo-default-locations.tssrc/shared/protocol-version.tssrc/shared/rpc-contract/repo-params.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
| <BottomDrawer visible={visible} onClose={onClose} onAfterClose={fireHandoff}> | ||
| <AddProjectModalContent | ||
| key={session.openEpoch} | ||
| client={client} | ||
| onAdded={(repo) => { | ||
| handoffRef.current = repo | ||
| onClose() |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
🔎 Supported by static analysis
🏁 Script executed:
sed -n '1,280p' mobile/src/components/AddProjectModal.tsx
sed -n '1,140p' mobile/src/components/BottomDrawer.tsx
sed -n '1,280p' mobile/src/components/AddProjectModal.test.tsxRepository: stablyai/orca
Length of output: 18494
🏁 Script executed:
fd -i 'mounted-bottom-drawer|bottom-drawer' mobile/src/components mobile/src --type f
rg -n --glob '*.ts' --glob '*.tsx' 'AddProjectModal|onAfterClose|onHidden|handleHidden|visible=.*BottomDrawer|BottomDrawer' mobile/src/components mobile/src | head -220Repository: stablyai/orca
Length of output: 24185
🏁 Script executed:
cat -n mobile/src/components/mounted-bottom-drawer.tsx | sed -n '35,145p'
cat -n mobile/src/components/bottom-drawer-close-lifecycle.test.ts | sed -n '1,130p'
cat -n mobile/src/components/bottom-drawer-mount-state.ts | sed -n '1,80p'Repository: stablyai/orca
Length of output: 8870
Bind late completions to their submitting drawer session.
If the drawer closes while run() is pending, onAfterClose can consume an empty handoffRef before the RPC resolves. The late completion then stores its repository without another close transition. A later session can consume that stale repository. Block dismissal while busy, or associate each completion with its openEpoch and reject results from closed or earlier sessions.
| const reply = repoCloneRun.interpret( | ||
| await repoCloneRun.request( | ||
| client, | ||
| { url: cloneUrl.trim() }, |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- modal and clone references ---'
rg -n -C 5 --glob '!node_modules' --glob '!dist' 'repo\.clone|cloneUrl|AddProjectModal' mobile src . 2>/dev/null | head -240
printf '%s\n' '--- clone definitions and URL validation ---'
rg -n -C 4 --glob '!node_modules' --glob '!dist' 'clone\s*\(|cloneRepo|clone_url|cloneUrl|ssh://|git@|https?://|url.*clone|clone.*url' . 2>/dev/null | head -320
printf '%s\n' '--- tracked candidate files ---'
git ls-files | rg '(^|/)(AddProjectModal|.*repo.*|.*clone.*|.*project.*modal.*)' | head -160Repository: stablyai/orca
Length of output: 50371
🤖 get_repo_knowledge executed:
get_repo_knowledge stablyai/orca /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4/learnings /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4/conventions
Length of output: 23989
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- bound host repo RPC ---'
if [ -f src/main/runtime/rpc/methods/repo.ts ]; then
cat -n src/main/runtime/rpc/methods/repo.ts | sed -n '1,190p'
else
printf '%s\n' 'src/main/runtime/rpc/methods/repo.ts not found'
fd -i 'repo.ts' src mobile | head -40
fi
printf '%s\n' '--- RepoClone declaration ---'
rg -n -C 8 'type RepoClone|interface RepoClone|const RepoClone|RepoClone\s*=' src/shared mobile
printf '%s\n' '--- modal submit flow ---'
cat -n mobile/src/components/AddProjectModal.tsx | sed -n '80,130p'Repository: stablyai/orca
Length of output: 10403
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- cloneRepo definitions and calls ---'
rg -n -C 12 --glob '!node_modules' --glob '!dist' 'cloneRepo' src mobile
printf '%s\n' '--- git clone operation definitions ---'
rg -n -C 10 --glob '!node_modules' --glob '!dist' 'spawn.*clone|git.*clone|clone\s*:\s*|clone\(' src/main src/shared | head -260Repository: stablyai/orca
Length of output: 50369
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- clone controller binding ---'
rg -n -l --glob '!node_modules' --glob '!dist' 'class RuntimeRepositoryCloneController|RuntimeRepositoryCloneController|Invalid repository name derived from URL' src/main
printf '%s\n' '--- focused clone implementation ---'
rg -n -C 20 --glob '!node_modules' --glob '!dist' 'class RuntimeRepositoryCloneController|clone\s*\(.*url|Invalid repository name derived from URL|gitSpawnAfterWindowsEnvironmentReady' src/main/runtime src/main | head -360Repository: stablyai/orca
Length of output: 44939
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- runtime-repository-clone-controller.ts ---'
wc -l src/main/runtime/runtime-repository-clone-controller.ts
cat -n src/main/runtime/runtime-repository-clone-controller.ts | sed -n '1,260p'
printf '%s\n' '--- repo-clone-path.ts ---'
wc -l src/main/git/repo-clone-path.ts
cat -n src/main/git/repo-clone-path.ts | sed -n '1,220p'Repository: stablyai/orca
Length of output: 14464
Restrict mobile clone sources to HTTP and HTTPS. repo.clone accepts any non-empty string. The host derives a clone path, then passes the raw value to git clone, so ssh://, SCP-style git@host:path, and local paths can reach Git instead of being rejected. Validate the URL scheme before sending the RPC.
| label: 'Browse folder', | ||
| icon: FolderOpen, | ||
| hint: 'Existing Git repository or folder on this host', | ||
| onPress: () => setView('addExisting') |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
sed -n '81,247p' mobile/src/components/AddProjectModal.tsx
rg -n "repo\.add|addRepo|add.*Repo|Existing Git repository|Existing.*folder" src/main src/shared mobile/src | head -160Repository: stablyai/orca
Length of output: 21168
🏁 Script executed:
#!/bin/bash
printf '%s\n' '--- exact run symbol and imports ---'
rg -n -S "repoAddExistingRun|repo\.add|repo.add|addExisting" mobile/src src/main src/shared packages 2>/dev/null | head -240
printf '%s\n' '--- likely RPC definitions ---'
rg -n -S "AddExisting|add existing|existing.*path|path.*git|isGit|git.*repository|not a git|repository.*path" src/main src/shared mobile/src 2>/dev/null | head -240Repository: stablyai/orca
Length of output: 50369
🏁 Script executed:
#!/bin/bash
printf '%s\n' '--- mobile operation binding ---'
cat -n mobile/src/tasks/repo-add-project-operations.ts
printf '%s\n' '--- host repo RPC implementation ---'
rg -n -S "repo.add|function.*add|add.*repo|RepoPath|nested-repo-import|repo-creation" src/main/runtime src/main/ipc src/shared/rpc-contract | head -160
printf '%s\n' '--- likely implementation slices ---'
for f in src/main/runtime/rpc/methods/repo.ts src/main/ipc/repos/nested-repo-import-handler.ts src/main/ipc/repos/repo-creation-handlers.ts; do
if [ -f "$f" ]; then
echo "--- $f ---"
sed -n '1,240p' "$f"
fi
doneRepository: stablyai/orca
Length of output: 48036
🏁 Script executed:
#!/bin/bash
printf '%s\n' '--- runtime addRepo declarations and implementation ---'
rg -n -S "addRepo\s*[:=]|async addRepo|addRepo\(" src/main/runtime src/main | grep -v '\.test\.' | head -160
printf '%s\n' '--- local path registration ---'
rg -n -S "function addLocalRepoFromPath|const addLocalRepoFromPath|export .*addLocalRepoFromPath|isGitRepo\(" src/main/ipc/repos src/main/runtime | head -160Repository: stablyai/orca
Length of output: 12981
🏁 Script executed:
#!/bin/bash
printf '%s\n' '--- runtime repository registration controller ---'
sed -n '1,215p' src/main/runtime/runtime-repository-registration-controller.ts
printf '%s\n' '--- repo path contract ---'
sed -n '1,80p' src/shared/rpc-contract/repo-params.tsRepository: stablyai/orca
Length of output: 10601
Use repository wording for this action.
This row opens a host-path text field. It does not open a filesystem browser. The mobile repo.add call defaults to Git mode and rejects paths that are not existing Git repositories.
Rename the action to “Add existing repository” and change the hint to “Enter the absolute path of an existing Git repository on this host.”
| @@ -237,7 +237,7 @@ export function HostScreenHeader({ controller }: { controller: HostScreenControl | |||
| styles.embeddedToolbarIconButton, | |||
| connState !== 'connected' && styles.toolbarIconDisabled | |||
| ]} | |||
| onPress={actions.openNewWorktreeModal} | |||
| onPress={actions.openPlusActionSheet} | |||
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Update the accessible names for the new + action. Both buttons can now open choices for creating a workspace or adding a project, but screen readers still announce “New workspace.”
mobile/src/host-screen/host-screen-header.tsx#L240-L240: change the adjacent accessibility label to describe the general + action.mobile/src/host-screen/host-workspace-list.tsx#L199-L199: updateNewWorkspaceFabor pass an accessible label that describes the general + action.
📍 Affects 2 files
mobile/src/host-screen/host-screen-header.tsx#L240-L240(this comment)mobile/src/host-screen/host-workspace-list.tsx#L199-L199
| return workspaceDir | ||
| } | ||
|
|
||
| const separatorIndex = Math.max(trimmed.lastIndexOf('/'), trimmed.lastIndexOf('\\')) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Only parse backslashes as separators for Windows paths.
On POSIX, /home/li/orca\workspaces is a valid path with one literal-backslash segment. This code treats it as a workspaces suffix and returns /home/li/orca, so clone defaults can target the wrong parent. Use the same Windows-path predicate as normalizeRuntimePathForComparison, and add a POSIX literal-backslash test.
Source: Learnings
There was a problem hiding this comment.
ℹ️ No critical issues — a few minor suggestions inline.
Reviewed changes
Read the full 39-file diff at da62fd0.
- Shared default-location policy —
repo-default-locations.tsmovesgetDefaultCloneParentout of the renderer (verbatim) and addsresolveDefaultCloneDestination/resolveDefaultCreateProjectParent; the desktop clone-defaults module re-exports the shared helper and the local IPC create handler delegates to the shared resolver. - Host-side defaults —
RepoClone.destinationandRepoCreate.parentPathbecome optional (OptionalString), and the runtime clone/registration controllers resolve a host default when they are absent, so a phone never types a host path. - Mobile add-project — new
AddProjectModal(start rows plus clone/create/browse forms) backed by checkedrepo-add-project-operations; the+button routes through arepo.add-project-mobile.v1capability gate, and a successful add closes the sheet and hands the repo to the New workspace form from the drawer'sonAfterClose. - Tests/recordings — new host and mobile unit tests; the five worktree-action recordings repin
adapterSha256only.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| { | ||
| label: 'Browse folder', | ||
| icon: FolderOpen, | ||
| hint: 'Existing Git repository or folder on this host', |
There was a problem hiding this comment.
This hint (copied verbatim from the desktop start row) promises folder support, but the mobile Browse folder form sends only { path } — no kind — and the host validates it as a git repository and rejects a plain folder. Either trim the copy to Existing Git repository on this host to match what v1 actually supports, or send kind: 'folder' and gate it the way desktop does.
| // Why: repo.add/create/clone were desktop-only RPCs; mobile gates its Add project | ||
| // entry on this capability so an older host (no allowlisted methods, required | ||
| // destination/parentPath) never receives a call it would reject. | ||
| export const REPO_ADD_PROJECT_MOBILE_RUNTIME_CAPABILITY = 'repo.add-project-mobile.v1' as const |
There was a problem hiding this comment.
Every other runtime capability has a companion test asserting membership in RUNTIME_CAPABILITIES (e.g. src/shared/worktree/archive-failure-blocking-capability.test.ts). This one doesn't, so the constant could later be dropped from the array with nothing failing. A one-line test keeps the convention.
| 'repo.add', | ||
| 'repo.baseRefDefault', | ||
| 'repo.clone', | ||
| 'repo.create', |
There was a problem hiding this comment.
runtime-rpc-mobile-method-allowlist.test.ts is the suite that pins the mobile-reachable surface, but it isn't extended for these three methods. Adding a dispatch case for one of them (or a small assertion over the new entries) would pin the intent rather than leaving the allowlist change unverified.
There was a problem hiding this comment.
ℹ️ No new issues in this delta — the three earlier suggestions remain open.
This delta (commit 115d82d) is a test-only typecheck fix for the two runtime-controller store fakes: updateRepo now returns null, getAllWorktreeMeta returns {}, getWorktreeMeta returns undefined, setWorktreeMeta returns a filled-out WorktreeMeta, and getGitHubCache is added. No product behavior changes. The prior minor findings aren't repeated here; they're still open on the earlier review.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
115d82d to
619ecc4
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 84ac59bd-67b8-49b8-b215-a5dcea002376
📒 Files selected for processing (22)
mobile/rpc-foundation/goldens/host-worktree-refresh-stream.jsonmobile/rpc-foundation/goldens/live-worktree-name-stream.jsonmobile/rpc-foundation/goldens/matrix-host-worktree-refresh-runtime.clientevents.subscribe-1-1.jsonmobile/rpc-foundation/goldens/matrix-host-worktree-refresh-runtime.clientevents.subscribe-1-2.jsonmobile/rpc-foundation/goldens/matrix-host-worktree-refresh-runtime.clientevents.subscribe-1-3.jsonmobile/rpc-foundation/goldens/matrix-host-worktree-refresh-runtime.clientevents.subscribe-2-1.jsonmobile/rpc-foundation/goldens/matrix-live-worktree-name-runtime.clientevents.subscribe-1-1.jsonmobile/rpc-foundation/goldens/matrix-live-worktree-name-runtime.clientevents.subscribe-1-2.jsonmobile/rpc-foundation/goldens/matrix-live-worktree-name-runtime.clientevents.subscribe-2-1.jsonmobile/rpc-foundation/goldens/matrix-live-worktree-name-worktree.show-1.jsonmobile/rpc-foundation/goldens/matrix-live-worktree-name-worktree.show-2.jsonmobile/rpc-foundation/goldens/matrix-live-worktree-name-worktree.show-3.jsonmobile/src/components/AddProjectModal.tsxmobile/src/host-screen/host-project-added-handoff.test.tsxmobile/src/host-screen/host-screen-overlays.tsxmobile/src/host-screen/host-worktree-catalog-action-error.test.tsmobile/src/host-screen/use-host-screen-state.tsmobile/src/host-screen/use-host-worktree-actions.tsmobile/src/host-screen/use-host-worktree-catalog.tsmobile/src/test-support/rpc-recording/adapters/client-event-stream-mount-adapters.tsmobile/src/transport/use-worktree-resync.tsmobile/src/worktree/host-worktree-refresh.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- mobile/src/components/AddProjectModal.tsx
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
There was a problem hiding this comment.
ℹ️ No critical issues — one minor suggestion inline.
Reviewed changes
Re-reviewed the delta since the prior pullfrog review at 115d82d; the substantive change is 6ca1963 (fix(mobile): land Add project on the repo's default checkout).
- Add project lands on the default checkout —
handleProjectAddedawaits the refreshed catalog, finds the added repo's main worktree, and opens its session; a catalog with no main row for the repo leaves the user on the refreshed list. - Concurrent catalog fetches share the in-flight request —
fetchWorktreesnow returns the sharedPromise<Worktree[] | undefined>instead of resolving empty-handed, and the signature threads through the refresh/resync callers. - Recordings and tests — the five worktree-action goldens repin
adapterSha256only; new handoff and in-flight-sharing tests were added. The earlier115d82d → 619ecc4rebase delta was type-only.
ℹ️ Nitpicks
- The PR description still says a successful add opens the New workspace form with the repo preselected, but
6ca1963changed the landing to the default checkout. Worth updating so the description matches the code.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| useEffect(() => { | ||
| if (visible && preselectedRepo) { | ||
| // Why: this hook's effects run after useNewWorkspaceRepositories' own, so a repo | ||
| // just added from the phone overrides the last-visited default in the same commit. | ||
| upsertRepo(preselectedRepo) | ||
| } | ||
| }, [visible, preselectedRepo, upsertRepo]) |
There was a problem hiding this comment.
6ca1963 reroutes onProjectAdded to handleProjectAdded (which opens the default checkout) and nothing else calls openNewWorktreeModal(repo), so this preselection path is now unreachable in production: preselectedRepo is always null and upsertRepo never runs. Either remove the now-dead plumbing or wire it up as the fallback when the refreshed catalog has no main worktree for the added repo.
Technical details
# Unreachable add-project preselection plumbing
## Affected sites
- `mobile/src/components/NewWorktreeModal.tsx:80-86` — this `useEffect` calls `upsertRepo(preselectedRepo)`, but `preselectedRepo` is never supplied in production.
- `mobile/src/components/NewWorktreeModalController.tsx:42,48-51` — `preselectedRepo` state and the `open(repo)` argument; `openNewWorktreeModal` is only ever called with no argument (`use-host-worktree-actions.ts:80`, `host-screen-overlays.tsx:223`).
- `mobile/src/components/use-new-workspace-repositories.ts:36-52,110` — `upsertRepo` is only consumed by the unreachable effect above.
- `mobile/src/components/new-worktree-modal-types.ts:27` — `preselectedRepo` prop field.
- `mobile/src/components/NewWorktreeModal.test.tsx:544-582` — the new test feeds the prop directly, so it covers only the dead wiring.
## Required outcome
- The added repo still joins the New workspace list and is selected when that form is opened for it, OR the plumbing is deleted with the test that only exercises the prop.
## Suggested approach (optional)
- If the no-main-worktree case should fall back to the create form, call `openNewWorktreeModal(repo)` there instead of doing nothing; otherwise delete the controller state/prop/effect/`upsertRepo` and the prop-only test.df23e71 to
c7abcb3
Compare
c7abcb3 to
56cf81f
Compare
CI run: feat/mobile-clone-from-url tree (mirrors stablyai#21698)
…ion / create parent Move the clone-default-parent helper into shared code and add two host-side default resolvers (clone destination, create parent) that both the desktop IPC handlers and the runtime controllers now share, so mobile callers can omit destination/parentPath and get the same defaults the desktop flows use. repo.clone's destination and repo.create's parentPath become optional (a wire loosening), and a repo.add-project-mobile.v1 runtime capability is declared for mobile gating.
Add repo.add, repo.create, and repo.clone to the mobile RPC allowlist and let the runtime controllers resolve the clone destination and create parent from host settings when the caller omits them, so a paired phone can add a project (clone from URL, create empty, add existing path) without typing host paths. The desktop create-default IPC handler now delegates to the same shared policy.
541d198 to
ea104d4
Compare
ea104d4 to
a1509e1
Compare
…e + sheet The + button now opens a two-choice sheet — New workspace / Add project — mirroring the desktop + area's two buttons. Hosts without the repo.add-project-mobile.v1 capability skip the sheet and open the create form directly, as before. Add project mirrors the desktop start steps minus the SSH row: Browse folder (repo.add with a typed host path), Clone from URL (repo.clone with the host-side default destination, 10-minute budget), and Create new project (repo.create, git init + initial commit). A successful add closes the sheet and opens the New workspace form with the new repo upserted and selected — the handoff fires from the drawer's onAfterClose so iOS never presents two native modals in the same beat. The worktree-actions recording mount adapter passes no capabilities (hostCapabilities: []), so the + entry falls back to the create form in recordings, matching legacy hosts.
The standalone Add project flow opened the create-worktree sheet after a clone because it reused the composer-nested flow's continuation, which returns to the composer with the new repo selected. The desktop standalone Add project instead opens the added repo's default checkout (main worktree) session. Await the refreshed worktree catalog and find the repo's main worktree, then open its session; with no main row for the repo, stay on the refreshed host list. On upstream's query-backed catalog this awaits the refetch (joining any read in flight, then reading once more so the rows cannot predate the call), and the handoff plus the + sheet's openers live in host-project-admission-actions to keep the actions hook under the max-lines ratchet.
Upstream moved under this branch again: the low-value test sweeps deleted the five harness files this commit used to re-fit, and what survives is the Add project handoff test — its graph now reaches the host-catalog removal lifecycle and haptics (both stubbed), the actions hook reads the shared query client (the probe mounts inside a QueryClientProvider with a minimal connection surface), and its state fake carries the empty server-workspace list the handoff's session open consults.
…iled The awaited fetchWorktrees dropped the pre-rebase guards when it moved onto the query-backed catalog: it would fire a doomed read while the host is not connected, and a failed read answered with the cache's last good rows, which can predate the change the read was for — a weaker promise than the "confirmed rows" the handoff lands on. Skip the read while no client or the connection is down, and answer undefined when the query settled in error, so the handoff stays on the list exactly where it used to. Prove the join-then-read-again ordering (the rows cannot predate the call), the single idle read, and both stays-put answers with the catalog hook's first direct test — the ones covering the old in-flight dedup went with upstream's test sweeps.
…superseded The Add project flow first landed by opening the create-workspace sheet with the added repo upserted and selected; landing on the repo's default checkout replaced that path, but the plumbing stayed — openNewWorktreeModal's optional repo, the preselected sheet state, and upsertRepo's list-and-catalog write-through had no caller passing a repo anymore. Delete the chain outright rather than keep lines a reviewer must prove unused: the sheet still reopens on the last-visited default, and its own repo.list read now carries the added repo either way.
a1509e1 to
ae9d882
Compare
…ile-clone-from-url # Conflicts: # mobile/src/host-screen/host-screen-overlays.tsx # src/main/ipc/repos/repo-creation-handlers.ts
Absorbs 3254 upstream commits since the November merge. Conflict resolution: - shared layout moves followed upstream (execution-host/, repository/, repository/appearance/, orca-profiles/constants, file-access/) - the desktop default-create-project-parent helper replaced the deleted shared/git/repo-default-locations (registration controller, clone controller's defaultDestination, repo-creation handlers; the local wrapper was dropped in favor of the runtime helper) - mobile-runtime-capabilities keeps both the repo.add-project-mobile.v1 and notifications.push-coverage.v1 entries - host-screen keeps the Add Project entry (FolderPlus icon, handleProjectAdded) alongside upstream's row writes; en.json keeps both sides' strings - runtime-repository-registration-controller.test.ts kept (upstream deleted it in stablyai#46786's suite cut) with imports moved to the upstream layout: it holds the mobile repo.add/create host-side-defaults assertions this PR adds
…ith lazy schema wrappers
…en-when-offline primary
…clone-path imports







ELI5
On the phone, the + button used to jump straight into the "new workspace" form. Now it first asks what you want: a New workspace in a project the host already has, or Add project to bring a new project onto the host — clone it from a URL, create an empty one, or point at a folder that already exists on the host. After adding, you land in the new project's default checkout session, same as the desktop.
What Changed
Before: mobile's + opened the Create worktree sheet directly. The only way to get a new repository onto a paired host was the desktop app.
After: + opens a two-choice sheet — New workspace / Add project — mirroring the desktop + area's two buttons. Add project shows the desktop Add-project start rows minus SSH:
repo.add(it must be an existing git repository).repo.clone; the host picks the destination from its own default projects folder. Large clones get a 10-minute budget.repo.create; an empty git repository with an initial commit in the host's default projects folder.A successful add closes the sheet and opens the added repository's default checkout session (its main worktree) — the desktop standalone Add project's landing. The initial cut reused the composer-nested flow's continuation (
selectAddedProjectRepo, which returns to a composer with the repo preselected); follow-up commit6ca196383corrects the handoff: the phone awaits the refreshed worktree catalog (concurrent fetches now share the in-flight request instead of returning empty-handed), finds the repo's main worktree, and opens its session. If the catalog has no main row for the repo, the user stays on the refreshed host list.Mechanism, across the three commits:
shared: default clone destination / create parent resolution moved into a shared pure module (repo-default-locations);repo.clone'sdestinationandrepo.create'sparentPathbecome optional (a wire loosening — old hosts ignore nothing, new hosts resolve defaults). Desktop behavior is unchanged and now goes through the same shared policy.main:repo.add/repo.create/repo.cloneallowed for mobile runtime RPCs, and hosts advertiserepo.add-project-mobile.v1viastatus.getso old hosts never show a dead entry point.mobile: the + routes through a capability check — hosts without the capability keep the old one-tap behavior. The Add project sheet is a single BottomDrawer whose content swaps in place; the handoff fires from the drawer'sonAfterClose, so iOS never presents two native modals in the same beat; the follow-up commit redirects that handoff to the default-checkout session (above). The worktree-actions recording adapter gained thehostCapabilitiesargument, so the five goldens pinning its digest were repinned — their traces are byte-identical.Why
Mobile users could only create workspaces inside projects the host already knew; adding a repository meant walking to the desktop. The chooser and the three rows mirror the desktop Add project dialog (same labels, same copy, minus the SSH row mobile does not support) so there is one mental model across surfaces. Destination defaults resolve host-side, so the phone never needs to know the host's filesystem layout. Capability gating was chosen over showing the entry unconditionally so paired older hosts see exactly what they support.
Linked Issue
Fixes #21669
Visual Proof
UI change — screenshots/video from a paired phone are pending the integration build (this needs a fork host build + APK; manual E2E was deliberately sequenced after this PR in the design spec). The rendered structure is pinned by component tests (the three start rows with their desktop copy, per-form fields, busy/error rows).
Testing
repo-add-project-operations.test.ts— wire shapes (URL-only clone with the 10-min budget, name+kind create, path-only add), refusal surfacing, incompatible-reply rejection, create's soft-error arm.AddProjectModal.test.tsx— desktop start rows minus SSH; clone/create/add flows; the handoff fires only after the drawer'sonAfterClose; arepo.createsoft error renders in-sheet without closing; submit disabled until input.NewWorktreeModal.test.tsx— a repo the phone just added is upserted and selected over the last-visited default.onAfterCloserather than timers.AI Disclosure
Built with Claude Code (Anthropic), pair-directed by @dupi against the approved design spec (dudupii#7, v4).
Review
Start at
mobile/src/components/AddProjectModal.tsx(the sheet), thenuse-host-worktree-actions.ts(capability gate + handoff), thensrc/main/runtime/rpc/methods/repo.ts+src/shared/git/repo-default-locations.ts(host-side defaults).Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
ssh:*hosts for these flows — SSH destinations are recorded as out of scope in the spec.Checklist
N/Awith reason — pending integration build (stated above)pnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred) — lint/typecheck/tests run locally; build covered by CI🤖 Generated with Claude Code