Skip to content

Configure providers per environment#4548

Open
colonelpanic8 wants to merge 1 commit into
pingdotgg:mainfrom
colonelpanic8:feature/provider-environment-settings
Open

Configure providers per environment#4548
colonelpanic8 wants to merge 1 commit into
pingdotgg:mainfrom
colonelpanic8:feature/provider-environment-settings

Conversation

@colonelpanic8

@colonelpanic8 colonelpanic8 commented Jul 26, 2026

Copy link
Copy Markdown

What Changed

  • Added an environment selector to Provider settings.
  • Routed provider configuration, status refreshes, updates, and new instances to the selected environment.
  • Defaulted managed deployments to the primary environment and client-only deployments to the active/first available environment.
  • Added safe loading and no-environment states plus focused environment-selection tests.

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

Before After
Provider settings before Environment-scoped provider settings
Mobile-width verification

Environment-scoped provider settings at 390px

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 check
  • vp test run src/components/settings/SettingsPanels.logic.test.ts src/hooks/useSettings.test.ts --project unit (13 tests)
  • Type-aware lint and type checking for the five changed files
  • Integrated desktop and 390px web verification with zero browser errors or warnings
  • vp run typecheck — blocked by pre-existing @effect/vitest export errors in oxlint-plugin-t3code; clean origin/main fails with the same errors

Note

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 / useUpdateEnvironmentSettings and per-environment server atoms for the selected target. resolveProviderSettingsEnvironmentId picks 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

  • The Providers settings page now maintains a selectedEnvironmentId state and derives the effective environment using a new resolveProviderSettingsEnvironmentId utility, which picks from selected, primary, and active environment IDs in priority order.
  • A new ProviderEnvironmentSelector component renders a dropdown to switch the active environment context for provider configuration.
  • All provider actions (view, refresh, update, add instance) are routed through a new ProviderSettingsEnvironmentPanel keyed by environment, replacing the previous primary-environment-only approach.
  • AddProviderInstanceDialog now accepts environmentId and environmentLabel props and writes to environment-specific settings instead of primary settings.
  • Behavioral Change: Provider settings reads and writes now target the selected environment; previously all operations implicitly used the primary environment.

Macroscope summarized e46b174.

@coderabbitai

coderabbitai Bot commented Jul 26, 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: 7985e63b-c6ba-415a-a874-1a4e9c166109

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Jul 26, 2026
@macroscopeapp

macroscopeapp Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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.

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.

1 participant