Skip to content

sessions: Add Remote Environments picker visibility controls - #344034

Merged
Christof Marti (chrmarti) merged 9 commits into
mainfrom
chrmarti/remote-environments-visibility
Oct 24, 2026
Merged

Christof Marti (chrmarti) merged 9 commits into
mainfrom
chrmarti/remote-environments-visibility

Conversation

@chrmarti

@chrmarti Christof Marti (chrmarti) commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

Follow-up to #344031 (merged); rebased onto origin/main at 4ff5ad971b5. Related test plan: #343790.

Changes

  • Add per-remote Show/Hide eye actions to Remote Environments, following Language Models management. Both shown and hidden icons stay visible at rest; other inline actions remain hover/focus-only. Hidden rows remain manageable with a dimmed name (full contrast in high-contrast themes).
  • Show a spinner immediately after each section's count while that section refreshes. Sections finish independently; cancellation, errors, and superseded requests clear or ignore progress appropriately. Group busy state and refresh status are exposed accessibly.
  • Distinguish shown, hidden by the user, and currently unavailable in the picker. Unavailable entries show a persistent disabled indicator with an explanatory tooltip and accessible text, not a misleading eye toggle. Reasons include connecting a newly discovered remote once, an offline owning application, and an unsupported independent picker entry.
  • Reuse the picker eligibility predicate and existing provider visibility signal. Keep provider availability separate from the saved hidden preference, observe registration/availability changes, and retain the preference while unavailable. Reject stale Show/Hide actions after eligibility changes.
  • Preferences remain local to the profile and machine, use stable SSH identities and account-qualified shared-environment identities, and do not change registration, connections, auto-connect, session history, or existing drafts. Showing never registers/connects a host or overrides availability.
  • Accepting a folder through Environments, SSH, Tunnels, or WSL clears the selected provider's hidden preference before selecting its workspace. Cancellation leaves it unchanged. These paths share the same handoff and await the new session before selecting the folder.
  • Preserve existing draft destinations and validate Send/workspace resolution against availability and connection state, not the hidden preference. Hidden, connected hosts remain valid send targets; offline/disconnected hosts stay blocked.
  • Retain automation definitions, run history, refresh, and existing management routes for hidden available hosts; only their creation-picker choices are hidden. Restore remote Dev Container draft destinations without falling back to This Computer or adding hidden hosts back to picker enumeration.
  • Report each discovery failure immediately. Missing tunnel permissions can fail before a spinner is painted; Tunnels now shows its warning/failed state while other sections are still loading. The spinner remains active during pending authentication and enumeration, with no artificial minimum delay.
  • Gate management and application of hidden preferences on sessions.chat.experimental.environmentPickerManageRemotes. With it off, pickers follow original availability rules, stored preferences remain intact, and the Command Palette/Sessions overflow entry points are hidden. An open management editor becomes disabled; setting changes apply live.
  • Fix the CI formatting failure in remotesTable.ts. The new WSL action regression test also exposed an unused disposable setup action; use the existing non-disposable action helper instead.

Previously, the New Session picker considered only registered providers with workspace-selection support, then applied visibility and grouping rules. Management also lists discovery-only entries. The initial version of this PR displayed the saved preference as if it meant actual visibility; this revision explicitly distinguishes those states.

How to test

  1. Open Remote Environments with an unused WSL distro or newly discovered SSH/tunnel host. It should have an unavailable indicator, not Hide; its tooltip explains that it must first be connected.
  2. Connect it through the existing connection action. Once an eligible provider is registered, Hide should become available and the picker should contain it.
  3. Hide/show an eligible remote. Its picker entry should update without disconnecting it or removing sessions; the management row remains.
  4. Make a hidden shared environment offline, then online again. It should show the offline availability explanation while unavailable and retain its hidden preference when it returns.
  5. Check keyboard navigation, accessible row/view text, profile persistence, and high-contrast presentation.
  6. Hide a remote, select it through its subpicker, and accept a folder. Confirm it becomes shown and selected in the Environment picker. Cancelling either picker should leave the hidden preference alone.
  7. With an existing draft targeting a connected remote, hide that remote. The draft's destination and Send eligibility should remain unchanged. Taking the remote offline or disconnecting it must still disable Send.
  8. Move the pointer outside the table: both shown and hidden icons should remain visible. Refresh and check that each section spins after its count only while its own discovery is pending, including collapsed or empty sections.
  9. Turn off sessions.chat.experimental.environmentPickerManageRemotes: previously hidden eligible remotes return to the pickers, offline environments remain excluded, and management commands disappear. Re-enable it and verify saved hidden preferences return. Selecting a remote while the feature is off must not erase those preferences.
  10. Hide an available host that owns automations: existing definitions/run history and management should remain. Restore a Dev Container draft on a hidden remote and verify its destination and Send remain correct.
  11. Refresh without a usable tunnel-scoped token while another section is still loading. Tunnels should show a failure warning immediately rather than appearing idle until the entire refresh ends. Grant missing permissions through Tunnels or the Dev Tunnel command, then retry.

