diff --git a/frontend/src/components/fileEditor/FileEditorThumbnail.tsx b/frontend/src/components/fileEditor/FileEditorThumbnail.tsx index 355d37c51..e8f102101 100644 --- a/frontend/src/components/fileEditor/FileEditorThumbnail.tsx +++ b/frontend/src/components/fileEditor/FileEditorThumbnail.tsx @@ -324,7 +324,7 @@ const FileEditorThumbnail = ({ marginTop: '0.5rem', marginBottom: '0.5rem', }}> - + {file.name} {file.thumbnailUrl && ( {file.name} = ({ - {t('fileManager.fileName', 'Name')} + {t('fileManager.fileName', 'Name')} {currentFile ? currentFile.name : ''} diff --git a/frontend/src/components/fileManager/FileListItem.tsx b/frontend/src/components/fileManager/FileListItem.tsx index 7296fa956..11fbc20af 100644 --- a/frontend/src/components/fileManager/FileListItem.tsx +++ b/frontend/src/components/fileManager/FileListItem.tsx @@ -93,7 +93,7 @@ const FileListItem: React.FC = ({ - {file.name} + {file.name} v{currentVersion} diff --git a/frontend/src/components/pageEditor/FileThumbnail.tsx b/frontend/src/components/pageEditor/FileThumbnail.tsx index be926f85d..b7b18e239 100644 --- a/frontend/src/components/pageEditor/FileThumbnail.tsx +++ b/frontend/src/components/pageEditor/FileThumbnail.tsx @@ -317,6 +317,7 @@ const FileThumbnail = ({ > {file.thumbnail && ( {file.name} = ({ ) : thumbnailUrl ? ( {`Page = ({ + icon, + opacity = 1, + color = "var(--tools-text-and-icon-color)", + marginRight = "0.5rem" +}) => { + return ( +
+ {icon} +
+ ); +}; diff --git a/frontend/src/components/shared/filePreview/DocumentThumbnail.tsx b/frontend/src/components/shared/filePreview/DocumentThumbnail.tsx index 4f87e7f3e..71b95db27 100644 --- a/frontend/src/components/shared/filePreview/DocumentThumbnail.tsx +++ b/frontend/src/components/shared/filePreview/DocumentThumbnail.tsx @@ -19,7 +19,7 @@ const DocumentThumbnail: React.FC = ({ children }) => { if (!file) return null; - + const containerStyle = { position: 'relative' as const, cursor: onClick ? 'pointer' : 'default', @@ -36,6 +36,7 @@ const DocumentThumbnail: React.FC = ({ return ( {`Preview = ({ return (
-
{children} @@ -61,4 +63,4 @@ const DocumentThumbnail: React.FC = ({ ); }; -export default DocumentThumbnail; \ No newline at end of file +export default DocumentThumbnail; diff --git a/frontend/src/components/tools/addPageNumbers/PageNumberPreview.tsx b/frontend/src/components/tools/addPageNumbers/PageNumberPreview.tsx index 0e31f426d..8a762278a 100644 --- a/frontend/src/components/tools/addPageNumbers/PageNumberPreview.tsx +++ b/frontend/src/components/tools/addPageNumbers/PageNumberPreview.tsx @@ -200,7 +200,7 @@ export default function PageNumberPreview({ parameters, onParameterChange, file, page preview )} @@ -238,4 +238,4 @@ export default function PageNumberPreview({ parameters, onParameterChange, file, ); -} \ No newline at end of file +} diff --git a/frontend/src/components/tools/automate/AutomationEntry.tsx b/frontend/src/components/tools/automate/AutomationEntry.tsx index 30c280491..8f739bcbf 100644 --- a/frontend/src/components/tools/automate/AutomationEntry.tsx +++ b/frontend/src/components/tools/automate/AutomationEntry.tsx @@ -1,11 +1,12 @@ import React, { useState } from 'react'; import { useTranslation } from 'react-i18next'; -import { Group, Text, ActionIcon, Menu, Box } from '@mantine/core'; +import { Group, Text, ActionIcon, Menu, Button, Box } from '@mantine/core'; import MoreVertIcon from '@mui/icons-material/MoreVert'; 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 { ToolIcon } from '../../shared/ToolIcon'; import { ToolRegistryEntry } from '../../../data/toolsTaxonomy'; interface AutomationEntryProps { @@ -50,8 +51,7 @@ export default function AutomationEntry({ const [isHovered, setIsHovered] = useState(false); const [isMenuOpen, setIsMenuOpen] = useState(false); - // Keep item in hovered state if menu is open - const shouldShowHovered = isHovered || isMenuOpen; + const shouldShowMenu = isHovered || isMenuOpen; // Helper function to resolve tool display names const getToolDisplayName = (operation: string): string => { @@ -108,134 +108,135 @@ export default function AutomationEntry({ ); }; - const renderContent = () => { - if (title) { - // Custom automation with title - return ( - - {BadgeIcon && ( - - )} - + const buttonContent = ( + <> + {BadgeIcon && ( + } + {...(keepIconColor && { color: 'var(--mantine-primary-color-filled)' })} + /> + )} +
+ {title ? ( + // Custom automation with title + {title} - - ); - } else { - // Suggested automation showing tool chain - return ( - - {BadgeIcon && ( - - )} + ) : ( + // Suggested automation showing tool chain {operations.map((op, index) => ( - + {getToolDisplayName(op)} - {index < operations.length - 1 && ( - + )} ))} - - ); - } - }; + )} +
+ + ); - const boxContent = ( + const wrapperContent = ( setIsHovered(true)} onMouseLeave={() => setIsHovered(false)} > - -
- {renderContent()} -
+ + {showMenu && ( + setIsMenuOpen(true)} + onClose={() => setIsMenuOpen(false)} + > + + e.stopPropagation()} + style={{ + position: 'absolute', + right: '0.5rem', + top: '50%', + transform: 'translateY(-50%)', + zIndex: 1, + opacity: shouldShowMenu ? 1 : 0, + transition: 'opacity 0.2s ease', + pointerEvents: shouldShowMenu ? 'auto' : 'none' + }} + > + + + - {showMenu && ( - setIsMenuOpen(true)} - onClose={() => setIsMenuOpen(false)} - > - - e.stopPropagation()} - style={{ - opacity: shouldShowHovered ? 1 : 0, - transform: shouldShowHovered ? 'scale(1)' : 'scale(0.8)', - transition: 'opacity 0.3s ease, transform 0.3s ease', - pointerEvents: shouldShowHovered ? 'auto' : 'none' + + {onCopy && ( + } + onClick={(e) => { + e.stopPropagation(); + onCopy(); }} > - - - - - - {onCopy && ( - } - onClick={(e) => { - e.stopPropagation(); - onCopy(); - }} - > - {t('automate.copyToSaved', 'Copy to Saved')} - - )} - {onEdit && ( - } - onClick={(e) => { - e.stopPropagation(); - onEdit(); - }} - > - {t('edit', 'Edit')} - - )} - {onDelete && ( - } - onClick={(e) => { - e.stopPropagation(); - onDelete(); - }} - > - {t('delete', 'Delete')} - - )} - - - )} - + {t('automate.copyToSaved', 'Copy to Saved')} + + )} + {onEdit && ( + } + onClick={(e) => { + e.stopPropagation(); + onEdit(); + }} + > + {t('edit', 'Edit')} + + )} + {onDelete && ( + } + onClick={(e) => { + e.stopPropagation(); + onDelete(); + }} + > + {t('delete', 'Delete')} + + )} + + + )}
); @@ -249,9 +250,9 @@ export default function AutomationEntry({ arrow={true} delay={500} > - {boxContent} + {wrapperContent} ) : ( - boxContent + wrapperContent ); } diff --git a/frontend/src/components/tools/shared/ResultsPreview.tsx b/frontend/src/components/tools/shared/ResultsPreview.tsx index 586700b85..399a3ab5d 100644 --- a/frontend/src/components/tools/shared/ResultsPreview.tsx +++ b/frontend/src/components/tools/shared/ResultsPreview.tsx @@ -62,6 +62,7 @@ const ResultsPreview = ({ {/* File name at the top */} - + } /> {tool.title} diff --git a/frontend/src/components/tools/toolPicker/ToolButton.tsx b/frontend/src/components/tools/toolPicker/ToolButton.tsx index 40cee33a7..467ce6738 100644 --- a/frontend/src/components/tools/toolPicker/ToolButton.tsx +++ b/frontend/src/components/tools/toolPicker/ToolButton.tsx @@ -2,6 +2,7 @@ import React from "react"; import { Button } from "@mantine/core"; import { useTranslation } from "react-i18next"; import { Tooltip } from "../../shared/Tooltip"; +import { ToolIcon } from "../../shared/ToolIcon"; import { ToolRegistryEntry } from "../../../data/toolsTaxonomy"; import { useToolNavigation } from "../../../hooks/useToolNavigation"; import { handleUnlessSpecialClick } from "../../../utils/clickHandlers"; @@ -57,7 +58,10 @@ const ToolButton: React.FC = ({ id, tool, isSelected, onSelect, const buttonContent = ( <> -
{tool.icon}
+
= ({ id, tool, isSelected, onSelect, style={{ display: 'inline-block', maxWidth: '100%', opacity: isUnavailable ? 0.25 : 1 }} /> {matchedSynonym && ( - provider return ( -
{/* Selection layer for text interaction */} - + {/* Annotation layer for signatures (only when enabled) */} {enableAnnotations && (