Skip to content

fix(profile): display-name in QR title, verify NIP-05/lud16, normalize CLINK CTA weight#423

Merged
spe1020 merged 1 commit into
zapcooking:mainfrom
dmnyc:fix/profile-display-name-and-validation
Jun 10, 2026
Merged

fix(profile): display-name in QR title, verify NIP-05/lud16, normalize CLINK CTA weight#423
spe1020 merged 1 commit into
zapcooking:mainfrom
dmnyc:fix/profile-display-name-and-validation

Conversation

@dmnyc

@dmnyc dmnyc commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Three small, related polish fixes on the profile surface.

1. Use display name in the profile QR/share modal title

The QR/share modal that opens from the profile page (e.g. daniel's Profile) was reading profile.name (the short handle) instead of the full display name. Now it prefers displayNamedisplay_namename, so the title reads The Daniel 🖖's Profile for users who have a display name set.

src/routes/user/[slug]/+page.svelte — one-line change.

2. Verify NIP-05 and Lightning Address inputs in the profile editor

The profile editor's NIP-05 and Lightning Address fields previously accepted anything — including malformed addresses like daniel@nodestrich or syntactically-valid-but-wrong ones like daniel@nodestrich.co (which has a real TLD but doesn't map to your pubkey).

Each input now has five states with clear visual indication:

State Border Trailing icon Helper text
Empty default
Regex-invalid (e.g. foo@bar) red red ⚠ "Use the form name@example.com"
Resolving default spinner
Verified green green ✓
Unresolved amber amber ⚠ reason from the server
  • NIP-05 fetches https://<domain>/.well-known/nostr.json?name=<local> and only goes green if the returned names[local] matches the signed-in pubkey. Otherwise it shows a specific reason (<domain> has no entry for "<local>" / Domain points to a different pubkey than yours / Could not reach <domain> (<status>)).
  • Lightning Address fetches https://<domain>/.well-known/lnurlp/<local> and checks the response is a valid LNURL payRequest with a callback.

Fetches are debounced 500 ms and aborted on the next keystroke. The Save button is disabled only on regex-invalid (hard fail); unresolved is a soft warning because some valid lnurlp endpoints don't send CORS headers and would otherwise be unfairly blocked.

src/components/ProfileEditModal.svelte — adds verification handlers, status state, and per-state markup on both inputs.

3. Normalize the CLINK CTA weight on the profile page

<NofferButton variant="cta"> on the profile page was using font-weight: 700 (bold) while the Send Zap and Copy npub buttons it sits next to use Tailwind font-medium (500). The CLINK button visually dominated the row. Moved the heavy weight to the inline pill variant (where it competes with body text and needs the punch) and set the CTA variant to 500 so the row reads as peers.

src/components/clink/NofferButton.svelte.

Test plan

  • Open any profile's QR/share modal — title shows the display name with emoji, not the username
  • Profile editor → NIP-05: type name@, see red ⚠ + helper text; type a real NIP-05 you own, see green ✓; type one mapped to someone else's domain, see amber ⚠ + "Domain points to a different pubkey than yours"
  • Profile editor → Lightning Address: same shape; verifies against /.well-known/lnurlp
  • Save button disabled while either field is regex-invalid
  • Profile page → CLINK button weight visually matches Send Zap, not bolder

…ize CLINK CTA weight

- User profile "...'s Profile" modal title now prefers displayName /
  display_name before falling back to the short name, so users see
  their full name instead of the username handle.
- NIP-05 Identifier and Lightning Address inputs in the profile editor
  now show live verification: empty -> nothing, regex-invalid -> red
  warning + helper text + Save disabled, regex-valid -> spinner while
  fetching, resolved -> green check, resolved-but-wrong -> amber
  warning with a helper message. NIP-05 hits the domain's
  /.well-known/nostr.json and confirms the returned pubkey matches the
  signed-in user; lud16 hits /.well-known/lnurlp and checks the
  response is a valid LNURL payRequest. Fetches are debounced 500 ms
  and aborted on the next keystroke.
- NofferButton CTA variant dropped from font-weight 700 to 500 so it
  matches the Send Zap / Copy npub buttons it sits next to on the
  profile page. The inline pill variant keeps its heavier weight
  because it competes with body text and needs the punch.
@spe1020 spe1020 merged commit 4b2048e into zapcooking:main Jun 10, 2026
4 checks passed
@dmnyc dmnyc deleted the fix/profile-display-name-and-validation branch June 11, 2026 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants