Skip to content

feat(web): filter sidebar threads by environment - #8530

Open
saphid wants to merge 19 commits into
pingdotgg:mainfrom
saphid:web/sidebar-environment-filter
Open

feat(web): filter sidebar threads by environment#8530
saphid wants to merge 19 commits into
pingdotgg:mainfrom
saphid:web/sidebar-environment-filter

Conversation

@saphid

@saphid saphid commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Adds an environment filter beside the sidebar project picker when multiple environments are connected. Choose which environments contribute threads, or restore All environments. At least one environment stays selected. Project and environment filters compose; pinned and active rows use the same selection. A marker shows when filtering is active, and removed environments are pruned from the filter.

Verified head 5a95053254681b488ea89fc248855c47a1001b62 includes upstream main e3b644c5af. The contribution is not superseded on that base. 168 focused tests, web typecheck, scoped lint and diff checks passed.

Real client proof

Fresh captures compare exact base e3b644c5af with exact head 5a9505325, in the full web client at 1280×800, light appearance. Two real disposable servers are connected through the normal pairing UI. The first has five threads; the second has one thread created through the client, with an actual Codex/Sol response SECOND_ENVIRONMENT_OK. Both machines report the same hostname; their distinct addresses are visible in the menu.

Before:

Before: six threads across two environments

After:

After: one environment, then all six threads restored

Before clean video · After clean video · After annotated video

Actual clicks exclude the first environment, leaving the second server’s one thread; the last enabled environment is disabled in the menu to prevent an empty selection. All environments restores all six rows and removes the active-filter marker. The open remote conversation remains selected. The filter is component-local state: browser reload resets it to all environments, which was checked explicitly. These captures use real app controls and backend connections, without injecting filter state or provider output. The sidebar/menu crop retains elapsed time, with GIF sampling at 25 fps. Full raw recordings and source receipts are retained locally.

Fresh Electron, relay/tunnel, disconnected-environment, and project-filter composition runtime journeys were not performed. Focused logic tests cover composition, selection normalization, and the last-enabled guard. Native clients are outside this UI change.

Implemented and reviewed with GPT-6 in Codex; bounded worker model metadata was not exposed. Direct Claude Opus 5 review was unavailable because OAuth expired before inference; no Claude model ran.

@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: d367322f-c1b5-452d-a6a8-de14bddd045f

📥 Commits

Reviewing files that changed from the base of the PR and between 490eb17 and 90e13da.

📒 Files selected for processing (4)
  • apps/web/src/components/Sidebar.logic.test.ts
  • apps/web/src/components/Sidebar.logic.ts
  • apps/web/src/components/Sidebar.tsx
  • docs/user/thread-sidebar.md

Included review availability: Your plan provides up to 10 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

The sidebar adds a session-only environment filter. It hides matching threads, drafts, and project entries, maintains valid selections as environments connect or disconnect, and documents the new controls.

Changes

Sidebar environment filtering

Layer / File(s) Summary
Environment filter logic and tests
apps/web/src/components/Sidebar.logic.ts, apps/web/src/components/Sidebar.logic.test.ts
Adds helpers to toggle disabled environments, preserve one enabled environment, prune disconnected ids, and reset invalid filters. Tests cover these behaviors and same-instance returns.
Sidebar filter state and row filtering
apps/web/src/components/Sidebar.tsx
Tracks pruned filter state, updates project scope, filters drafts and threads, clears hidden selections, and resets settled-tail pagination.
Environment filter menu and documentation
apps/web/src/components/Sidebar.tsx, docs/user/thread-sidebar.md
Adds the environment menu, last-environment protection, filtered empty state, and documentation for combined project and environment filters.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 5a950

The sidebar now supports session-only environment filtering alongside project scope, with filtering applied consistently across threads, drafts, project entries, counts, search, and empty states. No concrete current-head merge-blocking risk remains.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant EnvironmentMenu
  participant Sidebar
  participant ThreadList
  participant DraftRows
  User->>EnvironmentMenu: Toggle an environment
  EnvironmentMenu->>Sidebar: Update disabled environment ids
  Sidebar->>ThreadList: Recompute visible threads
  Sidebar->>DraftRows: Recompute visible drafts
  ThreadList-->>User: Show enabled-environment threads
  DraftRows-->>User: Show enabled-environment drafts
