Configure providers per environment#4548
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:
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
ApprovabilityVerdict: Needs human review This PR introduces a new feature enabling per-environment provider configuration, adding new UI components and user-facing workflow. New features that introduce new capabilities warrant human review. You can customize Macroscope's approvability policy. Learn more. |
What Changed
Why
Provider settings were implicitly tied to the primary server. In client-only mode, or when multiple T3 environments are connected, that made it impossible to see which machine owned an account configuration and could route updates to the wrong target.
UI Changes
Mobile-width verification
The real add-instance flow was exercised against the selected environment. The resulting provider instance was persisted to that environment and the confirmation toast named the target environment.
Checklist
vp checkvp test run src/components/settings/SettingsPanels.logic.test.ts src/hooks/useSettings.test.ts --project unit(13 tests)vp run typecheck— blocked by pre-existing@effect/vitestexport errors inoxlint-plugin-t3code; cleanorigin/mainfails with the same errorsNote
Medium Risk
Changes which environment receives provider settings and update commands; wrong selection could misroute config, but scope is settings UI with explicit selector and tested default resolution.
Overview
Provider settings are no longer tied only to the primary server. Users pick which connected environment to configure via a new environment selector in the Providers panel.
Routing and defaults: Provider instance edits, status refresh, one-click updates, and new instances use
useEnvironmentSettings/useUpdateEnvironmentSettingsand per-environment server atoms for the selected target.resolveProviderSettingsEnvironmentIdpicks the initial environment (explicit selection, then primary in managed mode, active remote in client-only, with fallback when a selection disappears).UX: Loading, disconnected, and no-environment states are handled; the add-instance dialog and success toast name the target environment. Unit tests cover environment resolution.
Reviewed by Cursor Bugbot for commit e46b174. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Scope provider settings configuration per environment in the Settings panel
selectedEnvironmentIdstate and derives the effective environment using a newresolveProviderSettingsEnvironmentIdutility, which picks from selected, primary, and active environment IDs in priority order.ProviderEnvironmentSelectorcomponent renders a dropdown to switch the active environment context for provider configuration.ProviderSettingsEnvironmentPanelkeyed by environment, replacing the previous primary-environment-only approach.AddProviderInstanceDialognow acceptsenvironmentIdandenvironmentLabelprops and writes to environment-specific settings instead of primary settings.Macroscope summarized e46b174.