perf(frontend): eliminate author profile waterfall — use thought.author directly

This commit is contained in:
2026-05-15 19:47:06 +02:00
parent 9ecbde019d
commit dadfe04934
10 changed files with 8581 additions and 114 deletions

View File

@@ -3,29 +3,19 @@ import { ThoughtCard } from "./thought-card";
interface ThoughtThreadProps {
thought: ThoughtThreadType;
authorDetails: Map<string, { avatarUrl?: string | null }>;
currentUser: Me | null;
isReply?: boolean;
}
export function ThoughtThread({
thought,
authorDetails,
currentUser,
isReply = false,
}: ThoughtThreadProps) {
const author = {
username: thought.author.username,
displayName: thought.author.displayName,
avatarUrl: thought.author.avatarUrl, // API-provided avatar (from DB COALESCE)
...authorDetails.get(thought.author.username), // override for local users
};
return (
<div id={`thought-thread-${thought.id}`} className="flex flex-col gap-0">
<ThoughtCard
thought={thought}
author={author}
currentUser={currentUser}
isReply={isReply}
/>
@@ -39,7 +29,6 @@ export function ThoughtThread({
<ThoughtThread
key={reply.id}
thought={reply}
authorDetails={authorDetails}
currentUser={currentUser}
isReply={true}
/>