Skip to content

fix(desktop): make @mention clicks reliably open the profile panel#1705

Merged
baxen merged 1 commit into
mainfrom
click-on-at-mention
Jul 10, 2026
Merged

fix(desktop): make @mention clicks reliably open the profile panel#1705
baxen merged 1 commit into
mainfrom
click-on-at-mention

Conversation

@matt2e

@matt2e matt2e commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Clicking an @mention chip only worked in the main message timeline, and only when the mention text matched the profile's display name. Chips in forum posts, forum replies, the home feed, and inbox rows were inert, and a mention rendered from a kind-0 name alias never resolved to a pubkey. This PR makes mention chips reliably open the right-hand profile panel everywhere they render interactively.

Changes

  • Single-pass alias resolution: resolveMentionProps resolves mention render names and the name→pubkey click map from one alias set per mentioned user — display name, kind-0 name, and NIP-05 local part — so any alias the app renders resolves back to its pubkey, case-insensitively.
  • Kind-0 name plumbed through: carry the name field through the Tauri profile summary (UserProfileSummaryInfo.name); split the profile API wrappers out of tauri.ts into tauriProfiles.ts to stay under the file-size ratchet.
  • All interactive surfaces wired: mentionPubkeysByName now reaches forum post cards, the forum thread panel (post + replies), the home feed, and inbox rows. Markdown's memo compares the map by value (shallowRecordEqual) so call sites that rebuild it inline don't defeat memoization.
  • Honest affordance: chips get pointer cursor + hover styles only when clicking actually opens a profile (interactive surface and resolved pubkey).
  • ForumView profile fetches: fetch profiles for mention-tag pubkeys so a mentioned user who never authored a post no longer renders as a dead chip.
  • Profile panel in forum channels: new ForumChannelContent hosts the user-profile auxiliary pane next to ForumView (forums replace ChannelPane, which hosts the panel for message channels — opening a profile there previously showed nothing). Removes the matching MembersSidebar forum workaround.
  • Clippy fixes: fix six pre-existing Rust 1.95 clippy lints in desktop/src-tauri (unused import, doc indentation, slice::from_ref, is_none_or) that blocked just ci and the pre-push hook.

Tests

  • Unit coverage for alias resolution: display name, kind-0 name, NIP-05 local part, _ root skip, mention reference tags, case normalization (resolveMentionNames.test.mjs).
  • Playwright specs clicking mention chips in the timeline (display-name and kind-0-name aliases) and in a forum post, asserting the profile panel opens.

Known limitation

NIP-27 nostr:npub1... references are not linkified (out of scope per plan).

🤖 Generated with Claude Code

Clicking an @mention chip only worked in the main message timeline, and
only when the mention text matched the profile's display name. Chips in
forum posts, forum replies, the home feed, and inbox rows were inert,
and a mention rendered from a kind-0 `name` alias never resolved to a
pubkey. As requested in the plan, mention chips now reliably open the
right-hand profile panel everywhere they render interactively:

- Resolve mention names and the name->pubkey click map in a single
  pass (`resolveMentionProps`) from one alias set per mentioned user:
  display name, kind-0 `name`, and NIP-05 local part. Any alias the
  app renders now resolves back to its pubkey, case-insensitively.
- Carry the kind-0 `name` field through the Tauri profile summary
  (`UserProfileSummaryInfo.name`) so the frontend sees it; split the
  profile API wrappers out of `tauri.ts` into `tauriProfiles.ts` to
  stay under the file-size ratchet (limit banked 1360 -> 1241).
- Wire `mentionPubkeysByName` into every interactive Markdown surface:
  forum post cards, forum thread panel (post + replies), home feed,
  and inbox rows. `Markdown`'s memo compares the map by value
  (`shallowRecordEqual`) so call sites that rebuild it inline do not
  defeat memoization.
- Honest affordance: chips get pointer cursor + hover styles only when
  clicking actually opens a profile (interactive surface and resolved
  pubkey).
- Fetch profiles for mention-tag pubkeys in ForumView - a mentioned
  user who never authored a post previously rendered as a dead chip.
- Host the profile panel in forum channels: new `ForumChannelContent`
  renders the user-profile auxiliary pane next to ForumView (forums
  replace ChannelPane, which hosts the panel for message channels, so
  opening a profile there previously showed nothing). The matching
  MembersSidebar forum workaround is removed.
- Tests: unit coverage for alias resolution (display name, kind-0
  name, NIP-05 local part, `_` root skip, mention reference tags, case
  normalization); Playwright specs clicking mention chips in the
  timeline (display-name and kind-0-name aliases) and in a forum post,
  asserting the profile panel opens.
- Fix six pre-existing Rust 1.95 clippy lints in desktop/src-tauri
  (unused import, doc indentation, `slice::from_ref`, `is_none_or`)
  that blocked `just ci` and the pre-push hook.

Known limitation (out of scope per plan): NIP-27 `nostr:npub1...`
references are not linkified.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
@matt2e matt2e requested a review from a team as a code owner July 10, 2026 08:22

@baxen baxen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@baxen baxen merged commit 5f0d830 into main Jul 10, 2026
25 checks passed
@baxen baxen deleted the click-on-at-mention branch July 10, 2026 16:15
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