Skip to content

#780 Group worktrees under one project on Home - #781

Merged
ivanfenenko merged 12 commits into
mainfrom
feature/780-group-worktrees-by-project
Oct 21, 2026
Merged

ivanfenenko merged 12 commits into
mainfrom
feature/780-group-worktrees-by-project

Conversation

@ivanfenenko

@ivanfenenko ivanfenenko commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Home groups the folders you added by server project ID. Several worktrees of one repo are now one project on iOS and Android, on both v1 and v2 servers. Paths with project ID global (v1 non-git folders, and repos with no commit or remote) never merge.
  • Session rows show the branch with an inline icon, plus the worktree folder when it isn't the main checkout. This replaces the Mark worktree sessions on Home #700 worktree badge on Home. Non-git projects keep the path.
  • The scope picker lists each project's worktrees, and picking one narrows Home to that checkout. The dock keeps the project name and shows <branch> · <folder>. Swiping the dock walks All → project → its worktrees → next project.
  • New session starts in the selected worktree. In a project with several worktrees it asks where to run ("Run in").
  • Adding a path of a repo that is already on Home joins that project, with the message "Same repo as X. Showing it as a worktree there." Removing a project removes all of its paths. Add-project suggestions skip projects already on Home.
  • v1 parity fixes:
    • Worktrees come from GET /experimental/worktree; the app previously probed /experimental/workspace, which is a different feature.
    • Sessions in worktrees you never added load and update live.
  • Branch lookups: a v2 /api/vcs answer with no provider (cold server, or a non-git folder) counts as "not known yet". It is retried after 1s and 3s, and an older lookup can't overwrite a newer answer.
  • Design system: OpenCodeListItem subtitle segments can carry an optional inline icon on both platforms.

Checks

  • iOS: full unit target passed, 2374 tests in 238 suites. UI tests were skipped.
  • Android: ./gradlew :app:testDebugUnitTest :app:assembleDebug passed, 2470 tests. ktlintCheck reports no new violations in changed files.
  • Real app, both platforms, against real opencode v1 1.19.1 and v2 dev through the scenario harness: grouping, picker, worktree scope, Run in, join, non-git separation, live sessions from worktrees that were never added, and branches right after a server restart. Screenshots and a results table are in the evidence comment on Group worktrees under one project on Home #780.

Issue

Risks / Follow-ups

  • Separate clones with the same git remote share a project ID on the server, so they merge too. This matches the desktop app.
  • v1 only lists worktrees opencode has already opened. A git worktree add folder with no sessions doesn't show until it is used.
  • Android: after the process is killed, a saved project or worktree scope can show All for the first frame until grouping data reloads.
  • Creating and removing worktrees stays in Create worktrees from the apps #752.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith with what you need.

ivanfenenko and others added 12 commits October 21, 2026 11:12
/experimental/workspace is a different feature on v1 servers. The project's
sandboxes come from GET /experimental/worktree?directory= as a string array;
404 still means an older server with no extra worktrees.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Pure domain for Home: added paths whose project id matches (never "global")
merge into one project with its worktrees (main checkout first, then by
folder), plus All / project / worktree scopes and the git row subtitle
(project · branch · folder). Projects now carry the server name and the
canonical main checkout.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Home lists one project per repository: the scope picker indents its
worktrees (branch, main checkout or folder, session count), the dock reads
"All N worktrees" or "branch · folder", rows show the branch instead of the
path, and New session asks where to run for a multi-worktree project.
Adding a worktree of a repo already on Home joins it; removing the project
removes every member path.

v1: sessions of worktrees nobody added (main checkout included) are listed
once per project and refetched on the same session events as the added
paths. Branch names load per worktree behind the list.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
v1 probed /experimental/workspace, a different feature. List the project's
sandboxes from /experimental/worktree and put the main checkout first; a 404
on older servers means no extra worktrees.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Pure grouping by server project id (never "global" or unresolved), Home
scopes with worktree ids, and row location parts. v2 current project now
carries the canonical main checkout; projects carry their name.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A subtitle segment can carry a small mark (the branch icon) drawn in its
color. Gallery shows a Branch subtitle.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Home sections, scope picker, dock, and new session follow Home projects:
worktree rows under a project, branch and folder on session rows, a Run in
choice for multi-worktree projects, joining an already-added repository,
removing every member path. v1 lists sessions of worktrees that were never
added and keeps them live on the same session events.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Compose rejects an empty alternateText; use a zero-width space so screen
readers don't announce a replacement character.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Branch lookups ran in one sequential task per inventory pass and wrote
whatever came back, so a request from an earlier pass (cancelled or
answering late) could clear a branch a newer pass had loaded, and a failed
lookup was never asked again until pull to refresh.

Home now looks up each worktree directory on its own: only the newest
lookup of a directory writes, a failure keeps the known branch and retries
twice, and every inventory change asks for any worktree not yet answered.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Right after a v2 server starts, the first GET /api/vcs for a location
answers {"branch":{}} with no provider while VCS detection warms up; the
next call has the branch. Home took that first answer as "no branch", so
worktree rows stayed branchless until pull to refresh.

A v2 answer without a provider (and without a current branch) is now
unknown: Home keeps the last known branch and asks again after 1s and 3s,
then waits for the next inventory change or refresh, so folders the server
never detects stop asking.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Right after a v2 server (re)start, GET /api/vcs answers with an empty branch
and no provider until VCS detection settles, and Home treated that as "no
branch" until pull to refresh. Such an answer, or a failed request, is now
unknown: Home keeps the last known branch and asks again after 1s and 3s,
then waits for the next inventory change or refresh, so folders without git
stop asking. Only the newest lookup of a directory writes its branch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ivanfenenko ivanfenenko mentioned this pull request Oct 21, 2026
12 tasks done
@ivanfenenko
ivanfenenko marked this pull request as ready for review October 21, 2026 12:24
@ivanfenenko
ivanfenenko merged commit 7ba8b93 into main Oct 21, 2026
@ivanfenenko
ivanfenenko deleted the feature/780-group-worktrees-by-project branch October 21, 2026 13:21

This branch was previously deployed

2 inactive deployments
ios-release — f9ee0706 Deployed Oct 21, 2026 by ivanfenenko
android-release — f9ee0706 Deployed Oct 21, 2026 by ivanfenenko
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.

Group worktrees under one project on Home

1 participant