Skip to content

feat(native): hand a PR off from Pulls without leaving it - #935

Merged
omartelo merged 2 commits into
mainfrom
feat/pulls-handoff-stays
Oct 24, 2026
Merged

omartelo merged 2 commits into
mainfrom
feat/pulls-handoff-stays

Conversation

@omartelo

@omartelo omartelo commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Resolve conflicts and Fix CI errors in Pulls used to switch the window to the session they hand the pull request to. Now Pulls stays on screen, so the next pull request is one click away:

  • The session is recorded and its card loads in the sidebar without becoming the active one.
  • The window starts its process off screen. A session's terminal otherwise spawns only on its first view, so an unseen session would never reach a prompt. spawnGate.unseen takes the same decision that first view would (live, plain, resume, fresh). When the gate needs the user (the resume prompt, a checkout gone), the session comes up as before.
  • Once the prompt lands, a toast "Handed #N to " offers Open. The "handoff lost" toast carries Open too in this flow.
  • The busy state ends when the session is born, not after the wait for its prompt, so the button of the next pull request is free.
  • Send to session on review threads (feat(native): send a pull request's review threads to its session #936) goes through the same handoff (handOffPR), with Open on its toasts. Its busy state still lasts until the threads are recorded as waiting, so a second click cannot send them twice.
  • Open in Session (no prompt) still brings the session up.

addWorktreeSession and showNewSession now split recording or loading a session from putting it on screen, and submitAtPrompt splits into handOff (the error) and the toast.

New key pulls.pulls.handedOff in every locale. CHANGELOG entry under Unreleased › Changed.

Test plan

  • TestHandoffLeavesThePullsScreenUp: Start and Submit reach the backend, Pulls stays open, the session is not made active.
  • TestOpenSessionBringsTheSessionUp: no prompt hides Pulls and activates the session.
  • TestUnseenSpawnsWhatTheFirstViewWould: every gate verdict, and no resume prompt raised.
  • TestSendThreadsLeavesThePullsScreenUp: Start, Submit and AwaitThreadFix reach the backend, Pulls stays open, the session is not made active.
  • New tests -race -count=100 green.
  • native/: gofmt, go vet, go test ./... green.

Resolve conflicts and Fix CI errors no longer bring up the session they
hand the pull request to. The window spawns it off screen through the
spawn gate's own decision, sends the prompt, and raises a toast with Open
once it lands. A spawn that needs the user (the resume prompt, a checkout
gone) still brings the session up. The busy state ends when the session
is born, so the next pull request's button is free.
Send to session goes through the same handoff as Resolve conflicts and
Fix CI errors: the session spawns off screen unless its spawn needs the
user, and the toasts carry Open. Its busy state still lasts until the
threads are recorded as waiting, so a second click cannot send them twice.
@omartelo
omartelo force-pushed the feat/pulls-handoff-stays branch from a6b4e65 to 41365ae Compare October 24, 2026 10:49
@omartelo
omartelo merged commit 5ee9618 into main Oct 24, 2026
7 checks passed
@omartelo
omartelo deleted the feat/pulls-handoff-stays branch October 24, 2026 10:57
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.

1 participant