Skip to content

Commit

Permalink
welcome message
Browse files Browse the repository at this point in the history
  • Loading branch information
wwayne committed May 28, 2024
1 parent fae654a commit 691540a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 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 @@ -143,6 +143,7 @@ export default function Chats() {
>
<div>
<Chat
welcomeMessage="Welcome to Playground!"
chatId={activeChatId as string}
key={activeChatId}
initialMessages={initialMessages ?? emptyQaParise}
Expand Down
7 changes: 5 additions & 2 deletions ee/tabby-ui/components/chat/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ interface ChatProps extends React.ComponentProps<'div'> {
container?: HTMLDivElement
docQuery?: boolean
generateRelevantQuestions?: boolean
maxWidth?: string
maxWidth?: string,
welcomeMessage?: string
}

function ChatRenderer(
Expand All @@ -130,7 +131,8 @@ function ChatRenderer(
fetcher,
docQuery,
generateRelevantQuestions,
maxWidth
maxWidth,
welcomeMessage
}: ChatProps,
ref: React.ForwardedRef<ChatRef>
) {
Expand Down Expand Up @@ -387,6 +389,7 @@ function ChatRenderer(
<EmptyScreen
setInput={setInput}
chatMaxWidthClass={chatMaxWidthClass}
welcomeMessage={welcomeMessage}
/>
)}
<ChatScrollAnchor trackVisibility={isLoading} />
Expand Down
8 changes: 5 additions & 3 deletions ee/tabby-ui/components/chat/empty-screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ const exampleMessages = [

export function EmptyScreen({
setInput,
chatMaxWidthClass
}: Pick<UseChatHelpers, 'setInput'> & { chatMaxWidthClass: string }) {
chatMaxWidthClass,
welcomeMessage
}: Pick<UseChatHelpers, 'setInput'> & { chatMaxWidthClass: string, welcomeMessage?: string }) {
const welcomeMsg = welcomeMessage || 'Welcome'
return (
<div className={`mx-auto px-4 ${chatMaxWidthClass}`}>
<div className="rounded-lg border bg-background p-8">
<h1 className="mb-2 text-lg font-semibold">Welcome to Playground!</h1>
<h1 className="mb-2 text-lg font-semibold">{welcomeMsg}</h1>
<p className="leading-normal text-muted-foreground">
You can start a conversation here or try the following examples:
</p>
Expand Down

0 comments on commit 691540a

Please sign in to comment.