hide stars in automate

This commit is contained in:
EthanHealy01 2025-10-08 16:57:29 +01:00
parent 4cfecd9384
commit acbecc0d32
3 changed files with 10 additions and 5 deletions

View File

@ -141,7 +141,7 @@ const ToolPicker = ({ selectedToolKey, onSelect, filteredTools, isSearching = fa
{searchGroups.length === 0 ? (
<NoToolsFound />
) : (
searchGroups.map(group => renderToolButtons(t, group, selectedToolKey, onSelect, true, false, filteredTools))
searchGroups.map(group => renderToolButtons(t, group, selectedToolKey, onSelect, true, false, filteredTools, true))
)}
</Stack>
) : (
@ -186,6 +186,7 @@ const ToolPicker = ({ selectedToolKey, onSelect, filteredTools, isSearching = fa
tool={tool}
isSelected={selectedToolKey === id}
onSelect={onSelect}
hasStars
/>
))}
</div>
@ -202,6 +203,7 @@ const ToolPicker = ({ selectedToolKey, onSelect, filteredTools, isSearching = fa
tool={tool}
isSelected={selectedToolKey === id}
onSelect={onSelect}
hasStars
/>
))}
</div>
@ -242,7 +244,7 @@ const ToolPicker = ({ selectedToolKey, onSelect, filteredTools, isSearching = fa
<Box ref={allToolsRef} w="100%">
<Stack p="sm" gap="xs">
{allSection?.subcategories.map((sc: any) =>
renderToolButtons(t, sc, selectedToolKey, onSelect, true, false)
renderToolButtons(t, sc, selectedToolKey, onSelect, true, false, undefined, true)
)}
</Stack>
</Box>

View File

@ -14,7 +14,8 @@ export const renderToolButtons = (
onSelect: (id: string) => void,
showSubcategoryHeader: boolean = true,
disableNavigation: boolean = false,
searchResults?: Array<{ item: [string, any]; matchedText?: string }>
searchResults?: Array<{ item: [string, any]; matchedText?: string }>,
hasStars: boolean = false
) => {
// Create a map of matched text for quick lookup
const matchedTextMap = new Map<string, string>();
@ -42,6 +43,7 @@ export const renderToolButtons = (
onSelect={onSelect}
disableNavigation={disableNavigation}
matchedSynonym={matchedSynonym}
hasStars={hasStars}
/>
);
})}

View File

@ -22,9 +22,10 @@ interface ToolButtonProps {
rounded?: boolean;
disableNavigation?: boolean;
matchedSynonym?: string;
hasStars?: boolean;
}
const ToolButton: React.FC<ToolButtonProps> = ({ id, tool, isSelected, onSelect, disableNavigation = false, matchedSynonym }) => {
const ToolButton: React.FC<ToolButtonProps> = ({ id, tool, isSelected, onSelect, disableNavigation = false, matchedSynonym, hasStars = false }) => {
const { t } = useTranslation();
// Special case: read and multiTool are navigational tools that are always available
const isUnavailable = !tool.component && !tool.link && id !== 'read' && id !== 'multiTool';
@ -169,7 +170,7 @@ const ToolButton: React.FC<ToolButtonProps> = ({ id, tool, isSelected, onSelect,
</Button>
);
const star = !isUnavailable ? (
const star = hasStars && !isUnavailable ? (
<ActionIcon
variant="subtle"
radius="xl"