Skip to content

Revert startup pane reconciliation so handoff does not open a new split - #3006

Merged
SawyerHood merged 1 commit into
mainfrom
bb/fix-handoff-opening-new-split-thr_9g9bd7kp4n
Sep 3, 2026
Merged

SawyerHood merged 1 commit into
mainfrom
bb/fix-handoff-opening-new-split-thr_9g9bd7kp4n

Conversation

@SawyerHood

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

The "Handoff to new thread" action opened the composer in a new split pane instead of the focused pane. handleHandoffToNewThread navigates to the legacy project compose path /projects/:projectId (apps/app/src/views/thread-detail/ThreadDetailPromptArea.tsx:1004). SplitWorkspaceRoute answers that path with LegacyProjectComposeRedirect, so React unmounts SplitThreadArea. The redirect then replaces the URL with /, and SplitThreadArea mounts again. PR #2921 gated its startup reconciliation behind a per-mount useRef, so the remount looked like a fresh startup. The mount effect therefore called reconcileRestoredLayoutForContent, which splits the rightmost pane to the right for new-thread content. A handoff from the personal project did not show the bug, because getProjectComposeRoutePath returns / for that project and no unmount happens.

What changed

This pull request reverts commit 970480f6c6 (PR #2921). It removes reconcileRestoredLayoutForContent from apps/app/src/views/thread-detail/splitThreadNavigation.ts, removes the shouldReconcileRestoredLayout ref from apps/app/src/views/thread-detail/SplitThreadArea.tsx, and removes that PR's regression test. Route reconciliation again always replaces the focused pane. The change does not touch a wire protocol, HOST_DAEMON_PROTOCOL_VERSION, a CLI surface, a schema, or a stored-data format.

Note the cost of this revert: issue #2919 comes back. After a restart with a restored multi-pane layout on /, the composer replaces a restored thread pane instead of joining the layout at the right edge. A later change can fix both bugs together. It must make the startup guard true only for the first route reconciliation of the session, and not for each mount of SplitThreadArea.

How you verified

  • pnpm exec turbo run typecheck --filter=@bb/app passed.
  • pnpm exec turbo run test --filter=@bb/app -- SplitThreadArea splitThreadNavigation passed with 4 test files and 58 tests.
  • The first test run failed in the ensure-native-modules prerequisite with a better-sqlite3 segmentation fault. That step is unrelated to this change, and the retry passed.
  • This pull request adds no test. The reverted commit held the only test of this reconciliation path, and the revert removes it.

Fixes #

This revert reopens #2919.

AGENT GENERATED

@SawyerHood
SawyerHood merged commit debb58d into main Sep 3, 2026
15 checks passed
@SawyerHood
SawyerHood deleted the bb/fix-handoff-opening-new-split-thr_9g9bd7kp4n branch September 3, 2026 15:32
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