Skip to content

Support worktree group dragging and respect custom section boundaries - #3946

Open
ymichael wants to merge 2 commits into
mainfrom
bb/enable-dragging-worktree-groups-thr_6ib27vz55y
Open

ymichael wants to merge 2 commits into
mainfrom
bb/enable-dragging-worktree-groups-thr_6ib27vz55y

Conversation

@ymichael

Copy link
Copy Markdown
Collaborator

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.

Safari/iOS touch dragging was not tested.

AGENT GENERATED

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