Skip to content

feat(desktop): restore archive identity UI in profile panel#961

Open
tellaho wants to merge 3 commits into
mainfrom
tho/restore-archive-ui
Open

feat(desktop): restore archive identity UI in profile panel#961
tellaho wants to merge 3 commits into
mainfrom
tho/restore-archive-ui

Conversation

@tellaho

@tellaho tellaho commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

Restores the Archive / Unarchive entry point in UserProfilePanel that #917 stripped while landing the memory viewer. The NIP-IA backend stayed wired up — only the GUI was gone — so this is a pure UI restoration on top of the new UserProfilePanelSections layout.

Per Dawn's review of the conversation thread, the old full-width button doesn't fit inside the new compact quick-actions row, so it gets its own Manage section below ProfilePrimaryActions (option (b) from the design discussion).

What's restored

  • Manage section below the quick-actions row with a full-width Archive / Unarchive button. Label flips to "Archive agent" / "Unarchive agent" on bot profiles, otherwise "Archive identity" / "Unarchive identity".
  • "Archived on this relay" flair — amber pill under the display name (testid user-profile-archived-flair).
  • Three-path gate composition: canArchive = isSelf || isRelayAdminOrOwner || isOaOwnerOfViewee. The relay re-verifies authority on submit; this is a UX guard.
  • OA-owner kind:0 lookup skipped for self (the OA gate is for archiving other identities you own).
  • 5-case e2e gate matrix (identity-archive.spec.ts) — self / admin / OA-owner / no-authority / archived-toggle. Case 5 is the only one exercising the unarchive path.

Why option (b)

The old archive button was a full-width secondary <Button> at the bottom of the panel. The new layout uses a compact ProfilePrimaryActions row (Follow / Message / Edit). Putting Archive in that row would crowd a destructive-feeling action next to social actions; a dedicated Manage section keeps the gating composition intact, signals it as a different class of action, and gives the unarchive flair room to live nearby.

Test plan

  • tsc --noEmit clean
  • biome check clean on touched files
  • 627/627 unit tests pass
  • e2e: pnpm test:e2e (the identity-archive.spec.ts 5-case matrix)
  • Manual: archive a zombie agent from another user's profile (OA-owner path) and confirm the flair appears + Unarchive flips in
  • Manual: archive self and confirm the flair appears without the panel hiding the user
  • Manual: viewing a profile with no authority shows neither button nor flair
archive-ui-profile-panel archive-ui-archived-state

@tellaho tellaho force-pushed the tho/restore-archive-ui branch from d9f873d to 9074860 Compare June 10, 2026 22:55
@tellaho tellaho marked this pull request as ready for review June 11, 2026 00:12
tellaho and others added 3 commits June 12, 2026 12:01
Adds a Manage section below the quick-actions row with a full-width
Archive / Unarchive button, plus the "Archived on this relay" flair
under the displayName. Gated by the original three-path composition
(self / relay admin or owner / NIP-OA owner of viewee) — the relay
re-verifies authority on submit. Button label flips to "Archive agent"
on bot profiles.

Restores the 5-case e2e gate matrix that #917 dropped alongside the UI.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…hive hook

Introduces useIdentityArchive(pubkey) in features/identity-archive/hooks.ts,
composing the three gate queries (relay membership, OA owner, archived
status) plus currentPubkey, owning both mutations and the toasted
archive/unarchive callbacks. Returns { canArchive, isArchived, isPending,
archive, unarchive }.

Both call sites (ProfileSummaryView and ProfileManageSection) consume the
hook directly, removing the six drilled props from UserProfilePanel and the
now-dead hook calls, handlers, and imports. Gate composition is preserved
verbatim: isSelf || isRelayAdminOrOwner || isOaOwnerOfViewee.

Co-authored-by: Taylor Ho <taylorkmho@gmail.com>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Relocates the Archive/Unarchive Manage section so it renders after the
metadata field group instead of above the memories/channels ingress,
placing identity management at the bottom of the profile summary.

Co-authored-by: Taylor Ho <taylorkmho@gmail.com>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
@tellaho tellaho force-pushed the tho/restore-archive-ui branch from 9074860 to 234b8c1 Compare June 12, 2026 22:24
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.

1 participant