Conversation
Collaborator
Author
|
Superseded by #3946, which includes this PR's section-aware environment grouping implementation and regression tests alongside worktree group/member dragging. The combined branch passes all 300 client-core tests, 78 focused app tests, and both package typechecks. |
ymichael
added a commit
that referenced
this pull request
Sep 21, 2026
…#3946) ## Human comments ## What was wrong Worktree group headers and their member rows did not participate in sidebar dragging, and the header shared an identifier with its first thread. Custom sidebar sections were also applied after environment grouping, so one member's section determined where the whole group appeared. When dragging an expanded group into an empty Threads section, hidden source children could become the final drop target even while the destination preview remained visible, cancelling the move. ## What changed - Enable dragging expanded or collapsed worktree groups between custom sections and Threads, moving their represented threads while preserving parent relationships. - Give group headers distinct drag IDs and enable independent member and nested-child dragging through the existing thread move, detach, and nesting behavior. - Partition root nodes by section before grouping environments in Custom organization. Preserve parent/child trees and existing By project behavior; threads sharing an environment group only within their own section or the unsectioned bucket. - Exclude the dragged group's header and descendants from collision candidates so hidden source rows cannot steal an empty-section drop. Includes and supersedes #3943, retaining its grouping implementation and regression coverage. Uses existing SDK thread updates and CLI section assignments; no server/daemon wire changes. ## How you verified - `pnpm exec turbo run test typecheck --filter=@bb/client-core` — all 300 tests and typecheck passed on the combined branch. - `pnpm exec turbo run test --filter=@bb/app -- useSectionThreadDnd ProjectRow.interactions ProjectThreadTree.disclosure sidebarDropPreviewPlacement` — all 78 tests passed on the combined branch. - `pnpm exec turbo run typecheck --filter=@bb/app` — passed. - Regression coverage includes separate sections sharing an environment, grouping enabled/disabled, unsectioned threads, missing section definitions, descendants and counts, independent member moves, and hidden-child collision handling for pointer overlap and nearest-target fallback. - Used actual Chromium mouse input against `pnpm start:worktree` and the source BB CLI to verify expanded/collapsed group moves, moves between sections and back into Threads, nested-child detachment, independent first-member moves, nesting, Escape cancellation, ordinary-thread dragging, and reload persistence. - Reproduced the empty-Threads failure, repeated the same pointer path after the fix, and confirmed both members' section IDs cleared while unrelated threads stayed unchanged. Also verified the collapsed-group case. - Rebased onto `b1f94e0795` and resolved the environment-header conflict while retaining inline rename and drag behavior. - Current focused coverage passes: 300 client-core tests, 50 changed-area sidebar tests, 82 isolated Command Palette/Plugin Settings tests, and app/client-core typechecks. - Repeated production-build QA with `pnpm start:worktree`, real Chromium mouse dragging, source `bb` CLI state reads, reload persistence, connected server/daemon health, and the remote BB Connect origin. <details> <summary>Bundle impact</summary> The worktree-group drag behavior adds 1.4 KiB to the raw boot payload. The raw allowance increases by 2 KiB; the compressed cap stays at 419.0 KiB. Current output is 1697.9 KiB raw and 416.9 KiB Brotli, and the exact bundle-budget check passes. </details> Safari/iOS touch dragging was not tested. > 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
With sidebar organization set to Custom and By environment enabled, environment groups were built before custom sections. The first thread in each environment determined the section for the entire group, so other threads sharing that environment appeared in the wrong section or outside their assigned sections.
What changed
Partition root thread nodes by section before grouping environments in custom organization mode. Threads sharing an environment now group only within their own section, including the unsectioned bucket. Preserve parent/child trees and existing project organization behavior. Add regression coverage for grouping enabled/disabled, separate sections sharing an environment, unsectioned threads, missing section definitions, descendants, and section counts.
How you verified
pnpm exec turbo run test typecheck --filter=@bb/client-core— passed.pnpm exec turbo run test --filter=@bb/app -- sidebarDropPreviewPlacement— all five tests passed.pnpm start:worktreeusing a fresh isolated database. Captured before/after browser screenshots using four synthetic idle threads sharing one environment across two sections and the unsectioned bucket.git diff --check— passed.