fix: empty tooltip on attachment icon, also fix z-index (#4290)

This commit is contained in:
Faisal Amir 2024-12-19 10:22:58 +08:00 committed by GitHub
parent 643c7276b5
commit ffdea36b18
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 9 deletions

View File

@ -71,7 +71,6 @@ const ModelItemHeader = ({ model, onClick, open }: Props) => {
let downloadButton = (
<Button
className="z-50"
onClick={(e) => {
e.stopPropagation()
onDownloadClick()

View File

@ -100,9 +100,9 @@ const ChatInput = () => {
stopInference()
}
const isModelSupportRagAndTools =
selectedModel?.engine === InferenceEngine.openai ||
isLocalEngine(selectedModel?.engine as InferenceEngine)
const isModelSupportRagAndTools = isLocalEngine(
selectedModel?.engine as InferenceEngine
)
/**
* Handles the change event of the extension file input element by setting the file name state.
@ -188,7 +188,7 @@ const ChatInput = () => {
</Button>
}
disabled={
isModelSupportRagAndTools &&
!isModelSupportRagAndTools &&
activeAssistant?.tools &&
activeAssistant?.tools[0]?.enabled
}
@ -237,7 +237,8 @@ const ChatInput = () => {
<li
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))]',
activeAssistant?.model.settings?.vision_model
activeAssistant?.model.settings?.vision_model ||
isModelSupportRagAndTools
? 'cursor-pointer'
: 'cursor-not-allowed opacity-50'
)}
@ -261,11 +262,15 @@ const ChatInput = () => {
<li
className={twMerge(
'text-[hsla(var(--text-secondary)] hover:bg-secondary flex w-full cursor-pointer items-center space-x-2 px-4 py-2 hover:bg-[hsla(var(--dropdown-menu-hover-bg))]',
'cursor-pointer'
isModelSupportRagAndTools
? 'cursor-pointer'
: 'cursor-not-allowed opacity-50'
)}
onClick={() => {
fileInputRef.current?.click()
setShowAttacmentMenus(false)
if (isModelSupportRagAndTools) {
fileInputRef.current?.click()
setShowAttacmentMenus(false)
}
}}
>
<FileTextIcon size={16} />