fix(web): scope source control settings by environment - #6088
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 Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f5c8e64. Configure here.
ApprovabilityVerdict: Needs human review This PR introduces environment-scoped source control settings, enabling users to configure settings per-connected-environment rather than just the primary device. Despite the 'fix' label, this is a new feature with significant behavioral changes, new permission gating logic, and a new UI component hierarchy that warrants human review. You can customize Macroscope's approvability policy. Learn more. |

What Changed
This adds the same device selection used by Provider settings to Source Control Settings, and routes discovery, Git fetch policy, writing preferences, and writer-model data through the selected environment.
The backend APIs were already environment-scoped, so no wire-contract or server changes were required.
Both settings panels now use a shared SettingsEnvironmentSelector component (componented out from SettingsEnvironmentSelector), hence the slightly larger diff churn.
Why
Both Source Control and Provider features use the connected environment's tools, but Source Control Settings only reflected the current local environment. This brings them both into line, and allows changing of Source Control settings between local environments.
UI Changes
Before:

After (Video):
Recording.2026-08-11.041726.mp4
Tested on desktop + web builds on Windows 11, connected to Windows + Linux remote environments.
Checklist
Note
Medium Risk
Changes where persisted settings are read and written per environment; mistakes could target the wrong device, though the pattern mirrors the existing provider panel and adds read-only gating.
Overview
Source Control settings now follow the same per-device model as Provider settings: a shared
SettingsEnvironmentSelector(extracted from the provider panel) lets you pick which connected environment to configure, and hides itself when only the primary device exists.Discovery, Git fetch interval, writing style, and writer model reads/writes all go through
environmentId-scoped hooks and queries instead of primary-only settings. Session and connection access reuseProviderSettingsPanel.logicso remote or limited sessions see read-only or unavailable states instead of editing the wrong host.Provider settings only swap in the shared selector; status dots in device buttons no longer use tooltips (status still appears in the subtitle). Tests cover environment routing and the selector behavior; user docs note device selection for multi-environment setups.
Reviewed by Cursor Bugbot for commit dd9b8d1. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Scope source control settings by environment with per-device selector
SettingsEnvironmentSelectorcomponent used by both the source control and provider settings panels.environmentId.Macroscope summarized dd9b8d1.