Validation

Latest regression follow-up: 305 Electron tests passed, 539 browser tests passed across Chromium and WebKit (270/269, with the WSL case platform-gated). Final client type-check, changed-source hygiene, layer checks, and whitespace checks passed. Inspected a stable dark fixture showing a tunnel failure while SSH is still spinning. Authentication tests use fake sessions; live tokens or permissions were not changed.

Commands (all passed):

npm run build-fast -- --client-only
.\scripts\test.bat --run src\vs\sessions\contrib\automations\test\browser\providerAutomationService.test.ts --run src\vs\sessions\contrib\chat\test\browser\sessionEnvironmentPicker.test.ts --run src\vs\sessions\contrib\chat\test\browser\newChatWidget.test.ts --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\remotesModel.test.ts --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\remotesWidget.test.ts --run src\vs\sessions\contrib\providers\remoteAgentHost\test\electron-browser\tunnelAgentHostServiceImpl.test.ts --reporter dot
npm run test-browser-no-install -- --browser webkit --browser chromium-msedge --run src\vs\sessions\contrib\automations\test\browser\providerAutomationService.test.ts --run src\vs\sessions\contrib\chat\test\browser\sessionEnvironmentPicker.test.ts --run src\vs\sessions\contrib\chat\test\browser\newChatWidget.test.ts --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\remotesModel.test.ts --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\remotesWidget.test.ts --reporter dot
npm run typecheck-client
$files = @(git diff --name-only -- '*.ts' '*.css')
node build\hygiene.ts $files
npm run valid-layers-check
git diff --check

Latest setting-gate follow-up: 376 Electron tests passed, client type-check and changed-source hygiene passed. Coverage includes default-off/live off/on transitions for SSH, tunnels, WSL, WebSocket and shared environments, independent availability, retained preferences, command/menu gates, direct invocation guards, and disabling an already-open editor.

Commands (all passed):

npm run build-fast -- --client-only
.\scripts\test.bat --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\remoteAgentHostSessionsProvider.test.ts --run src\vs\sessions\contrib\providers\remoteAgentHost\test\electron-browser\remotesEditor.test.ts --run src\vs\sessions\contrib\chat\test\browser\sessionEnvironmentPicker.test.ts --run src\vs\sessions\services\agentHostFilter\test\browser\agentHostFilterService.test.ts --reporter dot
npm run typecheck-client
$files = @(git diff --name-only -- '*.ts' '*.css')
node build\hygiene.ts $files
git diff --check

Latest icon/section-progress follow-up: 83 Electron tests passed, 151 browser tests passed across Chromium and WebKit, client type-check and changed-source hygiene passed. Dark and light high-contrast refreshing fixtures were inspected; the dark fixture passed screenshot stability and teardown checks.

Commands and results (all passed):

npm run build-fast -- --client-only
.\scripts\test.bat --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\remotesModel.test.ts --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\remotesWidget.test.ts --run src\vs\sessions\contrib\providers\remoteAgentHost\test\electron-browser\remotesEditor.test.ts --reporter dot
npm run test-browser-no-install -- --browser webkit --browser chromium-msedge --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\remotesWidget.test.ts --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\remotesModel.test.ts --reporter dot
npm run typecheck-client
$files = @(git diff --name-only -- '*.ts' '*.css')
node build\hygiene.ts $files
git diff --check

Latest selection/review follow-up:

  • 711 Electron tests passed, with one existing skipped test.
  • 179 tests passed each in Chromium and WebKit.
  • Final client type-check and layer checks passed. Direct hygiene (including formatting and ESLint) passed for all 24 changed TypeScript/CSS files in the PR.
  • The exact npm run hygiene -- --changed-since ... gulp wrapper fails locally on Windows before source checks because its package validation resolves C:\C:\.... No build-tool workaround was committed; the existing direct hygiene entry point below successfully checks the PR sources. Hosted CI's actual failure was the now-fixed formatting indentation.

