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, -}));