fix(desktop): make @mention clicks reliably open the profile panel#1705
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
namealias never resolved to a pubkey. This PR makes mention chips reliably open the right-hand profile panel everywhere they render interactively.Changes
resolveMentionPropsresolves mention render names and the name→pubkey click map from one alias set per mentioned user — display name, kind-0name, and NIP-05 local part — so any alias the app renders resolves back to its pubkey, case-insensitively.nameplumbed through: carry thenamefield through the Tauri profile summary (UserProfileSummaryInfo.name); split the profile API wrappers out oftauri.tsintotauriProfiles.tsto stay under the file-size ratchet.mentionPubkeysByNamenow 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.ForumChannelContenthosts the user-profile auxiliary pane next toForumView(forums replaceChannelPane, which hosts the panel for message channels — opening a profile there previously showed nothing). Removes the matchingMembersSidebarforum workaround.desktop/src-tauri(unused import, doc indentation,slice::from_ref,is_none_or) that blockedjust ciand the pre-push hook.Tests
_root skip, mention reference tags, case normalization (resolveMentionNames.test.mjs).Known limitation
NIP-27
nostr:npub1...references are not linkified (out of scope per plan).🤖 Generated with Claude Code