feat(P4B.T7): MessageBubble renders whiteboard kind with Öffnen button
Adds a whiteboard branch to the MessageBubble ternary chain that renders a card with an icon, label, and Öffnen button dispatching the chatapp:open-whiteboard CustomEvent. ConversationPage now listens for that event via a useEffect and calls setOpenWhiteboardId to open the modal. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -463,6 +463,15 @@ export function ConversationPage() {
|
||||
};
|
||||
}, [id, setActiveConversation]);
|
||||
|
||||
useEffect(() => {
|
||||
const onOpen = (e: Event) => {
|
||||
const detail = (e as CustomEvent<{ id?: string }>).detail;
|
||||
if (detail?.id) setOpenWhiteboardId(detail.id);
|
||||
};
|
||||
window.addEventListener('chatapp:open-whiteboard', onOpen);
|
||||
return () => window.removeEventListener('chatapp:open-whiteboard', onOpen);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (id && messages.length > 0) markRead(id);
|
||||
}, [id, messages.length, markRead]);
|
||||
|
||||
Reference in New Issue
Block a user