feat(messaging-ui): channels — browse, join, leave, create (contract + mock + UI)
Adds a third membership beyond dm/group: a discoverable, joinable room. - contract: Membership += 'channel'; Conversation.topic; ChannelSummary + CreateChannelInput; optional adapter methods browseChannels/createChannel/ joinChannel/leaveChannel (capability-degrading — absent hides the UI) - MockAdapter implements them (seeds a joined public, a joinable public, and a private channel); listConversations now returns only threads I'm in - useChannels hook (browse/create/join/leave + supported flag) - UI: sidebar sections (Channels vs Direct messages), a + that opens a ChannelBrowser (join + create), # / lock glyphs; themeable styles - KernelClientAdapter passes channel membership + topic through - 4 channel tests (mock browse/join/create + render browse→join); 52 total green Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -188,7 +188,9 @@ export class KernelClientAdapter implements MessagingAdapter {
|
||||
|
||||
private toConversation(t: ThreadSummary): Conversation {
|
||||
const others = t.participants.filter((p) => p !== this.me);
|
||||
const membership: Membership | null = t.membership === 'dm' || t.membership === 'group' ? t.membership : null;
|
||||
const membership: Membership | null =
|
||||
t.membership === 'dm' || t.membership === 'group' || t.membership === 'channel' ? t.membership : null;
|
||||
const topic = (t.metadata as { topic?: string } | null)?.topic;
|
||||
return {
|
||||
threadId: t.threadId,
|
||||
title: t.subject?.trim() || others.join(', ') || 'Conversation',
|
||||
@@ -196,6 +198,7 @@ export class KernelClientAdapter implements MessagingAdapter {
|
||||
membership,
|
||||
participants: [...t.participants],
|
||||
unread: t.unread,
|
||||
...(topic != null ? { topic } : {}),
|
||||
...(t.lastMessage ? { lastMessage: t.lastMessage } : {}),
|
||||
...(t.lastAt ? { lastAt: t.lastAt } : {}),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user