Repository navigation
Conversation
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR adds a new persisted environment-scope feature and changes sidebar filtering, project menus, draft visibility, search fan-out, and related settings/server labels across multiple production components. The cross-cutting user-facing behavior and broad runtime surface warrant human review. You can add or adjust custom eligibility rules. Learn more. |
b24ddda to
a52d880
Compare
a52d880 to
e65a32e
Compare
Backport onto v0.0.45 of upstream pull request pingdotgg#14997 at head e65a32e (feat(web): add an environment scope filter to the sidebar), squashed from its four commits. With two or more enabled environments, the sidebar header gets an environment menu before the project menu. Picking one narrows threads, draft rows and their count, the project menu, and the server-side search fan-out to that environment. "All environments" resets it. The choice is persisted in the UI state store next to the project scope. v0.0.45 predates the environment summary atoms and the Sidebar V2 thread filter the pull request builds on, so three places differ: - state/environments.ts: sidebarEnvironmentScopeOptions reads the environment presentations from useEnvironments() instead of connection summaries, and the hooks for those summaries are left out. Its tests build presentations instead of summaries. - Sidebar.tsx: the visible-thread filter and the search fan-out keep v0.0.45's inline code and apply sidebarScopeIncludes and the scoped environment to it. - Sidebar.logic.ts and its test keep v0.0.45's version, since filterSidebarV2VisibleThreads does not exist there. sidebarScope.test.ts covers the shared visibility rule. Carried-Pull-Request: 14997 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4ecac04 to
c1111ff
Compare
…ettings, pull requests, and sidebar Settings rendered its environment radio rows inline and labeled duplicate machine names with a helper only Settings could reach, while the Pull Requests server filter showed bare labels, so two same-named machines read as one row there. Move the label rule to state/environments, make it also tell apart machines that share an address, and render the rows from a small EnvironmentScopeOption shape any menu can build. The "All environments" value becomes the empty string, which no EnvironmentId can be, so an environment whose id is "all" no longer collides with it.
Add sidebarEnvironmentScopeId beside sidebarProjectScopeKey: same localStorage layer, no key bump (old payloads decode to null, old builds ignore the field). The id is decoded at the parse boundary into an Option rather than through EnvironmentId.make, since readPersistedState wraps the whole parse in one try/catch and a throw would discard every other field; the decode also trims, so a padded id hydrates and a blank one is dropped. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The sidebar could only be scoped by project. Add the pure model for an environment axis next to it: the menu options come from the catalog's enabled environments, built from connection summaries so provider and config refreshes do not churn them, and resolveSidebarScope narrows the project groups to the chosen environment before looking up the project key. A project scope with no member there reads as all projects, and a stored value is only cleared once every enabled environment has a live project snapshot, the gate the project axis already uses.
A user connected to several environments saw every machine's projects and threads mixed in one sidebar, with no way to narrow it to one machine even though mobile offers that filter. Add an environment menu before the project scope whenever two or more environments are enabled. Picking one narrows the thread list, draft rows and count, the folder menu's project list, and the server-side search fan-out to that environment. The trigger shows the machine's glyph, and "All environments" is one click away. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
c1111ff to
1a28085
Compare
|
Note This comment is posted by Julius' dot This adds a new persisted sidebar filtering workflow across threads, drafts, project menus and search. #8948 has no maintainer approval, and the V2 rebuild invitation on #12923 did not approve this direction or scope. Closing under the prior-approval rule. Please agree on the desktop environment-filter behavior with maintainers in an Ideas discussion and link that approval for reconsideration. |
Problem
The web and desktop sidebar can only be scoped by project. A user connected to several environments sees every machine's projects and threads mixed together and has no way to narrow the list to one machine, even though mobile already offers an Environment filter in its list options. Closes #8948.
Change
Add an environment scope menu to the sidebar header, before the project scope:
The two stored keys stay independent. One pure
resolveSidebarScopenarrows the project groups by environment before looking up the project key, so a project scope with no member on the chosen environment falls back to all projects. V2'sfilterSidebarV2VisibleThreadstakes the resolved scope and shares the samesidebarScopeIncludescheck as draft rows.The resolver also carries the project-scope behavior from #17050. A saved scratch key from one machine reads as the merged "No project" group and is written back as that group's key. A stored value on either axis is cleared only after every enabled environment has both its project snapshot and its project config, because the config is what identifies a scratch project.
What changed relative to #12923 for V2:
useEnvironments(), so the sidebar does not re-render on provider updates or heartbeats.EnvironmentScopeOption(id, label, machine, offline). Settings maps its full presentation to it; the sidebar maps the connection summary.state/environments.ts, and the radio rows are shared by Settings, the Pull Requests server filter, and the sidebar, so the Pull Requests filter now disambiguates same-named servers too.Scope and approval
This is a rebuild of #12923. It addresses #8948, which asks for a Remote environments filter on the desktop clients to match mobile.
Verification
Automated checks:
vp test runon the uiStateStore, environments, sidebarScope, settingsScopeAxis, settingsScope, and Sidebar.logic suites passes (6 files, 214 tests). The fix(client): merge No project filters across environments #17050 suites that cover the same code, settingsScopeRetention and environmentGrouping, also pass (2 files, 29 tests).tsc --noEmitforapps/webis clean.Manual run in the web dev app with three environments, two of which have a "No project" thread:
Mobile is unchanged (it already has this filter).
The screenshots come from a separate run with seeded demo data across three environments: Moonbase Terminal (this machine), Suspense Station, and Kernel Cabin.
Model: Claude Opus 5.5. Harness: Claude Code (T3 Code).