Skip to content

Commit 3ccaba8

Browse files
committed
feat: prompt, scroll, responsive UX + fixes, cleaning, restyle threads hover
1 parent 70bb857 commit 3ccaba8

16 files changed

Lines changed: 31 additions & 25 deletions

apps/frontend/app/assets/css/scrollbar.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,8 @@
1515
background-clip: content-box;
1616
-webkit-background-clip: content-box;
1717
}
18+
19+
/* ::-webkit-scrollbar-track {
20+
background: hsl(var(--accent)/.2);
21+
border-radius: 4px;
22+
} */

apps/frontend/app/components/chat/ChatInterface.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ function doScrollBottom({ smooth = true, maybe = false, tries = 0, lastScrollTop
407407
</script>
408408

409409
<template>
410-
<div class="relative flex flex-col">
410+
<div class="relative overflow-hidden">
411411
<VueLenis ref="lenisRef" class="h-screen overflow-y-scroll px-4">
412412
<ChatInterfaceBackground v-bind="{ messages, isFetching }" />
413413
<div class="mx-auto h-full max-w-full lg:max-w-4xl">

apps/frontend/app/components/chat/ChatSidebar.vue

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ const [DefineThreadLiItem, ReuseThreadLiItem] = createReusableTemplate<{ thread:
207207
<!-- Using [&.active] instead of :active-class because of reactivity bug -->
208208
<NuxtLink
209209
:to="`/chat/${thread._id}`"
210-
class="group/thread relative block flex items-center gap-2 overflow-hidden rounded-md p-2 px-3 text-sm [&.router-link-exact-active]:bg-primary/10 hover:bg-primary/20"
210+
class="group/thread relative block flex items-center gap-2 overflow-hidden rounded-md p-2 px-3 text-sm $BGCOLOR=$primary-200 [&.router-link-exact-active]:(bg-[hsl(var(--BGCOLOR)/0.3)]) hover:(bg-[hsl(var(--BGCOLOR)/0.7)]) dark:$BGCOLOR=$primary-800"
211211
@mousedown.left="navigateTo(`/chat/${thread._id}`);"
212212
@click="navigateTo(`/chat/${thread._id}`); sidebarContext.setOpenMobile(false)"
213213
>
@@ -216,7 +216,7 @@ const [DefineThreadLiItem, ReuseThreadLiItem] = createReusableTemplate<{ thread:
216216
<FrozenIconButton v-if="thread.frozen" :thread />
217217
</div>
218218

219-
<Tooltip :delay-duration="500">
219+
<Tooltip>
220220
<TooltipTrigger as-child>
221221
<div class="truncate">
222222
{{ thread.title }}
@@ -227,11 +227,12 @@ const [DefineThreadLiItem, ReuseThreadLiItem] = createReusableTemplate<{ thread:
227227
</TooltipContent>
228228
</Tooltip>
229229

230-
<LiquidGlassDiv
231-
class="right-0 top-0 h-full flex translate-x-[calc(100%+1rem)] items-center gap-1 px-2 pr-1 transition-transform will-change-transform $c-radius=6px absolute! group-hover/thread:translate-x-0"
230+
<div
231+
class="right-0 top-0 h-full flex translate-x-[calc(100%+1rem)] items-center gap-1 bg-[hsl(var(--BGCOLOR))] px-2 pr-1 transition-transform will-change-transform absolute! group-hover/thread:translate-x-0"
232232
@click.stop.prevent
233233
>
234-
<Tooltip :delay-duration="500">
234+
<div class="pointer-events-none absolute bottom-0 right-[100%] top-0 h-12 w-8 from-[hsl(var(--BGCOLOR))] to-transparent bg-gradient-to-l opacity-0 group-hover/thread:opacity-100" />
235+
<Tooltip>
235236
<TooltipTrigger as-child>
236237
<Button
237238
tabindex="-1" variant="ghost" size="icon" class="size-7 transition-none hover:bg-surface-200/20!"
@@ -244,9 +245,8 @@ const [DefineThreadLiItem, ReuseThreadLiItem] = createReusableTemplate<{ thread:
244245
<p>{{ pinned ? $t('chat.thread.unpin') : $t('chat.thread.pin') }}</p>
245246
</TooltipContent>
246247
</Tooltip>
247-
248248
<ReuseDeleteBtn :thread />
249-
</LiquidGlassDiv>
249+
</div>
250250
</NuxtLink>
251251
</ContextMenuTrigger>
252252
<ContextMenuContent>

apps/frontend/app/components/chat/interface/AgentSelector.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const activeAgentDisplay = computed(() => displayActiveAgent(chatContext.activeA
99

1010
<template>
1111
<DropdownMenu>
12-
<Tooltip :delay-duration="500">
12+
<Tooltip>
1313
<TooltipTrigger as-child>
1414
<DropdownMenuTrigger as-child>
1515
<Button variant="ghost" size="sm" class="h-fit w-40 flex items-center justify-between gap-1 border-x-3px border-primary border-opacity-80 px-2 py-1 -ml-1.5 light:border-primary-600 hover:bg-accent/30">

apps/frontend/app/components/chat/interface/CardBranchOffButton.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const emit = defineEmits<{
1313
</script>
1414

1515
<template>
16-
<Tooltip v-show="message.isStreaming === false" :delay-duration="500">
16+
<Tooltip v-show="message.isStreaming === false">
1717
<TooltipTrigger as-child>
1818
<Button variant="ghost" size="icon" class="size-7" @click="emit('click')">
1919
<Split />

apps/frontend/app/components/chat/interface/CardCopyButton.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const {
77
</script>
88

99
<template>
10-
<Tooltip :delay-duration="500">
10+
<Tooltip>
1111
<TooltipTrigger as-child>
1212
<CodeCopy :code="message.content" class="hover:text-accent-foreground hover:bg-accent!" />
1313
</TooltipTrigger>

apps/frontend/app/components/chat/interface/PrompterArea.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,10 @@ function handleSubmit({ confirmMultiStream = false }) {
7171
@keydown.enter.exact="(e) => {
7272
if (!sidebarContext.isMobile.value) {
7373
e.preventDefault()
74-
handleSubmit({ })
74+
handleSubmit({})
7575
}
7676
}"
77+
@keydown.enter.ctrl.exact="handleSubmit({})"
7778
/>
7879
<div class="flex items-center justify-between">
7980
<div class="flex items-center">
@@ -85,7 +86,7 @@ function handleSubmit({ confirmMultiStream = false }) {
8586
class="i-hugeicons:upload-square-01 enabled:bg-mainGradient disabled:bg-surface-500"
8687
:class="chatContext.insaneUI.value ? 'enabled:animate-spin' : 'motion-safe:enabled:animate-bounce'"
8788
:disabled="!chatInputTA"
88-
@click="handleSubmit({ })"
89+
@click="handleSubmit({})"
8990
/>
9091
</div>
9192
</form>

apps/frontend/app/components/chat/interface/TopRightQuickSnacks.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const chatContext = useChatContext()
44

55
<template>
66
<div class="absolute right-3 top-3 hidden items-center lg:flex">
7-
<Tooltip :delay-duration="500">
7+
<Tooltip>
88
<TooltipTrigger as-child>
99
<Button
1010
variant="ghost" size="icon"

apps/frontend/app/components/chat/thread/BranchIconButton.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ if (!thread.parentThread)
1515
</script>
1616

1717
<template>
18-
<Tooltip :delay-duration="500">
18+
<Tooltip>
1919
<TooltipTrigger as-child>
2020
<NuxtLink
2121
:to="`/chat/${thread.parentThread}`"

apps/frontend/app/components/chat/thread/DeleteThreadAlertDialog.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const { $auth } = useNuxtApp()
3232

3333
<template>
3434
<AlertDialog>
35-
<Tooltip :delay-duration="500">
35+
<Tooltip>
3636
<AlertDialogTrigger v-show="!thread.userId || (thread.userId === $auth?.user?.sub)" as-child>
3737
<TooltipTrigger as-child @pointerdown.stop.prevent @click.shift.stop.prevent="callback()">
3838
<slot />

0 commit comments

Comments
 (0)