chore: choose tools show

This commit is contained in:
Joel
2026-01-22 15:47:28 +08:00
parent 219f4a2f3b
commit 2c95622890
7 changed files with 39 additions and 13 deletions

View File

@ -18,6 +18,7 @@ type Props = {
letters: string[]
toolRefs: any
selectedTools?: ToolValue[]
hideSelectedInfo?: boolean
}
const ToolViewFlatView: FC<Props> = ({
@ -31,6 +32,7 @@ const ToolViewFlatView: FC<Props> = ({
onSelectMultiple,
toolRefs,
selectedTools,
hideSelectedInfo,
}) => {
const firstLetterToolIds = useMemo(() => {
const res: Record<string, string> = {}
@ -61,6 +63,7 @@ const ToolViewFlatView: FC<Props> = ({
canNotSelectMultiple={canNotSelectMultiple}
onSelectMultiple={onSelectMultiple}
selectedTools={selectedTools}
hideSelectedInfo={hideSelectedInfo}
/>
</div>
))}

View File

@ -14,6 +14,7 @@ type Props = {
canNotSelectMultiple?: boolean
onSelectMultiple?: (type: BlockEnum, tools: ToolDefaultValue[]) => void
selectedTools?: ToolValue[]
hideSelectedInfo?: boolean
}
const Item: FC<Props> = ({
@ -24,6 +25,7 @@ const Item: FC<Props> = ({
canNotSelectMultiple,
onSelectMultiple,
selectedTools,
hideSelectedInfo,
}) => {
return (
<div>
@ -41,6 +43,7 @@ const Item: FC<Props> = ({
canNotSelectMultiple={canNotSelectMultiple}
onSelectMultiple={onSelectMultiple}
selectedTools={selectedTools}
hideSelectedInfo={hideSelectedInfo}
/>
))}
</div>

View File

@ -15,6 +15,7 @@ type Props = {
canNotSelectMultiple?: boolean
onSelectMultiple?: (type: BlockEnum, tools: ToolDefaultValue[]) => void
selectedTools?: ToolValue[]
hideSelectedInfo?: boolean
}
const ToolListTreeView: FC<Props> = ({
@ -24,6 +25,7 @@ const ToolListTreeView: FC<Props> = ({
canNotSelectMultiple,
onSelectMultiple,
selectedTools,
hideSelectedInfo,
}) => {
const { t } = useTranslation()
const getI18nGroupName = useCallback((name: string) => {
@ -54,6 +56,7 @@ const ToolListTreeView: FC<Props> = ({
canNotSelectMultiple={canNotSelectMultiple}
onSelectMultiple={onSelectMultiple}
selectedTools={selectedTools}
hideSelectedInfo={hideSelectedInfo}
/>
))}
</div>

View File

@ -40,6 +40,7 @@ type Props = {
onSelectMultiple?: (type: BlockEnum, tools: ToolDefaultValue[]) => void
selectedTools?: ToolValue[]
isShowLetterIndex?: boolean
hideSelectedInfo?: boolean
}
const Tool: FC<Props> = ({
@ -51,6 +52,7 @@ const Tool: FC<Props> = ({
canNotSelectMultiple,
onSelectMultiple,
selectedTools,
hideSelectedInfo,
}) => {
const { t } = useTranslation()
const { allowed: isMCPToolAllowed } = useMCPToolAvailability()
@ -226,7 +228,7 @@ const Tool: FC<Props> = ({
</div>
<div className="ml-2 flex items-center">
{!isShowCanNotChooseMCPTip && !canNotSelectMultiple && (notShowProvider ? notShowProviderSelectInfo : selectedInfo)}
{!isShowCanNotChooseMCPTip && !canNotSelectMultiple && (notShowProvider ? notShowProviderSelectInfo : (!hideSelectedInfo && selectedInfo))}
{isShowCanNotChooseMCPTip && <McpToolNotSupportTooltip />}
{hasAction && (
<FoldIcon className={cn('h-4 w-4 shrink-0 text-text-tertiary group-hover/item:text-text-tertiary', isFold && 'text-text-quaternary')} />