This commit is contained in:
Timothy Jaeryang Baek committed 2026-08-10 21:00:01 -06:00
1 parent 943294df9a
commit d6679082e5
1 file changed
+17 -10
@@ -141,10 +141,12 @@
? ($settings?.highContrastMode ?? false) ? ($settings?.highContrastMode ?? false)
? 'bg-black/[0.035] dark:bg-white/[0.055] selected' ? 'bg-black/[0.035] dark:bg-white/[0.055] selected'
: 'bg-black/[0.035] dark:bg-white/[0.045] 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`; } whitespace-nowrap text-ellipsis transition`;
const selectChatHandler = () => { const selectChatHandler = (event?: MouseEvent) => {
openPreview = false; openPreview = false;
dispatch('select'); dispatch('select');
@@ -152,13 +154,15 @@
selectedFolder.set(null); selectedFolder.set(null);
} }
if ($mobile) {
showSidebar.set(false);
}
// Optimistically mark as read in UI when clicked // Optimistically mark as read in UI when clicked
unread = false; unread = false;
lastReadAt = Date.now() / 1000; lastReadAt = Date.now() / 1000;
if ($mobile) {
event?.preventDefault();
void goto(`/c/${id}`);
showSidebar.set(false);
}
}; };
const renameChatFromDoubleClick = async (e: MouseEvent) => { const renameChatFromDoubleClick = async (e: MouseEvent) => {
@@ -525,14 +529,14 @@
dir="auto" dir="auto"
class="text-left self-center overflow-hidden w-full h-5 truncate {unread class="text-left self-center overflow-hidden w-full h-5 truncate {unread
? 'font-normal text-gray-800 dark:text-gray-200' ? 'font-normal text-gray-800 dark:text-gray-200'
: ''} {showInlineActions && !readonly ? 'pr-12' : ''}" : ''} {($mobile || showInlineActions) && !readonly ? 'pr-12' : ''}"
> >
{title} {title}
</div> </div>
</div> </div>
<!-- Time ago indicator --> <!-- Time ago indicator -->
{#if (updatedAt ?? createdAt) && !showInlineActions} {#if (updatedAt ?? createdAt) && !showInlineActions && !($mobile && !readonly)}
<div class="shrink-0 self-center text-[0.625rem] text-gray-400 dark:text-gray-500 pl-2"> <div class="shrink-0 self-center text-[0.625rem] text-gray-400 dark:text-gray-500 pl-2">
{formatTimeAgo((updatedAt ?? createdAt) as number)} {formatTimeAgo((updatedAt ?? createdAt) as number)}
</div> </div>
@@ -661,9 +665,11 @@
{#if !readonly} {#if !readonly}
<div <div
id="sidebar-chat-item-menu" id="sidebar-chat-item-menu"
class="{showInlineActions class="{$mobile
? 'selected' ? 'selected'
: 'invisible group-hover:visible'} absolute {className === 'pr-2' : showInlineActions
? 'selected'
: 'invisible group-hover:visible'} absolute {className === 'pr-2'
? 'right-[0.5rem]' ? 'right-[0.5rem]'
: 'right-1'} inset-y-0 mr-1.5 flex items-center" : 'right-1'} inset-y-0 mr-1.5 flex items-center"
> >
@@ -739,6 +745,7 @@
}} }}
> >
<button <button
type="button"
aria-label="Chat Menu" aria-label="Chat Menu"
class="flex size-5 items-center justify-center self-center dark:hover:text-white transition m-0" class="flex size-5 items-center justify-center self-center dark:hover:text-white transition m-0"
on:click={() => { on:click={() => {