From b95f1bbf3152e688584d3ad00358b65d7ac78bcd Mon Sep 17 00:00:00 2001 From: Angus Buick <55269277+angusb93@users.noreply.github.com> Date: Mon, 16 Nov 2026 16:58:48 +0000 Subject: [PATCH] fix(app): draw the Add host text fields as inputs again (#9864) (#9865) AdaptiveTextInput wraps its input with withUnistyles, and the pairing link and direct connection modals wrapped AdaptiveTextInput a second time. On web each wrapper is a display: contents element whose style lands on its direct child, so the outer style landed on the inner wrapper and the input lost its border, background and padding. Drop the outer wrapper, AdaptiveTextInput already themes the placeholder colour. Also give the host password field a placeholder and focus it when pairing asks for a password. --- .../e2e/browser/settings-host-page.spec.ts | 20 +++++++++++++++++++ packages/app/e2e/support/helpers/settings.ts | 8 ++++++++ .../add-host/internal/add-host-modal.tsx | 12 ++++------- .../add-host/internal/pair-link-modal.tsx | 10 ++++------ 4 files changed, 36 insertions(+), 14 deletions(-) diff --git a/packages/app/e2e/browser/settings-host-page.spec.ts b/packages/app/e2e/browser/settings-host-page.spec.ts index 4ada0c7fa..7644e3c0e 100644 --- a/packages/app/e2e/browser/settings-host-page.spec.ts +++ b/packages/app/e2e/browser/settings-host-page.spec.ts @@ -33,6 +33,8 @@ import { expectNoHostPasswordControls, removeHostFromHostPage, addDirectHostFromSettings, + expectAddHostFieldDrawnAsInput, + selectHostConnectionType, expectHostOnlineWithoutError, expectIdleAgentRelease, editRestartRecoveryPrompt, @@ -307,6 +309,24 @@ async function closeAddHostAndChangeTheme(page: import("@playwright/test").Page) await page.keyboard.press("Control+Alt+t"); } +test("Add host draws its text fields as bordered inputs", async ({ page }) => { + await gotoAppShell(page); + + await test.step("the pairing link field", async () => { + await openSidebarAddHost(page); + await selectHostConnectionType(page, "relay"); + await expectAddHostFieldDrawnAsInput(page, "pair-link-input"); + await page.getByTestId("pair-link-cancel").click(); + }); + + await test.step("the direct connection fields", async () => { + await selectHostConnectionType(page, "direct"); + await expectAddHostFieldDrawnAsInput(page, "direct-host-input"); + await expectAddHostFieldDrawnAsInput(page, "direct-port-input"); + await expectAddHostFieldDrawnAsInput(page, "direct-password-input"); + }); +}); + test("sidebar Add host completes without navigating", async ({ page }) => { await gotoAppShell(page); await expect(page).toHaveURL(/\/open-project$/); diff --git a/packages/app/e2e/support/helpers/settings.ts b/packages/app/e2e/support/helpers/settings.ts index ee5aae1f4..303114925 100644 --- a/packages/app/e2e/support/helpers/settings.ts +++ b/packages/app/e2e/support/helpers/settings.ts @@ -223,6 +223,14 @@ export async function addDirectHostFromSettings( await expect(page.getByTestId("add-host-modal")).toHaveCount(0, { timeout: 30_000 }); } +export async function expectAddHostFieldDrawnAsInput(page: Page, testId: string): Promise { + const field = page.getByTestId(testId); + await expect(field).toBeVisible(); + await expect(field).toHaveCSS("border-top-width", "1px"); + await expect(field).not.toHaveCSS("padding-left", "0px"); + await expect(field).not.toHaveCSS("background-color", "rgba(0, 0, 0, 0)"); +} + export async function toggleHostAdvanced(page: Page): Promise { await page.getByTestId("direct-host-advanced-toggle").click(); } diff --git a/packages/app/src/hosts/add-host/internal/add-host-modal.tsx b/packages/app/src/hosts/add-host/internal/add-host-modal.tsx index 5379e5f4b..f9ea7a2f8 100644 --- a/packages/app/src/hosts/add-host/internal/add-host-modal.tsx +++ b/packages/app/src/hosts/add-host/internal/add-host-modal.tsx @@ -431,7 +431,7 @@ function AddHostModalContent({ visible, onClose, onCancel, onSaved }: AddHostMod {t("pairing.direct.fields.host")} - {t("pairing.direct.fields.port")} - {t("pairing.direct.fields.password")} - {t("pairing.direct.advanced.label")} {isAdvancedOpen ? ( - ({ const ThemedEye = withUnistyles(Eye, (theme) => ({ color: theme.colors.foregroundMuted })); const ThemedEyeOff = withUnistyles(EyeOff, (theme) => ({ color: theme.colors.foregroundMuted })); - -const ThemedAdaptiveTextInput = withUnistyles(AdaptiveTextInput, (theme) => ({ - placeholderTextColor: theme.colors.foregroundMuted, -})); diff --git a/packages/app/src/hosts/add-host/internal/pair-link-modal.tsx b/packages/app/src/hosts/add-host/internal/pair-link-modal.tsx index f817bdc5c..02653010b 100644 --- a/packages/app/src/hosts/add-host/internal/pair-link-modal.tsx +++ b/packages/app/src/hosts/add-host/internal/pair-link-modal.tsx @@ -212,7 +212,7 @@ function PairLinkModalContent({ {t("pairing.link.label")} - {t("pairing.hostPassword.title", { host: parsedHostLabel(offerUrlRef.current) })} - @@ -275,7 +277,3 @@ function PairLinkModalContent({ } const ThemedLink = withUnistyles(Link, (theme) => ({ color: theme.colors.accentForeground })); - -const ThemedAdaptiveTextInput = withUnistyles(AdaptiveTextInput, (theme) => ({ - placeholderTextColor: theme.colors.foregroundMuted, -}));