diff --git a/frontend/src/components/shared/AllToolsNavButton.tsx b/frontend/src/components/shared/AllToolsNavButton.tsx index 39563fa06..d25893f6c 100644 --- a/frontend/src/components/shared/AllToolsNavButton.tsx +++ b/frontend/src/components/shared/AllToolsNavButton.tsx @@ -47,30 +47,28 @@ const AllToolsNavButton: React.FC = ({ activeButton, set return ( - -
- - {iconNode} - - - {t("quickAccess.allTools", "All Tools")} - -
-
+
+ + {iconNode} + + + {t("quickAccess.allTools", "All Tools")} + +
); }; diff --git a/frontend/src/components/shared/QuickAccessBar.tsx b/frontend/src/components/shared/QuickAccessBar.tsx index 95134d90f..90533dca8 100644 --- a/frontend/src/components/shared/QuickAccessBar.tsx +++ b/frontend/src/components/shared/QuickAccessBar.tsx @@ -60,8 +60,33 @@ const QuickAccessBar = forwardRef(({ config.onClick(); }; - const buttonElement = ( -
+ // Render with URL navigation if available, otherwise regular div + if (navProps) { + return ( +
+ handleClick(e)} + size={isActive ? (config.size || 'lg') : 'lg'} + variant="subtle" + style={getNavButtonStyle(config, activeButton, isFilesModalOpen, configModalOpen, selectedToolKey, leftPanelView)} + className={isActive ? 'activeIconScale' : ''} + data-testid={`${config.id}-button`} + > + + {config.icon} + + + + {config.name} + +
+ ); + } + + return ( +
(({
); - - // Wrap with Anchor if it has URL navigation - if (navProps) { - return ( - - {buttonElement} - - ); - } - - return
{buttonElement}
; }; diff --git a/frontend/src/components/shared/quickAccessBar/ActiveToolButton.tsx b/frontend/src/components/shared/quickAccessBar/ActiveToolButton.tsx index 45fd649ff..ae2dd1c51 100644 --- a/frontend/src/components/shared/quickAccessBar/ActiveToolButton.tsx +++ b/frontend/src/components/shared/quickAccessBar/ActiveToolButton.tsx @@ -143,7 +143,8 @@ const ActiveToolButton: React.FC = ({ activeButton, setAc
- { // Check if it's a special click (middle click, ctrl+click, etc.) @@ -156,31 +157,28 @@ const ActiveToolButton: React.FC = ({ activeButton, setAc setActiveButton('tools'); handleBackToTools(); }} - style={{ textDecoration: 'none', color: 'inherit' }} + size={'xl'} + variant="subtle" + onMouseEnter={() => setIsBackHover(true)} + onMouseLeave={() => setIsBackHover(false)} + aria-label={isBackHover ? 'Back to all tools' : indicatorTool.name} + style={{ + backgroundColor: isBackHover ? 'var(--color-gray-300)' : 'var(--icon-tools-bg)', + color: isBackHover ? '#fff' : 'var(--icon-tools-color)', + border: 'none', + borderRadius: '8px', + cursor: 'pointer', + textDecoration: 'none' + }} > - setIsBackHover(true)} - onMouseLeave={() => setIsBackHover(false)} - aria-label={isBackHover ? 'Back to all tools' : indicatorTool.name} - style={{ - backgroundColor: isBackHover ? 'var(--color-gray-300)' : 'var(--icon-tools-bg)', - color: isBackHover ? '#fff' : 'var(--icon-tools-color)', - border: 'none', - borderRadius: '8px', - cursor: 'pointer' - }} - > - - {isBackHover ? ( - - ) : ( - indicatorTool.icon - )} - - - + + {isBackHover ? ( + + ) : ( + indicatorTool.icon + )} + + = ({ id, tool, isSelected, onSelect ); + const handleExternalClick = (e: React.MouseEvent) => { + // Check if it's a special click (middle click, ctrl+click, etc.) + if (e.metaKey || e.ctrlKey || e.shiftKey || e.button === 1) { + return; // Let browser handle it via href + } + + // For regular clicks, prevent default and use window.open + e.preventDefault(); + handleClick(id); + }; + const buttonElement = navProps ? ( - // For tools with URLs, wrap in anchor for proper link behavior - - - + {buttonContent} + + ) : tool.link && !isUnavailable ? ( + // For external links, render Button as an anchor with proper href + ) : ( - // For external links and unavailable tools, use regular button + // For unavailable tools, use regular button