fix(desktop): separate Nostr name from display name
Summary
- add an editable Nostr
name/handle alongside the richerdisplay_namein first-community onboarding and Profile settings - carry both fields through the Desktop TypeScript and Tauri contracts while keeping the public key as canonical identity
- patch the existing raw kind-0 object so unrelated and unmodeled metadata survives profile edits, failing closed when prior metadata is malformed
- keep cache, E2E bridge, compatibility fallbacks, avatar handling, canonical post-save readback, and agent activity labels aligned with the two-field model
- add focused Rust, unit, and browser regression coverage, including delayed profile seeding after an explicit avatar clear
Related issue
Fixes #2796
Related preservation work: #2534, #2545, #2606.
Root cause
Buzz Desktop labels the onboarding value as a username but publishes it as display_name. The supported UI has no independent name field, even though existing metadata can contain one. The prior update path also reconstructed a modeled subset of kind-0 metadata, which could discard unrelated fields while adding the missing editor.
This patch treats name and display_name as independent metadata and updates the existing raw JSON object before signing the replacement kind-0 event. Compatibility fallback from display_name to name is limited to presentation boundaries, including sidebar, identity lookup, profile activity, and fallback agent-session labels.
User impact
Users can represent a short Nostr handle separately from their human-facing display name without changing keys, roles, authentication, relay admission, or NIP-05. Existing display-name-only and name-only profiles remain compatible, and editing one modeled field preserves the other fields.
Testing
Fresh post-rebase evidence at abeeb060a against upstream/main 63496cc1d:
git diff --check upstream/main...HEAD- 3,786/3,786 Desktop frontend tests passed
- Desktop TypeScript typecheck passed
- Biome checked 1,696 Desktop files with no errors
- Desktop file-size ratchet passed with
CHECK_FILE_SIZES_BASE=upstream/main - focused name-only agent presentation regressions passed: 6/6
- profile activity uses the raw
name - fallback agent session uses the raw
name - existing activity return-target tests remain green
- profile activity uses the raw
The pre-rebase branch also passed the complete just desktop-ci gate, focused Rust profile tests, and four focused Playwright profile/onboarding tests. Fresh GitHub checks on the rebased branch are the authority for the full current snapshot.
The patch is currently test_proven for the Desktop frontend and focused profile paths. It does not claim supported-path runtime or end-to-end signed-event proof.
Manual test plan
- Create or import a profile containing different
nameanddisplay_namevalues. - Open Profile settings and confirm both controls display the exact stored values.
- Edit only the handle, save, reopen settings, and confirm the display name, avatar, about, NIP-05, and unrelated kind-0 metadata remain unchanged.
- Edit only the display name and repeat the preservation check.
- Run first-community onboarding with distinct handle and display-name values and inspect the signed kind-0 readback.
- Clear the avatar before a delayed profile seed resolves and confirm the old avatar is not restored.
- Open activity for a name-only NIP-OA agent without a managed/relay agent record and confirm its
nameis shown instead ofAgent.
Non-goals
- NIP-05 provisioning or verification UI
- globally unique usernames
- key, signer, role, authentication, or relay changes
- public-relay profile replication
- database migrations
Profile settings screenshots
Before — Buzz v0.5.0
The supported Profile editor exposes only display_name.

After — PR #3342
The same editor exposes an independent Nostr name handle while retaining the richer display name and profile description.

@codex review