@devries-cameron20 / t3code-1 / commits / 1672b51630
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(web): Add Environment drops the old tab's error when switching mode (#32157)

Co-authored-by: Julius Marminge <julius0216@outlook.com>

Jiri Kvapil committed Nov 15, 2026 at 05:43 UTC 1672b51630a309d49eee19120aba5352399821a3
2 files changed +19
apps/web/src/components/settings/AddEnvironmentDialog.browser.test.tsx
+18
@@ -97,6 +97,24 @@ describe("AddEnvironmentDialog", () => {
97 await expectDefaultModeAfterReopen();
98 });
99
100 + it("drops an SSH error when switching to Remote link", async () => {
101 + using _bridge = setup();
102 + await using _screen = await render(<Owner />);
103 +
104 + mocks.connectSshEnvironment.mockResolvedValueOnce(
105 + AsyncResult.failure(Cause.fail(new Error("ssh: connection refused"))),
106 + );
107 + await openDialogOnSsh();
108 + await userEvent.type(page.getByPlaceholder("Search hosts or type devbox"), "devbox");
109 + await userEvent.click(
110 + page.getByRole("dialog").getByRole("button", { name: "Add environment" }),
111 + );
112 + await expect.element(page.getByText(/connection refused/)).toBeInTheDocument();
113 +
114 + await userEvent.click(remoteCard());
115 + await expect.element(page.getByText(/connection refused/)).not.toBeInTheDocument();
116 + });
117 +
118 it("clears the form after dismissing it on SSH", async () => {
119 using _bridge = setup();
120 await using _screen = await render(<Owner />);
apps/web/src/components/settings/AddEnvironmentDialog.tsx
+1
@@ -369,6 +369,7 @@ export function AddEnvironmentDialog({
369 )}
370 disabled={isAddingSavedBackend}
371 onClick={() => {
372 + if (!selected) onErrorChange(null);
373 setSavedBackendMode(input.mode);
374 }}
375 >