Repository navigation
Preserve restored panes during startup reconciliation - #2921
Merged
Merged
Conversation
SawyerHood
added a commit
that referenced
this pull request
Sep 3, 2026
…it (#3006) ## 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
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.
Human comments
What was wrong
The startup route sent a restored split layout through the normal navigation reconciliation. When the layout had no composer, that path replaced the focused pane. The direct reproduction and root-cause report is https://get-bb.github.io/reports/issues/2919.html.
What changed
The first route reconciliation now adds a missing composer to the right edge when the layout has room. Later route navigation keeps the existing replacement behavior. This change does not alter a wire protocol, CLI surface, schema, or stored-data format.
How you verified
pnpm exec turbo run typecheck --filter=@bb/apppassed.git diff --checkpassed.Fixes #2919