mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user