Skip to content

Restore grouped project filtering in Sidebar V2#4282

Open
shivamhwp wants to merge 2 commits into
pingdotgg:mainfrom
shivamhwp:agent/group-sidebar-v2-projects
Open

Restore grouped project filtering in Sidebar V2#4282
shivamhwp wants to merge 2 commits into
pingdotgg:mainfrom
shivamhwp:agent/group-sidebar-v2-projects

Conversation

@shivamhwp

@shivamhwp shivamhwp commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

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

  • build logical project snapshots for Sidebar V2
  • filter active and settled threads by every physical member of the selected logical project
  • retain stale duplicate project references when resolving groups
  • preserve the configured project order for grouped snapshots

This PR is intentionally limited to Sidebar V2 filtering. New-thread pickers, settings, and mobile behavior are split into follow-up PRs.

Verification

  • vp lint on the five changed web files
  • vp run --filter @t3tools/web typecheck
  • vp test run apps/web/src/components/Sidebar.logic.test.ts apps/web/src/environmentGrouping.test.ts — 85 tests passed

Note

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:projectId per 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 when sidebarProjectSortOrder is manual, and sorts groups with new sortLogicalProjectsForSidebar (recent thread activity otherwise). Project filter scope keys use projectKey; active/settled thread lists match any ref in memberProjectRefs.

Grouping helpers now collect memberProjectRefs from all input projects (including stale duplicates routed into a logical group), and add buildSidebarProjectPickerEntries for 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

  • Groups projects logically across environments in SidebarV2.tsx, scoping thread lists to all member project refs within a selected logical group.
  • Adds sortLogicalProjectsForSidebar in Sidebar.logic.ts to order groups by thread activity (ignoring archived threads) or preserve manual order when sort is set to manual.
  • Extends buildSidebarProjectSnapshots in sidebarProjectGrouping.ts to include all memberProjectRefs across environments per logical group, not just the winning representative members.
  • Adds buildSidebarProjectPickerEntries to support selecting a preferred environment-specific project and surfacing it first in the picker list.
  • Behavioral Change: project scope keys and UI labels now use logical group projectKey and displayName rather than individual environment-specific project identifiers.

Macroscope summarized c0f0ff2.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 51d33551-7099-4cd2-bcc1-a49abb0c1491

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Jul 22, 2026
Comment thread apps/web/src/components/SidebarV2.tsx
@shivamhwp
shivamhwp marked this pull request as ready for review July 22, 2026 14:40
Comment thread apps/web/src/components/SidebarV2.tsx Outdated
Comment thread apps/web/src/components/SidebarV2.tsx
@macroscopeapp

macroscopeapp Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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 buildSidebarProjectPickerEntries function where the fallback logic may target an incorrect workspace.

You can customize Macroscope's approvability policy. Learn more.

@github-actions github-actions Bot added size:XL 500-999 changed lines (additions + deletions). and removed size:L 100-499 changed lines (additions + deletions). labels Jul 22, 2026
Comment thread apps/web/src/components/SidebarV2.tsx Outdated
Comment thread apps/mobile/src/features/home/HomeScreen.tsx Outdated
Comment thread apps/mobile/src/features/home/HomeScreen.tsx Outdated
Comment thread apps/web/src/components/SidebarV2.tsx
Comment thread apps/mobile/src/features/home/homeThreadList.ts Outdated
Comment thread apps/mobile/src/features/home/homeThreadList.ts Outdated
@github-actions github-actions Bot added size:XXL 1,000+ changed lines (additions + deletions). and removed size:XL 500-999 changed lines (additions + deletions). labels Jul 22, 2026
Comment thread apps/web/src/components/settings/SettingsPanels.logic.ts Outdated
Comment thread apps/mobile/src/features/layout/AdaptiveWorkspaceLayout.tsx Outdated
Comment thread apps/mobile/src/features/layout/AdaptiveWorkspaceLayout.tsx Outdated
Comment thread apps/mobile/src/App.tsx Outdated
@juliusmarminge
juliusmarminge force-pushed the agent/group-sidebar-v2-projects branch from 7f2ba9f to 1ff96af Compare July 22, 2026 22:10
Comment thread apps/mobile/src/features/home/HomeScreen.tsx Outdated
Comment thread apps/mobile/src/features/home/HomeScreen.tsx Outdated
Comment thread apps/web/src/components/CommandPalette.tsx Outdated
Comment thread apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx Outdated
Co-authored-by: codex <codex@users.noreply.github.com>
Comment thread apps/mobile/src/features/home/homeThreadList.ts Outdated
Comment thread apps/mobile/src/features/home/HomeScreen.tsx Outdated
@juliusmarminge
juliusmarminge force-pushed the agent/group-sidebar-v2-projects branch from 1ff96af to d64eeae Compare July 22, 2026 22:19
@juliusmarminge juliusmarminge changed the title Restore project grouping in Sidebar V2 Restore grouped project filtering in Sidebar V2 Jul 22, 2026
@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). and removed size:XXL 1,000+ changed lines (additions + deletions). labels Jul 22, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Fix All in Cursor

❌ 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.

Comment thread apps/web/src/components/SidebarV2.tsx
Co-authored-by: codex <codex@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants