fix: width inputbox based on preference and remove tooltip image upload (#4315)

This commit is contained in:
Faisal Amir 2024-12-23 13:14:49 +08:00 committed by GitHub
parent 5163e124d8
commit abb718c57f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 28 additions and 25 deletions

View File

@ -231,12 +231,10 @@ const ChatInput = () => {
)} )}
> >
<ul> <ul>
<Tooltip
trigger={
<li <li
className={twMerge( className={twMerge(
'text-[hsla(var(--text-secondary)] hover:bg-secondary flex w-full items-center space-x-2 px-4 py-2 hover:bg-[hsla(var(--dropdown-menu-hover-bg))]', 'text-[hsla(var(--text-secondary)] hover:bg-secondary flex w-full items-center space-x-2 px-4 py-2 hover:bg-[hsla(var(--dropdown-menu-hover-bg))]',
activeAssistant?.model.settings?.vision_model || activeAssistant?.model.settings?.vision_model &&
isModelSupportRagAndTools isModelSupportRagAndTools
? 'cursor-pointer' ? 'cursor-pointer'
: 'cursor-not-allowed opacity-50' : 'cursor-not-allowed opacity-50'
@ -251,10 +249,6 @@ const ChatInput = () => {
<ImageIcon size={16} /> <ImageIcon size={16} />
<span className="font-medium">Image</span> <span className="font-medium">Image</span>
</li> </li>
}
content="This feature only supports multimodal models."
disabled={activeAssistant?.model.settings?.vision_model}
/>
<Tooltip <Tooltip
side="bottom" side="bottom"
trigger={ trigger={

View File

@ -30,6 +30,7 @@ import RequestDownloadModel from './RequestDownloadModel'
import { showSystemMonitorPanelAtom } from '@/helpers/atoms/App.atom' import { showSystemMonitorPanelAtom } from '@/helpers/atoms/App.atom'
import { experimentalFeatureEnabledAtom } from '@/helpers/atoms/AppConfig.atom' import { experimentalFeatureEnabledAtom } from '@/helpers/atoms/AppConfig.atom'
import { activeAssistantAtom } from '@/helpers/atoms/Assistant.atom' import { activeAssistantAtom } from '@/helpers/atoms/Assistant.atom'
import { chatWidthAtom } from '@/helpers/atoms/Setting.atom'
import { activeThreadAtom } from '@/helpers/atoms/Thread.atom' import { activeThreadAtom } from '@/helpers/atoms/Thread.atom'
import { import {
@ -59,6 +60,7 @@ const ThreadCenterPanel = () => {
const experimentalFeature = useAtomValue(experimentalFeatureEnabledAtom) const experimentalFeature = useAtomValue(experimentalFeatureEnabledAtom)
const activeThread = useAtomValue(activeThreadAtom) const activeThread = useAtomValue(activeThreadAtom)
const activeAssistant = useAtomValue(activeAssistantAtom) const activeAssistant = useAtomValue(activeAssistantAtom)
const chatWidth = useAtomValue(chatWidthAtom)
const upload = uploader() const upload = uploader()
const acceptedFormat: Accept = activeAssistant?.model.settings?.vision_model const acceptedFormat: Accept = activeAssistant?.model.settings?.vision_model
? { ? {
@ -235,9 +237,16 @@ const ThreadCenterPanel = () => {
{reloadModel && <ModelReload />} {reloadModel && <ModelReload />}
{activeModel && isGeneratingResponse && <GenerateResponse />} {activeModel && isGeneratingResponse && <GenerateResponse />}
<div
className={twMerge(
'mx-auto w-full',
chatWidth === 'compact' && 'max-w-[700px]'
)}
>
<ChatInput /> <ChatInput />
</div> </div>
</div> </div>
</div>
</CenterPanelContainer> </CenterPanelContainer>
) )
} }