From f5e8d4d5a004115489c35725408b057e24dfe318 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Mon, 1 Dec 2025 13:34:57 -0500 Subject: [PATCH] refac --- backend/open_webui/models/users.py | 2 +- .../layout/Sidebar/ChannelItem.svelte | 37 ++++++++++++++++--- 2 files changed, 32 insertions(+), 7 deletions(-) diff --git a/backend/open_webui/models/users.py b/backend/open_webui/models/users.py index ba56b74ece..692633e64b 100644 --- a/backend/open_webui/models/users.py +++ b/backend/open_webui/models/users.py @@ -188,7 +188,7 @@ class UserIdNameResponse(BaseModel): name: str -class UserIdNameStatusResponse(BaseModel): +class UserIdNameStatusResponse(UserStatus): id: str name: str is_active: Optional[bool] = None diff --git a/src/lib/components/layout/Sidebar/ChannelItem.svelte b/src/lib/components/layout/Sidebar/ChannelItem.svelte index 524724c9a1..866dfb13cf 100644 --- a/src/lib/components/layout/Sidebar/ChannelItem.svelte +++ b/src/lib/components/layout/Sidebar/ChannelItem.svelte @@ -15,6 +15,7 @@ import Hashtag from '$lib/components/icons/Hashtag.svelte'; import Users from '$lib/components/icons/Users.svelte'; import XMark from '$lib/components/icons/XMark.svelte'; + import Emoji from '$lib/components/common/Emoji.svelte'; export let onUpdate: Function = () => {}; @@ -131,14 +132,38 @@ {/if} -
+
{#if channel?.name} - {channel.name} + + {channel.name} + {:else} - {channel?.users - ?.filter((u) => u.id !== $user?.id) - .map((u) => u.name) - .join(', ')} + + {channel?.users + ?.filter((u) => u.id !== $user?.id) + .map((u) => u.name) + .join(', ')} + + + {#if channel?.users?.length === 2} + {@const dmUser = channel.users.find((u) => u.id !== $user?.id)} + + {#if dmUser?.status_emoji || dmUser?.status_message} + + {#if dmUser?.status_emoji} +
+ +
+ {/if} + +
+ {dmUser?.status_message} +
+
+ {/if} + {/if} {/if}