diff --git a/src/lib/components/layout/Sidebar/ChatItem.svelte b/src/lib/components/layout/Sidebar/ChatItem.svelte index 62878d2efe..db5bd995b9 100644 --- a/src/lib/components/layout/Sidebar/ChatItem.svelte +++ b/src/lib/components/layout/Sidebar/ChatItem.svelte @@ -141,10 +141,12 @@ ? ($settings?.highContrastMode ?? false) ? 'bg-black/[0.035] dark:bg-white/[0.055] selected' : 'bg-black/[0.035] dark:bg-white/[0.045] selected' - : ' hover:bg-gray-50 dark:hover:bg-gray-900 group-hover:bg-gray-50 dark:group-hover:bg-gray-900' + : $mobile + ? '' + : ' hover:bg-gray-50 dark:hover:bg-gray-900 group-hover:bg-gray-50 dark:group-hover:bg-gray-900' } whitespace-nowrap text-ellipsis transition`; - const selectChatHandler = () => { + const selectChatHandler = (event?: MouseEvent) => { openPreview = false; dispatch('select'); @@ -152,13 +154,15 @@ selectedFolder.set(null); } - if ($mobile) { - showSidebar.set(false); - } - // Optimistically mark as read in UI when clicked unread = false; lastReadAt = Date.now() / 1000; + + if ($mobile) { + event?.preventDefault(); + void goto(`/c/${id}`); + showSidebar.set(false); + } }; const renameChatFromDoubleClick = async (e: MouseEvent) => { @@ -525,14 +529,14 @@ dir="auto" class="text-left self-center overflow-hidden w-full h-5 truncate {unread ? 'font-normal text-gray-800 dark:text-gray-200' - : ''} {showInlineActions && !readonly ? 'pr-12' : ''}" + : ''} {($mobile || showInlineActions) && !readonly ? 'pr-12' : ''}" > {title} - {#if (updatedAt ?? createdAt) && !showInlineActions} + {#if (updatedAt ?? createdAt) && !showInlineActions && !($mobile && !readonly)}