Skip to content

Target server settings by environment#1

Closed
colonelpanic8 wants to merge 5 commits into
desktop-client-only-discoveryfrom
t3code/client-only-environment-settings
Closed

Target server settings by environment#1
colonelpanic8 wants to merge 5 commits into
desktop-client-only-discoveryfrom
t3code/client-only-environment-settings

Conversation

@colonelpanic8

Copy link
Copy Markdown
Owner

What Changed

  • Add one shared environment selector across General, Providers, Keybindings, Source Control, and Diagnostics settings.
  • Route server-backed settings to the selected environment while keeping client-only preferences in local client storage.
  • Use the active saved environment for global keybindings, provider updates, and server presentation when no primary environment exists.
  • Resolve new-thread defaults, worktree behavior, editors, and keybindings from the project or thread environment.
  • Incorporate per-environment provider configuration and environment-scoped diagnostics behavior.
  • Disable server-backed controls while the selected environment is disconnected.

Why

Client-only desktop mode deliberately has no PrimaryConnectionTarget, but several settings surfaces still read and wrote exclusively through primary-server atoms and hooks. Those controls therefore displayed defaults and silently failed to persist.

Settings now resolve an explicit selection first, then the managed primary environment, the active saved environment, and finally the first available environment. This preserves existing managed-client behavior while making client-only and multi-environment operation explicit.

UI Changes

  • General Settings now starts with a Server Settings environment row showing connection state and the selected environment.
  • Providers, Keybindings, Source Control, and Diagnostics use the same shared selection.
  • Client-local settings remain available when an environment is disconnected; server-backed controls are disabled until it reconnects.
  • Provider accounts and authorization state are shown only for the selected environment.

This PR is stacked on desktop-client-only-discovery, the branch behind pingdotgg#4444. It also carries the environment-scoped provider and diagnostics work needed by the complete settings flow.

Checklist

  • vp test run apps/web/src/components/settings/SettingsPanels.logic.test.ts apps/web/src/components/settings/DiagnosticsSettings.logic.test.ts apps/web/src/hooks/useSettings.test.ts — 31 tests passed
  • Targeted vp lint --report-unused-disable-directives for all changed files
  • vp run --filter @t3tools/web build
  • Integrated authenticated browser verification across General, Providers, Keybindings, Source Control, and Diagnostics
  • Confirmed assistant output, provider update checks, and the add-project base path persist through reload
  • vp run --filter @t3tools/web typecheck remains blocked by pre-existing unrelated errors in BranchToolbarBranchSelector, ModelPickerContent, PreviewAutomationHosts, and the atom command/query helpers

colonelpanic8 and others added 5 commits July 25, 2026 19:43
The diagnostics environment picker made three pieces of panel-local state
lie about which machine they belong to:

- `openLogsDirectoryError` / `isOpeningLogsDirectory` kept showing an
  environment A failure (or spinner) after switching to environment B.
  They are now stored together with the environment they belong to, so
  they only render for that environment and a late completion can only
  update its own request.
- `signalingPid` was a single shared value, so completing a signal on
  environment A re-enabled the signal controls for an in-flight signal on
  environment B and allowed a duplicate SIGKILL. Pending signals are now
  identified by environment id plus pid.
- Diagnostics queries only run while the selected environment's
  supervisor is connected, so a disconnected machine showed permanent
  "Loading..." placeholders with the refresh buttons disabled. The panel
  now derives a connection notice and renders it instead of the loading
  state.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Follow-up to the review feedback on the previous commit:

- `DiagnosticsRefreshButton` used a single `isPending` prop for both the
  spinner and `disabled`, so suppressing the spinner while the selected
  environment is disconnected also made the button clickable even though
  the query cannot run. It now takes an explicit `isDisabled` prop.
- The open-logs completion matched on environment id alone, so returning
  to an environment and starting a second open while the first was still
  in flight let the older completion clear the newer pending state. The
  completion now matches the request by identity.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XXL labels Jul 26, 2026
@colonelpanic8

Copy link
Copy Markdown
Owner Author

Superseded by upstream PR pingdotgg#4559.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 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.

1 participant