Files
orca/src/shared/ssh-target-source.ts
T
Neil 49a2203b0e Remote Orca Servers: one list instead of six sections; SSH Hosts: bulk remove that stays removed (#31082)
* feat(settings): one-list Remote Orca Servers page and bulk-manageable SSH Hosts

Remote Orca Servers: replace the three mode cards, Advanced fold, duplicate
managed/SSH-access lists and troubleshooting accordion with a single list
(one row per server: status, one action, overflow menu), an always-visible
'New projects open on' row, and Share / Cloud VM cards that open dialogs.

SSH Hosts: group by source, filter, checkbox + shift-range selection, one
confirm for bulk remove (skipping hosts with a managed server or
workspaces), bulk Test. 'Sync ~/.ssh/config' no longer clears removal
tombstones; 'Restore removed hosts (n)' is a separate confirmed action.

* fix(settings): address review findings on servers and SSH hosts redesign

- SSH filter stays clearable when the list shrinks under the threshold
- Cmd/Ctrl-A only selects hosts when pressed in the list itself
- group legacy no-source hosts with main's import predicate (now shared)
- capture the shift-range anchor before queuing the selection update
- blank server names de-duplicate instead of colliding
- Share dialog Done refreshes link count and resets name editing
- Install / SSH-route dialogs reload SSH hosts when opened
- default-host row shows the selector when the default is a WSL host
- managed 'Not running' no longer masks connecting/revoked/update states
- servers without a dropped transport can be re-checked

* test(e2e): WSL host spec matches repo.rm ending a removed project's shells

repo.rm now stops the project's terminals on the host (#29964), so the
'orphan left by older builds' setup can no longer be built; use a shell
only the host knows of instead. Resolve the project path so macOS
/private/var matches what the host reports.

* fix(settings): carry 'Orca on <host>' naming and paired-twice warning into the new server list

Ports #31099 and #31100 into the redesigned rows, install dialog and SSH
host dialogs.

* test(e2e): keep the WSL spec's project path as created
2026-10-20 05:22:39 -07:00

25 lines
860 B
TypeScript

import type { SshTarget } from './ssh-types'
/**
* Legacy manual and imported targets both lack `source`. Only the old import shape counts as
* imported: the SSH alias kept as label/configHost while host stored the resolved HostName.
*/
export function isLegacyConfigImportTarget(
target: Pick<SshTarget, 'label' | 'configHost' | 'host'>
): boolean {
const alias = target.configHost ?? target.label
return Boolean(
alias && target.label === alias && target.configHost === alias && target.host !== alias
)
}
/** Whether a target came from ~/.ssh/config, by the same rule config sync uses. */
export function isSshConfigSourcedTarget(
target: Pick<SshTarget, 'source' | 'label' | 'configHost' | 'host'>
): boolean {
return (
target.source === 'ssh-config' ||
(target.source === undefined && isLegacyConfigImportTarget(target))
)
}