Skip to content

Commit

Permalink
fix(ui): prompt panel style
Browse files Browse the repository at this point in the history
  • Loading branch information
liangfung committed May 29, 2024
1 parent 9a2fd8d commit cd3d0e4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions ee/tabby-ui/app/playground/components/chats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ export default function Chats() {
}
})) as typeof fetch
}
promptFormClassname='absolute'
/>
</div>
</ScrollArea>
Expand Down
9 changes: 6 additions & 3 deletions ee/tabby-ui/components/chat/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ interface ChatProps extends React.ComponentProps<'div'> {
generateRelevantQuestions?: boolean
maxWidth?: string
welcomeMessage?: string
promptFormClassname?: string
}

function ChatRenderer(
Expand All @@ -132,7 +133,8 @@ function ChatRenderer(
docQuery,
generateRelevantQuestions,
maxWidth,
welcomeMessage
welcomeMessage,
promptFormClassname
}: ChatProps,
ref: React.ForwardedRef<ChatRef>
) {
Expand Down Expand Up @@ -365,7 +367,8 @@ function ChatRenderer(
}, [])

const chatMaxWidthClass = maxWidth ? `max-w-${maxWidth}` : 'max-w-2xl'
if (!initialized) return <ListSkeleton />
if (!initialized) return <ListSkeleton className={`${chatMaxWidthClass} mx-auto pt-4 md:pt-10`} />

return (
<ChatContext.Provider
value={{
Expand Down Expand Up @@ -396,7 +399,7 @@ function ChatRenderer(
</div>
<ChatPanel
onSubmit={handleSubmit}
className="fixed inset-x-0 bottom-0"
className={cn('fixed inset-x-0 bottom-0', promptFormClassname)}
id={chatId}
stop={onStop}
reload={onReload}
Expand Down

0 comments on commit cd3d0e4

Please sign in to comment.