diff --git a/frontend/src/components/tools/automate/AutomationEntry.tsx b/frontend/src/components/tools/automate/AutomationEntry.tsx index 8c07fb14b..59763e491 100644 --- a/frontend/src/components/tools/automate/AutomationEntry.tsx +++ b/frontend/src/components/tools/automate/AutomationEntry.tsx @@ -6,6 +6,7 @@ import EditIcon from '@mui/icons-material/Edit'; import DeleteIcon from '@mui/icons-material/Delete'; import ContentCopyIcon from '@mui/icons-material/ContentCopy'; import { Tooltip } from '../../shared/Tooltip'; +import { ToolRegistryEntry } from '../../../data/toolsTaxonomy'; interface AutomationEntryProps { /** Optional title for the automation (usually for custom ones) */ @@ -28,6 +29,8 @@ interface AutomationEntryProps { onDelete?: () => void; /** Copy handler (for suggested automations) */ onCopy?: () => void; + /** Tool registry to resolve operation names */ + toolRegistry?: Record; } export default function AutomationEntry({ @@ -40,7 +43,8 @@ export default function AutomationEntry({ showMenu = false, onEdit, onDelete, - onCopy + onCopy, + toolRegistry }: AutomationEntryProps) { const { t } = useTranslation(); const [isHovered, setIsHovered] = useState(false); @@ -49,6 +53,15 @@ export default function AutomationEntry({ // Keep item in hovered state if menu is open const shouldShowHovered = isHovered || isMenuOpen; + // Helper function to resolve tool display names + const getToolDisplayName = (operation: string): string => { + if (toolRegistry?.[operation]?.name) { + return toolRegistry[operation].name; + } + // Fallback to translation or operation key + return t(`${operation}.title`, operation); + }; + // Create tooltip content with description and tool chain const createTooltipContent = () => { if (!description) return null; @@ -68,7 +81,7 @@ export default function AutomationEntry({ whiteSpace: 'nowrap' }} > - {t(`${op}.title`, op)} + {getToolDisplayName(op)} {index < operations.length - 1 && ( @@ -122,7 +135,7 @@ export default function AutomationEntry({ {operations.map((op, index) => ( - {t(`${op}.title`, op)} + {getToolDisplayName(op)} {index < operations.length - 1 && ( diff --git a/frontend/src/components/tools/automate/AutomationSelection.tsx b/frontend/src/components/tools/automate/AutomationSelection.tsx index 7583feaae..f04fc7dd0 100644 --- a/frontend/src/components/tools/automate/AutomationSelection.tsx +++ b/frontend/src/components/tools/automate/AutomationSelection.tsx @@ -7,6 +7,7 @@ import AutomationEntry from "./AutomationEntry"; import { useSuggestedAutomations } from "../../../hooks/tools/automate/useSuggestedAutomations"; import { AutomationConfig, SuggestedAutomation } from "../../../types/automation"; import { iconMap } from './iconMap'; +import { ToolRegistryEntry } from '../../../data/toolsTaxonomy'; interface AutomationSelectionProps { savedAutomations: AutomationConfig[]; @@ -15,6 +16,7 @@ interface AutomationSelectionProps { onEdit: (automation: AutomationConfig) => void; onDelete: (automation: AutomationConfig) => void; onCopyFromSuggested: (automation: SuggestedAutomation) => void; + toolRegistry: Record; } export default function AutomationSelection({ @@ -23,7 +25,8 @@ export default function AutomationSelection({ onRun, onEdit, onDelete, - onCopyFromSuggested + onCopyFromSuggested, + toolRegistry }: AutomationSelectionProps) { const { t } = useTranslation(); const suggestedAutomations = useSuggestedAutomations(); @@ -41,6 +44,7 @@ export default function AutomationSelection({ operations={[]} onClick={onCreateNew} keepIconColor={true} + toolRegistry={toolRegistry} /> {/* Saved Automations */} {savedAutomations.map((automation) => { @@ -55,6 +59,7 @@ export default function AutomationSelection({ showMenu={true} onEdit={() => onEdit(automation)} onDelete={() => onDelete(automation)} + toolRegistry={toolRegistry} /> ); })} @@ -76,6 +81,7 @@ export default function AutomationSelection({ onClick={() => onRun(automation)} showMenu={true} onCopy={() => onCopyFromSuggested(automation)} + toolRegistry={toolRegistry} /> ))} diff --git a/frontend/src/tools/Automate.tsx b/frontend/src/tools/Automate.tsx index f6758b450..53040ffb0 100644 --- a/frontend/src/tools/Automate.tsx +++ b/frontend/src/tools/Automate.tsx @@ -88,6 +88,7 @@ const Automate = ({ onPreviewFile, onComplete, onError }: BaseToolProps) => { onError?.(`Failed to copy automation: ${suggestedAutomation.name}`); } }} + toolRegistry={toolRegistry} /> );