You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Add Environment dialog shows two cards selected after adding an SSH environment and reopening #26107
Choose the SSH card, enter an SSH alias (any host that works), click "Add environment".
The environment is added and the dialog closes.
Click "Add environment" again to add another one.
Reproduces every time. Not tried in the reverse order (Remote link first, then SSH).
Expected behavior
Exactly one card looks selected. Either the dialog resets to Remote link (its default) and shows the
Remote link form, or it remembers SSH and only the SSH card carries the selected styling.
Actual behavior
Both cards look selected. "Remote link" has the blue 2px border; "SSH" has the blue filled background,
and the form under the cards is the SSH one (SSH host or alias, Username, Port). Clicking either card
clears it. Adding the second environment works; the problem is only the styling.
Likely regression from #22686 "refactor(web): the add environment dialog owns its form state"
(merged 2026-10-21), the only commit on apps/web/src/components/settings/AddEnvironmentDialog.tsx.
From reading that file (not verified in a debugger): savedBackendMode is useState("remote") and
the selected style (border-primary/50 bg-primary/5) follows it; the state is not reset when the
dialog closes, so after an SSH add the component still holds "ssh". The border on Remote link then
looks like the first card's focus ring on reopen rather than the selected style. Either resetting the
mode on close or not autofocusing the first card when another is selected would fix it.
Closest existing issues, not duplicates: #7568 (SSH alias port change), #15802 (re-pairing creates a
duplicate environment). Both are behavior, not this dialog's UI.
Impact
Cosmetic issue
Version or commit
v0.1.4-nightly.20261027.3770
Environment
macOS 15.7.7, Apple silicon, T3 Code desktop v0.1.4-nightly.20261027.3770
Activity