Commands and results (all passed):

npm run build-fast -- --client-only
.\scripts\test.bat --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\remoteAgentHostActions.test.ts --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\remoteAgentHostSessionsProvider.test.ts --run src\vs\sessions\contrib\chat\test\browser\newChatWidget.test.ts --run src\vs\sessions\contrib\chat\test\browser\sessionEnvironmentPicker.test.ts --run src\vs\sessions\contrib\chat\test\browser\sessionWorkspacePicker.test.ts --reporter dot
npm run test-browser-no-install -- --browser webkit --browser chromium-msedge --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\remoteAgentHostActions.test.ts --run src\vs\sessions\contrib\chat\test\browser\newChatWidget.test.ts --run src\vs\sessions\contrib\chat\test\browser\sessionEnvironmentPicker.test.ts --reporter dot
npm run typecheck-client
npm run valid-layers-check
$files = @(git diff --name-only 4ff5ad971b5bc474e5fc6ca8cf2386d30a85d3eb -- '*.ts' '*.css')
node build\hygiene.ts $files
git diff --check

Earlier eligibility revision on the rebased branch:

  • 478 Electron tests passed, covering storage, model, controls, providers, editor, picker, and host filtering.
  • 171 browser tests passed across Chromium and WebKit, covering management/picker alignment and UI behavior.
  • Client type-check, changed-TypeScript ESLint, CSS stylelint, layer checks, and whitespace checks passed.
  • Inspected dark, light, and dark high-contrast fixtures; light screenshot stability passed. Interactive checks verified Tab/Shift+Tab, Enter/Space toggling for eligible remotes, persistent unavailable state, and navigation from an unavailable row to Connect.
Exact commands and results

All passed:

npm run build-fast -- --client-only
npm run typecheck-client
$files = @(git diff --name-only -- '*.ts')
npm run eslint -- $files
npm run stylelint -- src\vs\sessions\contrib\providers\remoteAgentHost\browser\media\remotesWidget.css
npm run valid-layers-check
git diff --check

478 passing:

.\scripts\test.bat --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\remoteAgentHostPickerVisibility.test.ts --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\remotesModel.test.ts --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\remotesWidget.test.ts --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\remoteAgentHostSessionsProvider.test.ts --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\missionControlAgentHostContribution.test.ts --run src\vs\sessions\contrib\providers\remoteAgentHost\test\electron-browser\remotesEditor.test.ts --run src\vs\sessions\contrib\chat\test\browser\sessionEnvironmentPicker.test.ts --run src\vs\sessions\services\agentHostFilter\test\browser\agentHostFilterService.test.ts --reporter dot

171 passing (86 and 85; one WSL case is platform-gated):

npm run test-browser-no-install -- --browser webkit --browser chromium-msedge --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\remotesModel.test.ts --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\remotesWidget.test.ts --run src\vs\sessions\contrib\chat\test\browser\sessionEnvironmentPicker.test.ts --reporter dot

Limitations: live backend connections, full-workbench end-to-end flows, and manual screen-reader output were not exercised. The isolated fixture did not render toolbar hovers; tooltip text was checked through the shared action tooltip/accessible-name path, while the unavailable explanation is also included in row and Accessible View text.

Base automatically changed from chrmarti/remote-environments-entrypoints to main October 24, 2026 09:43
Layer a profile-local hidden preference over existing provider availability and expose Show/Hide actions without affecting connections or sessions.

Co-authored-by: Copilot <[email protected]>
Distinguish unavailable hosts from hidden preferences, share picker eligibility checks, and preserve visibility preferences across registration and availability changes.

Co-authored-by: Copilot <[email protected]>
@chrmarti
Christof Marti (chrmarti) force-pushed the chrmarti/remote-environments-visibility branch from 039e5b3 to 50ab958 Compare October 24, 2026 12:26
Copilot AI balanced review requested due to automatic review settings October 24, 2026 12:26
@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: 211a00db Current: eedc38c6

Changed (9)

