chore: hide featured tools

This commit is contained in:
Joel
2026-01-22 15:30:16 +08:00
parent e38a4121e7
commit 219f4a2f3b
3 changed files with 12 additions and 3 deletions

View File

@ -53,6 +53,7 @@ type AllToolsProps = {
featuredLoading?: boolean
showFeatured?: boolean
onFeaturedInstallSuccess?: () => Promise<void> | void
hideFeaturedTool?: boolean
}
const DEFAULT_TAGS: AllToolsProps['tags'] = []
@ -76,6 +77,7 @@ const AllTools = ({
featuredLoading = false,
showFeatured = false,
onFeaturedInstallSuccess,
hideFeaturedTool = false,
}: AllToolsProps) => {
const { t } = useTranslation()
const language = useGetLanguage()
@ -194,6 +196,7 @@ const AllTools = ({
&& !isInRAGPipeline
&& activeTab === ToolTypeEnum.All
&& !hasFilter
&& !hideFeaturedTool
const shouldShowMarketplaceFooter = enable_marketplace && !hasFilter
const handleRAGSelect = useCallback<OnSelectBlock>((type, pluginDefaultValue) => {
@ -259,9 +262,11 @@ const AllTools = ({
)}
{hasToolsListContent && (
<>
<div className="px-3 pb-1 pt-2">
<span className="system-xs-medium text-text-primary">{t('allTools', { ns: 'tools' })}</span>
</div>
{!hideFeaturedTool && (
<div className="px-3 pb-1 pt-2">
<span className="system-xs-medium text-text-primary">{t('allTools', { ns: 'tools' })}</span>
</div>
)}
<Tools
className={toolContentClassName}
tools={tools}

View File

@ -52,6 +52,7 @@ type Props = {
scope?: string
selectedTools?: ToolValue[]
preventFocusLoss?: boolean
hideFeaturedTool?: boolean
}
const ToolPicker: FC<Props> = ({
@ -69,6 +70,7 @@ const ToolPicker: FC<Props> = ({
selectedTools,
panelClassName,
preventFocusLoss = false,
hideFeaturedTool = false,
}) => {
const { t } = useTranslation()
const [searchText, setSearchText] = useState('')
@ -215,6 +217,7 @@ const ToolPicker: FC<Props> = ({
featuredPlugins={featuredPlugins}
featuredLoading={isFeaturedLoading}
showFeatured={scope === 'all' && enable_marketplace}
hideFeaturedTool={hideFeaturedTool}
onFeaturedInstallSuccess={async () => {
invalidateBuiltInTools()
invalidateCustomTools()

View File

@ -150,6 +150,7 @@ const ToolPickerBlock: FC<ToolPickerBlockProps> = ({ scope = 'all' }) => {
closeMenu()
}}
scope={scope}
hideFeaturedTool
preventFocusLoss
/>,
anchorElementRef.current,