Skip to content

Commit e1b0412

Browse files
committed
adjust scroll + ui shift for messages fix
1 parent d2eb660 commit e1b0412

File tree

8 files changed

+288
-255
lines changed

8 files changed

+288
-255
lines changed

components/chat-header.tsx

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { Button } from '@/components/ui/button';
99
import { PlusIcon, VercelIcon } from './icons';
1010
import { useSidebar } from './ui/sidebar';
1111
import { memo } from 'react';
12-
import { Tooltip, TooltipContent, TooltipTrigger } from './ui/tooltip';
1312
import { type VisibilityType, VisibilitySelector } from './visibility-selector';
1413
import type { Session } from 'next-auth';
1514

@@ -34,22 +33,17 @@ function PureChatHeader({
3433
<SidebarToggle />
3534

3635
{(!open || windowWidth < 768) && (
37-
<Tooltip>
38-
<TooltipTrigger asChild>
39-
<Button
40-
variant="outline"
41-
className="order-2 md:order-1 md:px-2 px-2 md:h-fit ml-auto md:ml-0"
42-
onClick={() => {
43-
router.push('/');
44-
router.refresh();
45-
}}
46-
>
47-
<PlusIcon />
48-
<span className="md:sr-only">New Chat</span>
49-
</Button>
50-
</TooltipTrigger>
51-
<TooltipContent>New Chat</TooltipContent>
52-
</Tooltip>
36+
<Button
37+
variant="outline"
38+
className="order-2 md:order-1 md:px-2 px-2 md:h-fit ml-auto md:ml-0"
39+
onClick={() => {
40+
router.push('/');
41+
router.refresh();
42+
}}
43+
>
44+
<PlusIcon />
45+
<span className="md:sr-only">New Chat</span>
46+
</Button>
5347
)}
5448

5549
{!isReadonly && (

components/chat.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { useEffect, useState } from 'react';
66
import useSWR, { useSWRConfig } from 'swr';
77
import { ChatHeader } from '@/components/chat-header';
88
import type { Vote } from '@/lib/db/schema';
9-
import { fetcher, fetchWithErrorHandlers, generateUUID, cn } from '@/lib/utils';
9+
import { fetcher, fetchWithErrorHandlers, generateUUID } from '@/lib/utils';
1010
import { Artifact } from './artifact';
1111
import { MultimodalInput } from './multimodal-input';
1212
import { Messages } from './messages';
@@ -145,6 +145,7 @@ export function Chat({
145145
regenerate={regenerate}
146146
isReadonly={isReadonly}
147147
isArtifactVisible={isArtifactVisible}
148+
selectedModelId={initialChatModel}
148149
/>
149150

150151
<div className="sticky bottom-0 flex gap-2 px-2 md:px-4 pb-3 md:pb-4 mx-auto w-full bg-background max-w-4xl z-[1] border-t-0">

components/elements/conversation.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ export type ConversationProps = ComponentProps<typeof StickToBottom>;
1111

1212
export const Conversation = ({ className, ...props }: ConversationProps) => (
1313
<StickToBottom
14-
className={cn('relative flex-1 overflow-y-auto touch-pan-y will-change-scroll', className)}
14+
className={cn(
15+
'overflow-y-auto relative flex-1 touch-pan-y will-change-scroll',
16+
className,
17+
)}
1518
initial="smooth"
1619
resize="smooth"
1720
role="log"
@@ -46,7 +49,7 @@ export const ConversationScrollButton = ({
4649
!isAtBottom && (
4750
<Button
4851
className={cn(
49-
'absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full z-10 shadow-lg',
52+
'absolute bottom-4 left-1/2 -translate-x-1/2 rounded-full z-10 shadow-lg',
5053
className,
5154
)}
5255
onClick={handleScrollToBottom}

components/elements/reasoning.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export const Reasoning = memo(
9898
value={{ isStreaming, isOpen, setIsOpen, duration }}
9999
>
100100
<Collapsible
101-
className={cn('not-prose mb-2', className)}
101+
className={cn('not-prose', className)}
102102
onOpenChange={handleOpenChange}
103103
open={isOpen}
104104
{...props}

0 commit comments

Comments
 (0)