Repository navigation
#785 Worktrees setting and a collapsible project picker - #786
Merged
ivanfenenko merged 8 commits intoOct 22, 2026
Merged
Conversation
…rag handles
Bottom sheet headers take a trailing text action (Edit / Done) before Close;
header actions can be disabled and carry an accessibility identifier.
Overflow menu entries get an optional subtitle under the title. The expand
pill ("3 worktrees ⌄") shows or hides rows nested under a row. Reorderable
lists can start a drag from a leading handle and keep a trailing part whose
controls stay tappable. Gallery entries for each.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…sitory
Home display preferences gain showsWorktrees (key "showsWorktrees", on by
default, cleared with the other Home prefs). Home scopes resolve a worktree
scope to its project and row locations drop branches while it is off; a
project knows its main checkout directory.
The session repository moves a session with POST /api/session/{id}/move and
body {"directory": ...} on v2; v1 has no endpoint and throws. Capabilities
say whether the server can move sessions, and the event adapter reads the
new directory from session.moved.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
… picker Settings → Home → Worktrees switches Home's worktree presentation: off, rows show the project without branch or folder, the picker lists projects only, worktree scopes read as their project and New session never asks. Sessions of every worktree stay under their project either way. Tapping New session starts on the main checkout of the current project, or in the filtered worktree; in All it still asks which project. Holding it opens Run in for a multi-worktree project (with Other projects below), else the project list, where a multi-worktree pick opens its Run in list. The picker lists All and projects. A "N worktrees" pill expands one project's worktrees at a time, five at most before "Show all N". Edit collapses everything and reorders projects with drag handles; swipe-to-remove stays on project rows. The dock swipe walks All and projects only; from a worktree it steps out to its project or on to the next one. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Session Chat ⋯ → "Move to worktree…" lists the session's project worktrees in Home order with the current one checked. It stays visible but disabled with "Needs an opencode v2 server", "Turn on Worktrees in Settings" or "This project has no other worktrees". A move of a busy session says it applies after this turn; a failure shows the server's message. When session.moved arrives the chat rebinds to the new directory, so the header and directory requests follow; Home refetches on the same event and regroups the row. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…oject picker - Settings → Home → Worktrees (HomeDisplayPreferences.showsWorktrees, on by default). Off is presentation only: rows lose branch/folder, the picker and dock list projects only, worktree scopes resolve to their project, and New session never offers Run in. - Tap New session starts on the project's main checkout (or the filtered worktree); hold opens Run in for a multi-worktree project, with "Other projects" below it, or the project list. - Project picker variant A: "N worktrees" pill expands one project at a time, "Show all N" / "Show fewer" past five, Edit/Done reorders projects with drag handles, swipe-to-remove stays on project rows. - Dock swipe walks All and projects; a worktree scope sits inside its project. - Design system: bottom sheet header text action, overflow entry subtitle, reorderable row drag handle, worktrees pill. Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Session Chat ⋯ → "Move to worktree…" after Fork session, disabled with
"Needs an opencode v2 server" / "Turn on Worktrees in Settings" /
"This project has no other worktrees"; sheet lists the project's worktrees
in Home order with the current one checked.
- v2 POST /api/session/{id}/move {"directory": …} behind SessionRepository
(moveSession; v1 throws), gated by ServerCapabilities.supportsSessionMove.
A busy session shows "Moves to <title> after this turn."; failures show
"Couldn't move the session: <server message>".
- session.moved: Session Chat reopens the session in its new directory, and
Home patches the row's directory so it regroups at once.
- HomeProjectsSnapshot shares Home's grouped projects with Session Chat.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…-setting-collapsible-picker # Conflicts: # android/app/src/main/java/dev/opencode/mobile/ui/main/MainScreenViewModel.kt # android/app/src/main/java/dev/opencode/mobile/ui/sessionchat/SessionChatViewModel.kt # android/app/src/test/java/dev/opencode/mobile/ui/sessionchat/SessionChatViewModelTest.kt
13 tasks done
ivanfenenko
marked this pull request as ready for review
October 22, 2026 03:11
Session Chat answered v2 session.moved by replacing its route, which built a new ViewModel: the timeline reloaded, the scroll reset, and moves that landed while the new ViewModel was being created were lost (nine quick moves left the header on the wrong worktree). The open Session Chat now rebinds its directory in place. The transcript keeps its key (v2 scopes messages by session), so the timeline and scroll stay; the header identity, repo strip (seeded with Home's branch), composer (draft, model, commands, agents, file search, per-directory catalog), inbox, session status and commands follow the new directory. A route rebind that still names the old worktree keeps the new one, and Files, Review changes, tool groups and child sessions open in the current directory. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ivanfenenko
deleted the
feature/785-worktrees-setting-collapsible-picker
branch
October 22, 2026 08:32
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #780: worktrees become opt-in, and the project picker stays short however many worktrees a project has. Prototype variant A, on iOS and Android.
POST /api/session/{id}/movewith{"directory": …}(204). Session Chat and the Home row follow thesession.movedevent. The item always shows and is disabled with a reason: "Needs an opencode v2 server" (v1), "Turn on Worktrees in Settings", or "This project has no other worktrees".Checks
./gradlew :app:testDebugUnitTest :app:assembleDebug :app:assembleDebugAndroidTestpassed: 2513 tests, 0 failures, 1 skipped.session.movedupdating Session Chat and Home).dev(4d5965762e) and a live server:session.movedand nosession.updated.Evidence
Real apps against the real opencode v1 (1.19.1) and v2 (
dev) through the scenario harness, with one repo with 8 worktrees plus a second project. Screenshots and a results table are in the evidence comment on #785; the images are on branchevidence/785, harness data only. v2 was tested cold, right after a server restart.Issue
Fixes #785
Risks / Follow-ups
session.movedin place in the same ViewModel. The timeline and scroll stay, and the header and branch pill switch about 1 s after the tap (request trace: rebind requests start 250 ms after the event, and the transcript is not refetched). The old route replace also dropped moves that arrived while the new ViewModel started: after nine quick moves the header showed the wrong worktree. Now it ends on the right one. The composer reloads the model catalog for the new directory and falls back with "Selected model is unavailable" when that directory doesn't offer the model.showsWorktreeson iOS,shows_worktreeson Android (each follows its store's style).🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmithwith what you need.