Restore grouped project filtering in Sidebar V2#4282
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Needs human review 3 blocking correctness issues found. This PR introduces runtime behavior changes to sidebar project filtering and grouping. An unresolved high-severity review comment identifies a potential bug in the new You can customize Macroscope's approvability policy. Learn more. |
7f2ba9f to
1ff96af
Compare
Co-authored-by: codex <codex@users.noreply.github.com>
1ff96af to
d64eeae
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
There are 5 total unresolved issues (including 4 from previous reviews).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d64eeae. Configure here.
Co-authored-by: codex <codex@users.noreply.github.com>

Why
Sidebar V2 treats environment-scoped copies of the same repository as separate projects. Users therefore see duplicate project entries and selecting one copy hides threads belonging to the other environment.
Root cause
Sidebar V2 filters directly by one physical environment/project pair instead of using the logical-project grouping already available to the legacy sidebar.
Fix
This PR is intentionally limited to Sidebar V2 filtering. New-thread pickers, settings, and mobile behavior are split into follow-up PRs.
Verification
vp linton the five changed web filesvp run --filter @t3tools/web typecheckvp test run apps/web/src/components/Sidebar.logic.test.ts apps/web/src/environmentGrouping.test.ts— 85 tests passedNote
Medium Risk
Changes how Sidebar V2 scopes visible threads and resolves project groups; incorrect membership mapping could hide or mis-attribute threads, but logic is isolated and heavily unit-tested.
Overview
Sidebar V2 now lists and filters by logical project groups (same repo across environments) instead of one physical
environmentId:projectIdper row, so duplicate project entries disappear and scoping a group shows threads from every member environment.The sidebar builds grouped snapshots via
buildSidebarProjectSnapshots, applies saved manual order whensidebarProjectSortOrderismanual, and sorts groups with newsortLogicalProjectsForSidebar(recent thread activity otherwise). Project filter scope keys useprojectKey; active/settled thread lists match any ref inmemberProjectRefs.Grouping helpers now collect
memberProjectRefsfrom all input projects (including stale duplicates routed into a logical group), and addbuildSidebarProjectPickerEntriesfor one entry per logical group with a preferred-environment target—covered by tests; picker UI is left to follow-ups per the PR scope.Reviewed by Cursor Bugbot for commit c0f0ff2. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Restore grouped project filtering in Sidebar V2 with logical project scoping
sortLogicalProjectsForSidebarin Sidebar.logic.ts to order groups by thread activity (ignoring archived threads) or preserve manual order when sort is set tomanual.buildSidebarProjectSnapshotsin sidebarProjectGrouping.ts to include allmemberProjectRefsacross environments per logical group, not just the winning representative members.buildSidebarProjectPickerEntriesto support selecting a preferred environment-specific project and surfacing it first in the picker list.projectKeyanddisplayNamerather than individual environment-specific project identifiers.Macroscope summarized c0f0ff2.