Skip to content

Commit 93fb1dc

Browse files
committed
feat: Chat Sidebar Conversation Items UI improvements
1 parent 6ffa578 commit 93fb1dc

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

tools/server/webui/src/lib/components/chat/ChatSidebar/ChatSidebarConversationItem.svelte

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
}: Props = $props();
2424
2525
let showDeleteDialog = $state(false);
26+
let showDropdown = $state(false);
2627
2728
function formatLastModified(timestamp: number) {
2829
const now = Date.now();
@@ -72,16 +73,18 @@
7273
</div>
7374

7475
<div class="actions flex items-center">
75-
<DropdownMenu.Root>
76+
<DropdownMenu.Root bind:open={showDropdown}>
7677
<DropdownMenu.Trigger
77-
class="hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex h-6 w-6 items-center justify-center rounded-md p-0 text-sm font-medium transition-colors focus:outline-none disabled:pointer-events-none disabled:opacity-50"
78+
class="{showDropdown
79+
? 'show-dropdown'
80+
: ''} hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex h-6 w-6 cursor-pointer items-center justify-center rounded-md p-0 text-sm font-medium transition-colors focus:outline-none disabled:pointer-events-none disabled:opacity-50"
7881
>
7982
<MoreHorizontal class="h-3 w-3" />
8083

8184
<span class="sr-only">More actions</span>
8285
</DropdownMenu.Trigger>
8386

84-
<DropdownMenu.Content align="end" class="w-48">
87+
<DropdownMenu.Content align="end" class="z-999 w-48">
8588
<DropdownMenu.Item onclick={handleEdit} class="flex items-center gap-2">
8689
<Pencil class="h-4 w-4" />
8790
Edit
@@ -124,17 +127,13 @@
124127
</div>
125128
</button>
126129

127-
<style lang="postcss">
128-
.actions {
129-
& > * {
130-
width: 0;
130+
<style>
131+
button {
132+
:global([data-slot='dropdown-menu-trigger']:not([data-state='open'])) {
131133
opacity: 0;
132-
transition: all 0.2s ease;
133-
overflow: hidden;
134134
}
135135
136-
:global(button:hover) & > * {
137-
width: auto;
136+
&:is(:hover) :global([data-slot='dropdown-menu-trigger']) {
138137
opacity: 1;
139138
}
140139
}

0 commit comments

Comments
 (0)