Repository navigation
New session: draft first, pick project and worktree, create on send - #1005
Merged
Merged
Conversation
A caption, one rounded card of label-over-value rows with icon tiles that open pickers, and a middle-truncated path footnote. Keeps one phone width on wide windows; compact rows while the keyboard is up. Gallery entry included. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Binding the placeholder session no longer creates anything on the server. Session Chat shows the draft: a "New session" header, the Run session in card (Project, Worktree, Starts from for a new v2 worktree) with its project, worktree and base-branch sheets, and a live composer. The first send creates the new worktree (v2 from the chosen base, v1 from the checkout; the server names it), then the session in that checkout, seeds its model, promotes the screen to it and sends the prompt through the normal path. A failure keeps the draft and shows the error with Retry; a retry reuses what was already created. NewSessionDraftStore keeps one draft per Connection Profile in memory: text, attachments, model/agent/variant, project and place. Leaving an empty draft drops it; Discard draft (overflow menu) clears it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Home's New session (dock tap and Ctrl+N), the Worktrees screen's New session here, Ctrl+N and /new in Session Chat all open the draft. The profile's draft wins; a fresh one starts in the Home filter's project or worktree, or where the most recent session runs in All. New session here keeps the draft's text and runs in that worktree. The hold gesture, Home's New session / Run in sheet and its eager New worktree create are gone. The draft's Add project… opens Home's Add project flow, and the project it adds becomes the draft's. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A New session draft creates its worktree on the first send and lets the server pick the name, so the create request's name is optional and the v1 and v2 bodies omit it when nil. Co-Authored-By: Claude Opus 5.5 <[email protected]>
NewSessionDraft holds what a New session has before it exists on the server: text, attachments, model pick, project and place (Local, an existing worktree, or a New worktree with its base). NewSessionDraftStore keeps one per Connection Profile in memory only; a draft with text or attachments wins when New session opens again, a place alone is not kept. NewSessionDraftStart holds the starting-place rule. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A caption over one rounded card of two-line rows (icon or letter tile, small label, bold value, chevron) with inset dividers and a muted middle-truncated path under it. Keeps a 340 pt width on wide screens and tightens with the keyboard up. Gallery entry and previews included. Co-Authored-By: Claude Opus 5.5 <[email protected]>
New session now opens Session Chat at once as a draft: nothing is created on the server until the first send. The draft shows a centred "Run session in" card (Project, Worktree, Starts from on v2) whose rows open their own bottom sheets, a "New session / Draft · created when you send" header, and only Discard draft in the overflow menu. The first send creates the worktree (New worktree, server-named, v2 from the chosen base), then the session in that checkout, seeds its model, promotes the screen in place and sends the prompt through the normal path. A failure keeps the draft and offers Retry; a worktree that was already created is reused. The draft lives in memory per Connection Profile: Back or backgrounding keeps it, New session restores it, a successful send or Discard draft clears it. Home's dock tap, Cmd-N, /new and Worktrees "New session here" open it; the New session hold gesture, the Home New session / Run in sheet and its eager New worktree path are gone. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…os' into feature/1004-new-session-draft
Android takes the iOS key names, keeps the three strings iOS still uses, and iOS drops the Home keys and helpers nothing uses any more. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…v2 (iOS) The draft area already sits above the keyboard, so adding the overlap again pushed the card under the header. The draft also read the stored protocol, which is unset until probed, so v2 lost Starts from and the chosen base branch; it now probes once when the draft opens. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Collaborator
Author
ivanfenenko
marked this pull request as ready for review
November 9, 2026 14:09
There was a problem hiding this comment.
Automated review: no finding that 2+ of 2 passes agreed on.
6 finding(s) from a single pass, not posted
android/app/src/main/java/dev/opencode/mobile/ui/sessionchat/SessionChatViewModel.kt:2024medium: Add project… from a content-less draft is swallowed: the popped draft screen's onCleared drops the pending add-project request (glm-5.3-flash)ios/OpenCode Mobile/OpenCode Mobile/UI/SessionChat/NewSessionDraftPresentation.swift:203medium: Worktrees setting off still shows and uses a stored draft's worktree / New worktree place (deepseek-v4.1-flash)ios/OpenCode Mobile/OpenCode Mobile/UI/SessionChat/SessionChatViewModel.swift:2213medium: Every draft screen writes the shared per-profile draft with no ownership, so a stale screen overwrites newer edits (deepseek-v4.1-flash)android/app/src/main/java/dev/opencode/mobile/ui/sessionchat/SessionChatViewModel.kt:2013low: discardNewSessionDraft leaves newSessionDraft set, so publishUiState re-renders the discarded draft card (glm-5.3-flash)ios/OpenCode Mobile/OpenCode Mobile/UI/SessionChat/Region/SessionChatComposer.swift:205low: composer.promoteDraft switches to the created worktree without reloading its commands, agents or selection context (glm-5.3-flash)android/app/src/main/java/dev/opencode/mobile/ui/sessionchat/SessionChatViewModel.kt:2118low: v2 base branch silently ignored when the stored protocol hint is unset (deepseek-v4.1-flash)
opencode pr-review · passes: muse-spark-1.3-contributor, glm-5.3-flash, deepseek-v4.1-flash · $0.177 · 1 pass(es) stopped early · 1 pass(es) failed
Keep both sides in Session Chat: the draft's Retry action (#1004) and the "Still sending…" stall Retry from #1003 share the snackbar. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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
/newall open the draft.RunSessionInCardon iOS,OpenCodePickerCardon Android) with gallery entries. String keys shared across platforms.Checks
./gradlew :app:assembleDebug :app:assembleDebugAndroidTest :app:testDebugUnitTestpass.xcodebuild test -only-testing:"OpenCode MobileTests"pass (3378 Swift Testing + 124 XCTest).node scripts/check-string-keys.mjspasses;gitleaksfinds nothing.Evidence
Screenshots in the evidence comment.
Issue
Fixes #1004
Risks / Follow-ups
🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.