sessions/remotes/remotesWidget/Environments/Light
Before After
before after
sessions/remotes/remotesWidget/EnvironmentsNarrow/Light
Before After
before after
sessions/remotes/remotesWidget/EnvironmentsEmpty/Light
Before After
before after
sessions/remotes/remotesWidget/EnvironmentsWarning/Light
Before After
before after
sessions/remotes/remotesWidget/Table/Light
Before After
before after
sessions/remotes/remotesWidget/Wide/Light
Before After
before after
sessions/remotes/remotesWidget/Windows/Light
Before After
before after
sessions/remotes/remotesWidget/Narrow/Light
Before After
before after
sessions/remotes/remotesWidget/RefreshWarnings/Light
Before After
before after

Added (2)

sessions/remotes/remotesWidget/RefreshingTunnels/Light

current

sessions/remotes/remotesWidget/TunnelDiscoveryFailure/Light

current

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Hiding an otherwise available remote blocks submission of an existing draft because draft validation also checks picker visibility.

1 open issue
What changed in this PR

Adds per-remote picker visibility controls to the Agents Window’s Remote Environments editor, distinguishing user-hidden hosts from hosts that are currently unavailable.

Changes:

  • Adds Show/Hide actions, unavailable indicators, accessible explanations, and high-contrast styling.
  • Persists machine/profile-local preferences using stable host identities and account-scoped environment keys.
  • Shares picker eligibility logic and adds storage, provider, model, and UI coverage.
File Description
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​test/​electron-browser/​remotesEditor.test.ts Updates the model stub for visibility controls.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​test/​browser/​remotesWidget.test.ts Tests toggling, focus retention, and unavailable indicators.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​test/​browser/​remotesWidget.fixture.ts Adds hidden/unavailable examples and high-contrast fixtures.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​test/​browser/​remotesModel.test.ts Tests eligibility, persistence, stable identities, and availability changes.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​test/​browser/​remoteAgentHostSessionsProvider.test.ts Tests combined visibility and availability without losing sessions.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​test/​browser/​remoteAgentHostPickerVisibility.test.ts Tests preference storage, propagation, and isolation.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​test/​browser/​missionControlAgentHostContribution.test.ts Verifies account-scoped preference keys.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​REMOTE_AGENT_HOST_SESSIONS_PROVIDER.md Documents visibility ownership and behavior.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​electron-browser/​remotes.contribution.ts Adds visibility controls to accessibility help.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​browser/​remotesWidget.ts Handles visibility actions and accessible row descriptions.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​browser/​remotesTable.ts Renders eye actions and disabled unavailable indicators.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​browser/​remotesModel.ts Derives picker state and rejects ineligible visibility changes.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​browser/​remoteAgentHostSessionsProvider.ts Combines saved preferences with provider availability.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​browser/​remoteAgentHostPickerVisibility.ts Implements normalized keys and local preference storage.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​browser/​missionControlAgentHostContribution.ts Supplies account-qualified environment keys.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​browser/​media/​remotesWidget.css Styles persistent indicators and dimmed names.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​browser/​entryDrivenProviderContribution.ts Forwards visibility preference keys to providers.
src/​vs/​sessions/​contrib/​chat/​browser/​sessionEnvironmentPicker.ts Reuses the shared remote eligibility predicate.
src/​vs/​sessions/​common/​agentHostSessionsProvider.ts Exposes availability separately and defines shared eligibility.

Review effort: Balanced

Unhide explicit remote folder selections without overriding availability, keep existing drafts sendable on hidden connected hosts, and fix CI formatting.

Co-authored-by: Copilot <[email protected]>
Show per-section spinners beside counts until each discovery completes, with cancellation-safe progress and accessible busy state.

Co-authored-by: Copilot <[email protected]>
Restore original picker availability when remote management is off, retain saved hidden preferences, and gate the command, overflow entry and open editor.

Co-authored-by: Copilot <[email protected]>
Link the section info action and empty-state guide to the planned vscode-agent-environments redirect.

Co-authored-by: Copilot <[email protected]>
Keep automation history and restored remote container destinations independent of picker visibility. Surface per-section discovery failures immediately, including missing tunnel authentication.

Co-authored-by: Copilot <[email protected]>
@chrmarti
Christof Marti (chrmarti) merged commit f3640a9 into main Oct 24, 2026
59 checks passed
@chrmarti
Christof Marti (chrmarti) deleted the chrmarti/remote-environments-visibility branch October 24, 2026 20:45
@vs-code-engineering vs-code-engineering Bot added this to the 1.144.0 milestone Oct 24, 2026
Christof Marti (chrmarti) added a commit that referenced this pull request Oct 24, 2026
<!-- Thank you for submitting a Pull Request. Please:
* Read our Pull Request guidelines:

