Skip to content

feat(web): add environment filter to the sidebar - #6294

Open
Official-Krish wants to merge 1 commit into
pingdotgg:mainfrom
Official-Krish:feat/sidebar-environment-filter
Open

feat(web): add environment filter to the sidebar#6294
Official-Krish wants to merge 1 commit into
pingdotgg:mainfrom
Official-Krish:feat/sidebar-environment-filter

Conversation

@Official-Krish

@Official-Krish Official-Krish commented Aug 12, 2026

Copy link
Copy Markdown

Fixes #6229

What Changed

Added a single-select environment filter to the sidebar alongside the existing project filter in apps/web/src/components/Sidebar.tsx (used by desktop).

The new filter lets users narrow the thread list to a single connected environment while keeping all configured environments available.

Files Changed

  • apps/web/src/components/Sidebar.tsx

    • Added environment scope state and filter options
    • Added environment partition/filter logic
    • Added draft filtering and draft UI
    • Added environment filter header UI
    • Added empty state handling
    • Added settled-reset key
  • apps/web/src/components/Sidebar.logic.ts

    • Added buildSidebarEnvironmentFilterOptions
    • Added projectScopeKeptUnderEnvironmentScope helpers
    • Added tests for the new helpers
  • apps/web/src/components/Sidebar.logic.test.ts

    • Added 15 test cases covering the two new helpers

Why

Previously, the thread list could only be narrowed by project, not by environment.

For users with multiple connected environments, this made it difficult to focus on threads belonging to a specific environment without losing access to the others.

The new environment filter works alongside the existing project filter:

  • Both filters can be active simultaneously.
  • Switching environments resets the project filter when the selected project has no member in the new environment.
  • Removing an environment filter resets it to All environments.

UI Changes

Before

Only a project filter was available:

  • All projects
  • Project list

After

Both filters are available in the same row:

  • Project filter — existing All projects + project list
  • Environment filter — new All environments + one entry per configured environment

Environment options are sorted by label, with the primary environment indicated using the existing MonitorIcon / CloudIcon.

The two filters can be combined in either order:

  1. Select an environment, then a project
  2. Select a project, then an environment

When switching environments, the project filter is reset if the selected project has no member in the new environment. Removing the environment selection resets the filter to All environments.

Checklist

  • This PR is small and focused
  • I explained what changed and why

Note

Medium Risk
Touches core sidebar filtering and selection-clearing behavior with non-trivial cross-filter reset rules, so incorrect scope handling could hide threads or clear filters unexpectedly.

Overview
Adds a single-select environment filter beside the existing project filter so users with multiple connected environments can narrow threads and drafts to one environment.

The filter appears only when more than one environment is connected. It filters the thread list, draft rows, and project menu options; selecting an environment that the current project does not span resets the project filter. Scope also clears when the environment disconnects or only one remains.

Empty-state copy now mentions the active environment when scoped. New helpers in Sidebar.logic cover option building, project-menu filtering, and reset rules, with matching unit tests.

Reviewed by Cursor Bugbot for commit 783ad2c. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Add environment filter to the sidebar to scope threads, drafts, and projects

  • Adds an environment filter menu to the sidebar, shown when more than one environment exists, with icons distinguishing the primary environment from others.
  • Selecting an environment scopes visible threads and draft sessions to that environment, and constrains the project filter menu to projects present on that environment.
  • Introduces logic helpers in Sidebar.logic.ts for building sorted filter options, filtering project groups, checking project scope retention, and auto-resetting a stale environment scope.
  • Changing the environment scope clears the current thread selection and resets settled history pagination; the scope auto-resets if the selected environment disappears or only one environment remains.
  • Empty state messages reflect the currently scoped environment label.

Macroscope summarized 783ad2c.

@coderabbitai

coderabbitai Bot commented Aug 12, 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 Plus

Run ID: 5954bbb0-4403-4340-9222-640d18d356a9

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

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:unvouched PR author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Aug 12, 2026
Comment thread apps/web/src/components/Sidebar.tsx
Comment thread apps/web/src/components/Sidebar.tsx
Comment thread apps/web/src/components/Sidebar.tsx
@macroscopeapp

macroscopeapp Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR adds a new user-facing feature (environment filtering in sidebar) with new state management, filtering logic, and UI components. New features introducing new capability warrant human review.

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

@Official-Krish
Official-Krish force-pushed the feat/sidebar-environment-filter branch from 6b27ba9 to 7116aaa Compare August 12, 2026 11:41

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

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 7116aaa. Configure here.

Comment thread apps/web/src/components/Sidebar.tsx Outdated
@Official-Krish
Official-Krish force-pushed the feat/sidebar-environment-filter branch from 7116aaa to 783ad2c Compare August 12, 2026 11:50
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:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Add an environment filter to the Sidebar

1 participant