fix: pass profiles to mention autocomplete in threads and forum composers (#541)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Wes
2026-05-11 23:12:10 +00:00
committed by GitHub
co-authored by Claude Opus 4.6
parent 23f1637728
commit 19f290651a
5 changed files with 8 additions and 1 deletions
@@ -21,6 +21,7 @@ import {
} from "@/features/messages/ui/MentionAutocomplete";
import { MessageComposerToolbar } from "@/features/messages/ui/MessageComposerToolbar";
import type { ChannelMember } from "@/shared/api/types";
import type { UserProfileLookup } from "@/features/profile/lib/identity";
import { Button } from "@/shared/ui/button";
type ForumComposerProps = {
@@ -38,6 +39,7 @@ type ForumComposerProps = {
) => undefined | Promise<unknown>;
/** When true, autocomplete renders below the input (for top-of-view composers). */
autocompleteBelow?: boolean;
profiles?: UserProfileLookup;
};
export function ForumComposer({
@@ -49,6 +51,7 @@ export function ForumComposer({
onCancel,
onSubmit,
autocompleteBelow = false,
profiles,
}: ForumComposerProps) {
const [content, setContent] = React.useState("");
const contentRef = React.useRef(content);
@@ -62,7 +65,7 @@ export function ForumComposer({
setIsFormattingOpen(pressed);
}, []);
const mentions = useMentions(channelId, members);
const mentions = useMentions(channelId, members, profiles);
const channelLinks = useChannelLinks();
const media = useMediaUpload();
@@ -284,6 +284,7 @@ export function ForumThreadPanel({
isSending={isSendingReply}
onSubmit={onReply}
placeholder="Reply to this post..."
profiles={profiles}
/>
</div>
</div>
@@ -161,6 +161,7 @@ export function ForumView({
setIsComposerOpen(false);
}}
placeholder="Write your post..."
profiles={profiles}
/>
) : (
<button
@@ -308,6 +308,7 @@ export function MessageThreadPanel({
onEditSave={onEditSave}
onSend={onSend}
placeholder={`Reply in thread to ${threadHead.author}`}
profiles={profiles}
replyTarget={composerReplyTarget}
toolbarExtraActions={toolbarExtraActions}
typingParentEventId={threadHead.id}
@@ -406,6 +406,7 @@ export function PulseView({ currentPubkey }: PulseViewProps) {
onSubmit={(content, mentionPubkeys, mediaTags) =>
publishMutation.mutateAsync({ content, mentionPubkeys, mediaTags })
}
profiles={mentionProfiles}
/>
</div>
</div>