Skip to content

Commit 535c371

Browse files
hendrikebbersclaude
andcommitted
fix(components): address review findings
- MarkdownView: add useEffect to sync content prop changes - UserMultiSelect: remove unnecessary array copy in filteredUsers - UserMultiSelect: remove dead email guard (email is always a string) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 40afae0 commit 535c371

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

src/components/markdown-view.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"use client";
22

3+
import { useEffect } from "react";
34
import { useEditor, EditorContent } from "@tiptap/react";
45
import StarterKit from "@tiptap/starter-kit";
56
import Link from "@tiptap/extension-link";
@@ -34,5 +35,11 @@ export function MarkdownView({ content }: MarkdownViewProps) {
3435
},
3536
});
3637

38+
useEffect(() => {
39+
if (editor) {
40+
editor.commands.setContent(content);
41+
}
42+
}, [content, editor]);
43+
3744
return <EditorContent editor={editor} />;
3845
}

src/components/user-multi-select.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export function UserMultiSelect({
3434
u.name.toLowerCase().includes(search.toLowerCase()) ||
3535
u.email.toLowerCase().includes(search.toLowerCase()),
3636
)
37-
: [...users];
37+
: users;
3838

3939
return (
4040
<Popover open={open} onOpenChange={setOpen}>
@@ -119,9 +119,7 @@ export function UserMultiSelect({
119119
<UserAvatar user={user} size="md" />
120120
<div className="flex flex-col items-start overflow-hidden">
121121
<span className="truncate font-medium">{user.name}</span>
122-
{user.email && (
123-
<span className="text-muted-foreground truncate text-xs">{user.email}</span>
124-
)}
122+
<span className="text-muted-foreground truncate text-xs">{user.email}</span>
125123
</div>
126124
</button>
127125
);

0 commit comments

Comments
 (0)