Repository navigation
Fix sidebar drop affordances for other projects - #5046
Merged
Merged
Conversation
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
In the sidebar's By project mode, project groups were treated as unrestricted drop destinations. Dragging a pinned or child thread onto another project's header or row could show a valid landing affordance and attempt to unpin or detach the thread, even though the drop cannot change its project.
What changed
Track each project group's project ID, including the personal Threads container, and reject mismatched destinations during collision detection and drop resolution. Invalid destinations no longer highlight or show landing previews, and releasing there leaves the thread unchanged. Drops into the thread's own project and supported cross-project parent/child links remain available. No wire, CLI, or public SDK changes. Also align the cache-owner import registry with the sidebar group owner introduced in #5045: declare its six imports and remove the stale projectsQueryKey allowance from the thread state owner.
How you verified
pnpm exec turbo run test --filter=bb-plugin-thread-list -- app/dnd/useSectionThreadDnd.test.ts app/dnd/useSectionThreadDnd.projection.test.tsx: 62 passed, including existing cross-project nesting coverage.pnpm exec turbo run typecheck lint --filter=bb-plugin-thread-list: passed; lint reports 9 existing warnings and no errors.pnpm exec turbo run test --filter=@bb/app -- src/hooks/cache-owners/cache-owner-registry.test.ts. The 62 drag checks also pass after merging current main.pnpm start:worktreewith labeled test projects and threads for manual review.