diff --git a/e2e/projectSwitcherLayout.spec.ts b/e2e/projectSwitcherLayout.spec.ts index a68e9bc284..eeb8a6e973 100644 --- a/e2e/projectSwitcherLayout.spec.ts +++ b/e2e/projectSwitcherLayout.spec.ts @@ -50,6 +50,9 @@ test("project switcher keeps names and metadata on separate lines and highlights ); const remote = popup.getByRole("option", { name: /Payment Ledger/ }); + await expect(remote.locator("[data-remote-badge]")).toHaveCount(1); + await expect(remote.locator('[data-remote-kind="ssh"]')).toBeVisible(); + await expect(local.locator("[data-remote-badge]")).toHaveCount(0); await expectBelow(remote, "Payment Ledger", HOST); await expectBelow(remote, HOST, REMOTE_PATH); diff --git a/src/features/remote-dev/RemoteDev.module.css b/src/features/remote-dev/RemoteDev.module.css index 386576b3e5..7a07349add 100644 --- a/src/features/remote-dev/RemoteDev.module.css +++ b/src/features/remote-dev/RemoteDev.module.css @@ -88,4 +88,5 @@ display: inline-flex; align-items: center; gap: var(--space-1); + color: var(--warning); } diff --git a/src/features/remote-dev/RemoteStatus.tsx b/src/features/remote-dev/RemoteStatus.tsx index 75ace9134d..2915dbaf5c 100644 --- a/src/features/remote-dev/RemoteStatus.tsx +++ b/src/features/remote-dev/RemoteStatus.tsx @@ -61,6 +61,7 @@ export function RemoteStatus() { ]); }} > + {label} ); diff --git a/src/features/remote-dev/resources.test.tsx b/src/features/remote-dev/resources.test.tsx index e312334459..f8bacdf173 100644 --- a/src/features/remote-dev/resources.test.tsx +++ b/src/features/remote-dev/resources.test.tsx @@ -5,6 +5,7 @@ import type { HostMetrics, RemoteSession } from "@/platform/ipc"; import { useProject } from "@/platform/project"; import { disableRemote, enableRemote, useRemote } from "@/platform/remote"; import { RemoteResources, RemoteResourcesDashboard } from "./RemoteResources"; +import { RemoteStatus } from "./RemoteStatus"; import { compactResourceText, diskUsedBytes, @@ -235,4 +236,17 @@ describe("remote resources widget and dashboard", () => { await act(async () => inflight); expect(useRemoteResources.getState().metrics).toBeNull(); }); + + it("renders a server icon on the Remote Host status bar label and highlights disconnected text in warning tone", () => { + act(() => enableRemote(sshSession("deng@thinkpad"))); + const { rerender } = render(); + const connected = screen.getByRole("button", { name: "SSH: deng@thinkpad" }); + expect(connected.querySelector("svg")).not.toBeNull(); + expect(connected.querySelector('[class*="lost"]')).toBeNull(); + + act(() => useRemote.setState({ lost: "deng@thinkpad" })); + rerender(); + const disconnected = screen.getByRole("button", { name: "SSH: deng@thinkpad (disconnected)" }); + expect(disconnected.querySelector('[class*="lost"]')).not.toBeNull(); + }); }); diff --git a/src/features/welcome/ProjectPopup.test.tsx b/src/features/welcome/ProjectPopup.test.tsx index 98d2ebc899..8269a95d0c 100644 --- a/src/features/welcome/ProjectPopup.test.tsx +++ b/src/features/welcome/ProjectPopup.test.tsx @@ -73,6 +73,32 @@ describe("ProjectPopup", () => { expect(text.indexOf("datahub-front")).toBeLessThan(text.indexOf("Recent Projects")); expect(text.indexOf("Recent Projects")).toBeLessThan(text.indexOf("other")); expect(within(list).getAllByText("FastAPIProject")).toHaveLength(1); + const remoteRow = within(list).getByText("FastAPIProject").closest('[role="option"]')!; + expect(remoteRow.querySelector("[data-remote-badge]")).not.toBeNull(); + expect(remoteRow.querySelector('[data-remote-kind="wsl"]')?.textContent).toContain("WSL"); + }); + + it("leaves local project avatars and rows free of remote badges", async () => { + open = [ + { name: "same-name", root: "/home/me/same-name", current: false, remote: { kind: "ssh", config: "devbox" } }, + { name: "same-name", root: "/Users/me/same-name", current: true, remote: null }, + ]; + groups = []; + recent = []; + const anchor = createRef(); + render( + <> +