Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 9 additions & 13 deletions web/screens/Chat/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,14 @@ const ChatScreen = () => {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [waitingToSendMessage, activeThreadId])

useEffect(() => {
if (textareaRef.current !== null) {
const scrollHeight = textareaRef.current.scrollHeight
if (currentPrompt.length === 0) {
textareaRef.current.style.height = '40px'
} else {
textareaRef.current.style.height = `${
scrollHeight < 40 ? 40 : scrollHeight
}px`
}
const resizeTextArea = () => {
if (textareaRef.current) {
textareaRef.current.style.height = '40px'
textareaRef.current.style.height = textareaRef.current.scrollHeight + 'px'
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [currentPrompt])
}

useEffect(resizeTextArea, [currentPrompt])

const onKeyDown = async (e: React.KeyboardEvent<HTMLTextAreaElement>) => {
if (e.key === 'Enter') {
Expand Down Expand Up @@ -155,7 +150,8 @@ const ChatScreen = () => {
)}
<div className="mx-auto flex w-full flex-shrink-0 items-end justify-center space-x-4 px-8 py-4">
<Textarea
className="min-h-10 h-10 max-h-[400px] resize-none pr-20"
className="max-h-[400px] resize-none overflow-y-hidden pr-20"
style={{ height: '40px' }}
ref={textareaRef}
onKeyDown={(e: KeyboardEvent<HTMLTextAreaElement>) =>
onKeyDown(e)
Expand Down
4 changes: 3 additions & 1 deletion web/screens/Settings/Models/Row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ export default function RowModel(props: RowModelProps) {
<td className="px-6 py-4 font-bold">{props.data.id}</td>
<td className="px-6 py-4">
<Badge themes="secondary">
{toGigabytes(props.data.metadata.size)}
{props.data.metadata.size
? toGigabytes(props.data.metadata.size)
: '-'}
</Badge>
</td>
<td className="px-6 py-4">
Expand Down