Loading

Suggested reviewers: juliusmarminge, t3dotgg, maria-rcks

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 3 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The description clearly explains the environment filter, its behavior, verification results, UI evidence, and known testing limits. It does not use the template headings or include the checklist, and …
Title check ✅ Passed The title clearly and concisely describes the main change: adding environment filtering to sidebar threads.
Full details: Docstring Coverage

Explanation

Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 3 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 Aug 28, 2026
@macroscopeapp

macroscopeapp Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 90e13da

Macroscope's review found this PR approvable — Adds an opt-in, session-only environment checklist to the existing sidebar while retaining the prior all-environments default. Runtime impact is limited to local filtering of threads, drafts, and project choices, with focused helper tests and no schema, backend, or deployment changes.

No code changes detected at 5a95053. Prior analysis still applies.

You can add or adjust custom eligibility rules. Learn more.

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Aug 28, 2026
@saphid
saphid force-pushed the web/sidebar-environment-filter branch from 258c853 to 8983e13 Compare August 28, 2026 21:35
@macroscopeapp
macroscopeapp Bot dismissed their stale review August 28, 2026 21:35

Dismissing prior approval to re-evaluate 8983e13

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

One consistency finding on the new environment-filter trigger: it is the only icon SidebarMenuButton in this header row without the coarse-pointer hit-target overlay its neighbors use. Everything else (Menu/MenuPopup/MenuCheckboxItem composition, width-class contract on MenuPopup, active-filter dot matching PullRequestListFilters) matches the shared component system.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/Sidebar.tsx Outdated
Comment thread apps/web/src/components/Sidebar.tsx Outdated
@saphid
saphid force-pushed the web/sidebar-environment-filter branch from 8983e13 to 14ed67b Compare August 28, 2026 22:45
saphid and others added 2 commits August 29, 2026 13:47
Add an icon button next to the sidebar's project scope menu (visible only
when more than one environment is connected) that opens a checklist to
enable and disable which environments' threads the list shows. The filter
composes with the project scope, draft rows, search, and the settled-tail
pagination reset; the project menu narrows to projects with a presence in
an enabled environment.

State is the disabled set, so newly connected environments are visible by
default. The last enabled environment cannot be unchecked, and a catalog
change that would leave nothing enabled resets the filter instead of
hiding every thread behind a control that no longer renders.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@saphid
saphid force-pushed the web/sidebar-environment-filter branch from 14ed67b to 72c948d Compare August 29, 2026 03:48

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

Two consistency findings on the new environment filter control in apps/web/src/components/Sidebar.tsx. Everything else (dot indicator matching PullRequestListFilters, MenuPopup width contract, SidebarMenuButton icon-color indirection) lines up with the existing system.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/Sidebar.tsx Outdated
Comment thread apps/web/src/components/Sidebar.tsx Outdated

@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 d80e30b. Configure here.

Comment thread apps/web/src/components/Sidebar.logic.ts Outdated

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

One finding on the new commit: the locked environment row explains its constraint with a native title attribute instead of the shared Tooltip primitive. Details inline.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/Sidebar.tsx Outdated

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

One finding on the newest commit: the environment checkbox rows now pin data-highlighted text colors, which overrides MenuCheckboxItem's accent-surface foreground contract.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/Sidebar.tsx Outdated
Comment thread apps/web/src/components/Sidebar.tsx Outdated
@t3dotgg

t3dotgg commented Sep 4, 2026

Copy link
Copy Markdown
Member

Note

🤖 GPT-6 Astra (preview) responding on behalf of Theo

This note is part of an automated cleanup pass.

Documentation carryover from #9241 at 32c1c96: update docs/user/thread-sidebar.md to explain that web and desktop can filter by project and environment, and explain how to clear each filter. Adapt the text to this PR's retained combobox and environment controls. Do not copy the alternative's Project/Environment submenu instructions. This records documentation work for follow-up and does not claim the text has been added.

@cursor

cursor Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

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