remove old pattern, try something different to show the user they've switched tool

This commit is contained in:
EthanHealy01 2025-08-12 16:57:09 +01:00
parent aeb4f69cd9
commit 39fed225a1
4 changed files with 15 additions and 27 deletions

View File

@ -1,7 +1,6 @@
import React, { useState } from 'react'; import React from 'react';
import { ActionIcon, Tooltip } from '@mantine/core'; import { ActionIcon, Tooltip } from '@mantine/core';
import AppsIcon from '@mui/icons-material/AppsRounded'; import AppsIcon from '@mui/icons-material/AppsRounded';
import ArrowBackIcon from '@mui/icons-material/ArrowBackRounded';
import { useToolWorkflow } from '../../contexts/ToolWorkflowContext'; import { useToolWorkflow } from '../../contexts/ToolWorkflowContext';
interface AllToolsNavButtonProps { interface AllToolsNavButtonProps {
@ -10,8 +9,7 @@ interface AllToolsNavButtonProps {
} }
const AllToolsNavButton: React.FC<AllToolsNavButtonProps> = ({ activeButton, setActiveButton }) => { const AllToolsNavButton: React.FC<AllToolsNavButtonProps> = ({ activeButton, setActiveButton }) => {
const { selectedTool, selectedToolKey, handleReaderToggle, handleBackToTools } = useToolWorkflow(); const { handleReaderToggle, handleBackToTools } = useToolWorkflow();
const [isHovered, setIsHovered] = useState(false);
const handleClick = () => { const handleClick = () => {
setActiveButton('tools'); setActiveButton('tools');
@ -22,38 +20,25 @@ const AllToolsNavButton: React.FC<AllToolsNavButtonProps> = ({ activeButton, set
const isActive = activeButton === 'tools'; const isActive = activeButton === 'tools';
const iconNode = (() => { const iconNode = (
if (selectedToolKey) {
if (isHovered) return <ArrowBackIcon sx={{ fontSize: '1.75rem' }} />;
return (
<span className="iconContainer">
{selectedTool?.icon ?? <AppsIcon sx={{ fontSize: '1.75rem' }} />}
</span>
);
}
return (
<span className="iconContainer"> <span className="iconContainer">
<AppsIcon sx={{ fontSize: '1.75rem' }} /> <AppsIcon sx={{ fontSize: '1.75rem' }} />
</span> </span>
); );
})();
return ( return (
<Tooltip label={selectedToolKey && isHovered ? 'Back to all tools' : 'View all available tools'} position="right"> <Tooltip label={'All tools'} position="right">
<div className="flex flex-col items-center gap-1 mt-4 mb-2"> <div className="flex flex-col items-center gap-1 mt-4 mb-2">
<ActionIcon <ActionIcon
size="lg" size="lg"
variant="subtle" variant="subtle"
onClick={handleClick} onClick={handleClick}
onMouseEnter={() => setIsHovered(true)}
onMouseLeave={() => setIsHovered(false)}
style={{ style={{
backgroundColor: isActive ? 'var(--icon-tools-bg)' : 'var(--icon-inactive-bg)', backgroundColor: isActive ? 'var(--icon-tools-bg)' : 'var(--icon-inactive-bg)',
color: isActive ? 'var(--icon-tools-color)' : 'var(--icon-inactive-color)', color: isActive ? 'var(--icon-tools-color)' : 'var(--icon-inactive-color)',
border: 'none', border: 'none',
borderRadius: '8px', borderRadius: '8px',
}} }}
className={isActive ? 'activeIconScale' : ''}
> >
{iconNode} {iconNode}
</ActionIcon> </ActionIcon>

View File

@ -45,6 +45,7 @@ const ToolPicker = ({ selectedToolKey, onSelect, filteredTools, isSearching = fa
const SubcategoryHeader: React.FC<{ label: string; mt?: string | number; mb?: string | number }> = ({ label, mt = "1rem", mb = "0.25rem" }) => ( const SubcategoryHeader: React.FC<{ label: string; mt?: string | number; mb?: string | number }> = ({ label, mt = "1rem", mb = "0.25rem" }) => (
<div className="tool-subcategory-row" style={{ marginLeft: "1rem", marginRight: "1rem", marginTop: mt, marginBottom: mb }}> <div className="tool-subcategory-row" style={{ marginLeft: "1rem", marginRight: "1rem", marginTop: mt, marginBottom: mb }}>
<div className="tool-subcategory-row-rule" />
<span className="tool-subcategory-row-title">{label}</span> <span className="tool-subcategory-row-title">{label}</span>
<div className="tool-subcategory-row-rule" /> <div className="tool-subcategory-row-rule" />
</div> </div>

View File

@ -45,14 +45,14 @@
.tool-subcategory-row-title { .tool-subcategory-row-title {
text-transform: uppercase; text-transform: uppercase;
font-weight: 600; font-weight: 600;
font-size: 0.9rem; font-size: 0.75rem;
color: var(--tool-subcategory-text-color); color: var(--tool-subcategory-text-color);
white-space: nowrap; white-space: nowrap;
} }
.tool-subcategory-row-rule { .tool-subcategory-row-rule {
height: 1px; height: 1px;
background-color: var(--tool-subcategory-text-color); background-color: var(--tool-subcategory-rule-color);
flex: 1 1 auto; flex: 1 1 auto;
} }

View File

@ -128,7 +128,8 @@
--tool-header-badge-text: #004E99; --tool-header-badge-text: #004E99;
/* Subcategory title styling (light mode) */ /* Subcategory title styling (light mode) */
--tool-subcategory-text-color: #6B7280; --tool-subcategory-text-color: #9CA3AF; /* lighter text */
--tool-subcategory-rule-color: #E5E7EB; /* doubly lighter rule line */
--accent-interactive: #4A90E2; --accent-interactive: #4A90E2;
--text-instruction: #4A90E2; --text-instruction: #4A90E2;
--text-brand: var(--color-gray-700); --text-brand: var(--color-gray-700);
@ -274,7 +275,8 @@
--tool-header-badge-text: #FFFFFF; --tool-header-badge-text: #FFFFFF;
/* Subcategory title styling (dark mode) */ /* Subcategory title styling (dark mode) */
--tool-subcategory-text-color: #6B7280; --tool-subcategory-text-color: #9CA3AF; /* lighter text in dark mode as well */
--tool-subcategory-rule-color: #3A4047; /* doubly lighter (relative) line in dark */
} }
/* Dropzone drop state styling */ /* Dropzone drop state styling */