Skip to content

Commit

Permalink
fix: empty tooltip on attachment icon, also fix z-index
Browse files Browse the repository at this point in the history
  • Loading branch information
urmauur committed Dec 18, 2024
1 parent 0cd0ff0 commit ce35cc9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
1 change: 0 additions & 1 deletion web/screens/Hub/ModelList/ModelHeader/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ const ModelItemHeader = ({ model, onClick, open }: Props) => {

let downloadButton = (
<Button
className="z-50"
onClick={(e) => {
e.stopPropagation()
onDownloadClick()
Expand Down
21 changes: 13 additions & 8 deletions web/screens/Thread/ThreadCenterPanel/ChatInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ const ChatInput = () => {
stopInference()

Check warning on line 94 in web/screens/Thread/ThreadCenterPanel/ChatInput/index.tsx

View workflow job for this annotation

GitHub Actions / coverage-check

94 line is not covered with tests
}

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.
Expand Down Expand Up @@ -182,7 +182,7 @@ const ChatInput = () => {
</Button>
}
disabled={
isModelSupportRagAndTools &&
!isModelSupportRagAndTools &&
activeAssistant?.tools &&
activeAssistant?.tools[0]?.enabled
}
Expand Down Expand Up @@ -231,7 +231,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'
)}
Expand All @@ -255,11 +256,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} />
Expand Down

0 comments on commit ce35cc9

Please sign in to comment.