https://github.com/microsoft/vscode/wiki/How-to-Contribute#pull-requests
* Associate an issue with the Pull Request.
* Ensure that the code is up-to-date with the `main` branch.
* Include a description of the proposed changes and how to test them.
-->

Follow-up to #344034 (merged). This PR now targets `main`.

### Changes

- Add right-aligned **Clear Search** and **Collapse All** actions inside
the search field, following Language Models management. Clear Search
restores input focus; Collapse All keeps the query and collapses the
sections.
- Replace the generic tunnel failure state for missing usable
credentials (including a token without tunnel scopes) with **Sign in to
allow access to your tunnels.** and a **Sign In** action.
- Request the configured tunnel permissions only after explicit sign-in,
then refresh discovery. The action does not directly connect or register
a remote; normal authentication listeners, discovery, and configured
auto-connect behavior remain unchanged. Show ordinary network failures
as errors, prevent duplicate sign-in, and retain the recovery prompt on
cancellation.
- Normalize GitHub Authentication's documented `Cancelled` result into
the standard cancellation error, so cancellation does not produce an
error notification. Other provider errors still surface.
- Update accessibility help and themed fixtures; preserve table keyboard
navigation and unrelated connection actions.

### Validation

Amended review follow-up: **100 Electron tests passed**, plus client
type-check and targeted hygiene. The listener suppression and
discovery-generation fencing were removed; the contribution and its
tests are identical to the pre-review version. Coverage retains GitHub
`Error('Cancelled')`/string cancellation normalization and checks that
another provider's errors are not treated as GitHub cancellation.

Follow-up commands (all passed):

```powershell
npm run build-fast -- --client-only
.\scripts\test.bat --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\tunnelAgentHost.contribution.test.ts --run src\vs\sessions\contrib\providers\remoteAgentHost\test\electron-browser\tunnelAgentHostServiceImpl.test.ts --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\remotesWidget.test.ts --reporter dot
npm run typecheck-client
node build\hygiene.ts src\vs\sessions\contrib\providers\remoteAgentHost\electron-browser\tunnelAgentHostServiceImpl.ts src\vs\sessions\contrib\providers\remoteAgentHost\test\electron-browser\tunnelAgentHostServiceImpl.test.ts
```

Earlier feature validation:

- **131 Electron tests passed**.
- **171 browser tests passed** across Chromium and WebKit (86/85; one
WSL case is platform-gated).
- Client type-check, changed-source hygiene (including formatting and
ESLint), layer checks, and whitespace checks passed.
- Inspected dark, narrow light, and light high-contrast fixtures; dark
sign-in fixture stability passed.
- An isolated Edge page verified actual Tab/arrow/Enter/Space navigation
for Clear Search, Collapse All, and Sign In, including clear-input focus
restoration.

<details>
<summary>Commands and results</summary>

All passed:

```powershell
npm run build-fast -- --client-only
npm run typecheck-client
npm run valid-layers-check
$files = @(git diff --name-only -- '*.ts' '*.css')
node build\hygiene.ts $files
git diff --check
```

131 passing:

```powershell
.\scripts\test.bat --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\remotesModel.test.ts --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\remotesWidget.test.ts --run src\vs\sessions\contrib\providers\remoteAgentHost\test\electron-browser\remotesEditor.test.ts --run src\vs\sessions\contrib\providers\remoteAgentHost\test\electron-browser\tunnelAgentHostServiceImpl.test.ts --reporter dot
```

171 passing:

```powershell
npm run test-browser-no-install -- --browser webkit --browser chromium-msedge --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\remotesModel.test.ts --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\remotesWidget.test.ts --reporter dot
```

</details>

Manual follow-up: open Remote Environments with no tunnel-scoped
session, confirm the plain-language prompt replaces the error, sign in,
and confirm the tunnel list refreshes while normal authentication
listeners and configured auto-connect behavior still apply. Verify
cancellation and ordinary network failures remain distinguishable.

Live OAuth consent, external tunnel discovery, and screen-reader output
were not exercised; authentication tests use fake sessions and
configured scope lists. No user credentials or scopes were modified
during validation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants