From 924a8014ffc427fdcd6b5cee292314a633dde16f Mon Sep 17 00:00:00 2001 From: Wes Date: Tue, 24 Mar 2026 11:16:06 -0700 Subject: [PATCH] feat(desktop): reorder Profile above Identity in settings & remove duplicate NIP-05 input (#165) --- .../settings/ui/ProfileSettingsCard.tsx | 74 ++++++------------- desktop/tests/e2e/profile.spec.ts | 13 +--- 2 files changed, 23 insertions(+), 64 deletions(-) diff --git a/desktop/src/features/settings/ui/ProfileSettingsCard.tsx b/desktop/src/features/settings/ui/ProfileSettingsCard.tsx index 09541b2e8..e1a73d91f 100644 --- a/desktop/src/features/settings/ui/ProfileSettingsCard.tsx +++ b/desktop/src/features/settings/ui/ProfileSettingsCard.tsx @@ -70,30 +70,23 @@ export function ProfileSettingsCard({ const currentDisplayName = profile?.displayName ?? ""; const currentAvatarUrl = profile?.avatarUrl ?? ""; const currentAbout = profile?.about ?? ""; - const currentNip05Handle = profile?.nip05Handle ?? ""; - const [displayNameDraft, setDisplayNameDraft] = React.useState(""); const [avatarUrlDraft, setAvatarUrlDraft] = React.useState(""); const [aboutDraft, setAboutDraft] = React.useState(""); - const [nip05HandleDraft, setNip05HandleDraft] = React.useState(""); React.useEffect(() => { setDisplayNameDraft(currentDisplayName); setAvatarUrlDraft(currentAvatarUrl); setAboutDraft(currentAbout); - setNip05HandleDraft(currentNip05Handle); - }, [currentAbout, currentAvatarUrl, currentDisplayName, currentNip05Handle]); + }, [currentAbout, currentAvatarUrl, currentDisplayName]); const nextDisplayName = displayNameDraft.trim(); const nextAvatarUrl = avatarUrlDraft.trim(); const nextAbout = aboutDraft.trim(); - const nextNip05Handle = nip05HandleDraft.trim(); - const updatePayload: { displayName?: string; avatarUrl?: string; about?: string; - nip05Handle?: string; } = {}; if (nextDisplayName.length > 0 && nextDisplayName !== currentDisplayName) { @@ -105,9 +98,6 @@ export function ProfileSettingsCard({ if (nextAbout.length > 0 && nextAbout !== currentAbout) { updatePayload.about = nextAbout; } - if (nextNip05Handle !== currentNip05Handle) { - updatePayload.nip05Handle = nextNip05Handle; - } const hasPendingClearRequest = (currentDisplayName.length > 0 && nextDisplayName.length === 0) || @@ -175,26 +165,6 @@ export function ProfileSettingsCard({ ) : null} -
-
- - -
-
- - -
-
- -
- - setNip05HandleDraft(event.target.value)} - placeholder="alice@localhost" - value={nip05HandleDraft} - /> -
-

- Must match this relay's domain. Leave blank to clear your - current handle. -

-
-
+ + + +
+
+ + +
+
); diff --git a/desktop/tests/e2e/profile.spec.ts b/desktop/tests/e2e/profile.spec.ts index bd8145f7d..321064cc7 100644 --- a/desktop/tests/e2e/profile.spec.ts +++ b/desktop/tests/e2e/profile.spec.ts @@ -11,8 +11,6 @@ test("updates the relay-backed profile from settings", async ({ page }) => { const displayName = `Tyler QA ${stamp}`; const avatarUrl = `https://example.com/avatar-${stamp}.png`; const about = `Coordinating relay profile setup ${stamp}`; - const nip05Handle = `tyler-${stamp}@localhost`; - await page.goto("/"); await page.getByTestId("open-settings").click(); @@ -25,7 +23,6 @@ test("updates the relay-backed profile from settings", async ({ page }) => { await expect(page.getByTestId("profile-nip05")).toContainText("Not set"); await page.getByTestId("profile-display-name").fill(displayName); - await page.getByTestId("profile-nip05-input").fill(nip05Handle); await page.getByTestId("profile-avatar-url").fill(avatarUrl); await page.getByTestId("profile-about").fill(about); await page.getByTestId("profile-save").click(); @@ -33,10 +30,7 @@ test("updates the relay-backed profile from settings", async ({ page }) => { await expect(page.getByTestId("profile-display-name")).toHaveValue( displayName, ); - await expect(page.getByTestId("profile-nip05")).toContainText(nip05Handle); - await expect(page.getByTestId("profile-nip05-input")).toHaveValue( - nip05Handle, - ); + await expect(page.getByTestId("profile-nip05")).toContainText("Not set"); await expect(page.getByTestId("profile-avatar-url")).toHaveValue(avatarUrl); await expect(page.getByTestId("profile-about")).toHaveValue(about); @@ -50,10 +44,7 @@ test("updates the relay-backed profile from settings", async ({ page }) => { await expect(page.getByTestId("profile-display-name")).toHaveValue( displayName, ); - await expect(page.getByTestId("profile-nip05")).toContainText(nip05Handle); - await expect(page.getByTestId("profile-nip05-input")).toHaveValue( - nip05Handle, - ); + await expect(page.getByTestId("profile-nip05")).toContainText("Not set"); await expect(page.getByTestId("profile-avatar-url")).toHaveValue(avatarUrl); await expect(page.getByTestId("profile-about")).toHaveValue(about); });