mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-27 07:16:19 +09:00
fix(web): pin chat input and make session list scrollable independently
Constrain the main layout to viewport height (h-dvh) and override SidebarProvider's min-h-svh so the height chain propagates correctly. Change main-container overflow from auto to hidden so the outer container never scrolls. Use absolute-positioning pattern for session sidebar ScrollArea (matching chat messages pattern) to ensure sessions scroll independently while the chat input stays fixed.
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<SidebarInset class="flex flex-col overflow-hidden">
|
<SidebarInset class="flex flex-col overflow-hidden">
|
||||||
<section class="flex-1 overflow-y-auto">
|
<section class="flex-1 min-h-0 overflow-hidden">
|
||||||
<router-view v-slot="{ Component }">
|
<router-view v-slot="{ Component }">
|
||||||
<KeepAlive>
|
<KeepAlive>
|
||||||
<component :is="Component" />
|
<component :is="Component" />
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<section class="flex">
|
<section class="flex h-dvh overflow-hidden">
|
||||||
<sidebar-provider
|
<sidebar-provider
|
||||||
|
class="min-h-0 h-full"
|
||||||
:default-open="sidebarDefaultOpen"
|
:default-open="sidebarDefaultOpen"
|
||||||
>
|
>
|
||||||
<section class="relative">
|
<section class="relative">
|
||||||
|
|||||||
@@ -100,34 +100,38 @@
|
|||||||
</DropdownMenu>
|
</DropdownMenu>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ScrollArea class="flex-1">
|
<div class="flex-1 relative min-h-0">
|
||||||
<div class="flex flex-col gap-1 px-1.5 overflow-hidden">
|
<div class="absolute inset-0">
|
||||||
<SessionItem
|
<ScrollArea class="h-full">
|
||||||
v-for="session in filteredSessions"
|
<div class="flex flex-col gap-1 px-1.5">
|
||||||
:key="session.id"
|
<SessionItem
|
||||||
:session="session"
|
v-for="session in filteredSessions"
|
||||||
:is-active="sessionId === session.id"
|
:key="session.id"
|
||||||
@select="handleSelect"
|
:session="session"
|
||||||
/>
|
:is-active="sessionId === session.id"
|
||||||
</div>
|
@select="handleSelect"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
v-if="currentBotId && !loadingChats && filteredSessions.length === 0"
|
v-if="currentBotId && !loadingChats && filteredSessions.length === 0"
|
||||||
class="px-3 py-6 text-center text-xs text-muted-foreground"
|
class="px-3 py-6 text-center text-xs text-muted-foreground"
|
||||||
>
|
>
|
||||||
{{ t('chat.noSessions') }}
|
{{ t('chat.noSessions') }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
v-if="loadingChats"
|
v-if="loadingChats"
|
||||||
class="flex justify-center py-4"
|
class="flex justify-center py-4"
|
||||||
>
|
>
|
||||||
<FontAwesomeIcon
|
<FontAwesomeIcon
|
||||||
:icon="['fas', 'spinner']"
|
:icon="['fas', 'spinner']"
|
||||||
class="size-4 animate-spin text-muted-foreground"
|
class="size-4 animate-spin text-muted-foreground"
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
|
</ScrollArea>
|
||||||
</div>
|
</div>
|
||||||
</ScrollArea>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user