diff --git a/frontend/src/components/shared/TopControls.tsx b/frontend/src/components/shared/TopControls.tsx index 229c3d362..6b4caf7e4 100644 --- a/frontend/src/components/shared/TopControls.tsx +++ b/frontend/src/components/shared/TopControls.tsx @@ -6,6 +6,7 @@ import VisibilityIcon from "@mui/icons-material/Visibility"; import EditNoteIcon from "@mui/icons-material/EditNote"; import FolderIcon from "@mui/icons-material/Folder"; import { ModeType, isValidMode } from '../../contexts/NavigationContext'; +import { Tooltip } from "./Tooltip"; const viewOptionStyle = { display: 'inline-flex', @@ -17,44 +18,56 @@ const viewOptionStyle = { } -// Create view options with icons and loading states -const createViewOptions = (switchingTo: ModeType | null) => [ +// Build view options showing text only for current view; others icon-only with tooltip +const createViewOptions = (currentView: ModeType, switchingTo: ModeType | null) => [ { label: ( -
- {switchingTo === "viewer" ? ( - - ) : ( - - )} - Read -
+ +
+ {currentView === "viewer" ? ( + <> + {switchingTo === "viewer" ? : } + Viewer + + ) : ( + switchingTo === "viewer" ? : + )} +
+
), value: "viewer", }, { label: ( -
- {switchingTo === "pageEditor" ? ( - - ) : ( - - )} - Page Editor -
+ +
+ {currentView === "pageEditor" ? ( + <> + {switchingTo === "pageEditor" ? : } + Page Editor + + ) : ( + switchingTo === "pageEditor" ? : + )} +
+
), value: "pageEditor", }, { label: ( -
- {switchingTo === "fileEditor" ? ( - - ) : ( - - )} - File Manager -
+ +
+ {currentView === "fileEditor" ? ( + <> + {switchingTo === "fileEditor" ? : } + Active Files + + ) : ( + switchingTo === "fileEditor" ? : + )} +
+
), value: "fileEditor", }, @@ -103,11 +116,10 @@ const TopControls = ({ {!isToolSelected && (
diff --git a/frontend/src/components/tools/toolPicker/ToolButton.tsx b/frontend/src/components/tools/toolPicker/ToolButton.tsx index f9841220a..73c617540 100644 --- a/frontend/src/components/tools/toolPicker/ToolButton.tsx +++ b/frontend/src/components/tools/toolPicker/ToolButton.tsx @@ -12,7 +12,9 @@ interface ToolButtonProps { } const ToolButton: React.FC = ({ id, tool, isSelected, onSelect }) => { + const isUnavailable = !tool.component && !tool.link; const handleClick = (id: string) => { + if (isUnavailable) return; if (tool.link) { // Open external link in new tab window.open(tool.link, '_blank', 'noopener,noreferrer'); @@ -22,8 +24,12 @@ const ToolButton: React.FC = ({ id, tool, isSelected, onSelect onSelect(id); }; + const tooltipContent = isUnavailable + ? (Coming soon: {tool.description}) + : tool.description; + return ( - + diff --git a/frontend/src/components/viewer/Viewer.tsx b/frontend/src/components/viewer/Viewer.tsx index c1a2b440a..cdf831c06 100644 --- a/frontend/src/components/viewer/Viewer.tsx +++ b/frontend/src/components/viewer/Viewer.tsx @@ -550,12 +550,14 @@ const Viewer = ({ justifyContent: "center", pointerEvents: "none", background: "transparent", + }} > allTools[key].component !== null || allTools[key].link) - .reduce((obj, key) => { - obj[key] = allTools[key]; - return obj; - }, {} as ToolRegistry); - return filteredTools; } + const filteredTools = Object.keys(allTools) + .filter(key => allTools[key].component !== null || allTools[key].link) + .reduce((obj, key) => { + obj[key] = allTools[key]; + return obj; + }, {} as ToolRegistry); + return filteredTools; }, [t]); // Only re-compute when translations change } diff --git a/frontend/src/hooks/useToolSections.ts b/frontend/src/hooks/useToolSections.ts index 41762a8e1..d0f6ebdca 100644 --- a/frontend/src/hooks/useToolSections.ts +++ b/frontend/src/hooks/useToolSections.ts @@ -64,7 +64,9 @@ export function useToolSections(filteredTools: [string /* FIX ME: Should be Tool Object.entries(subs).forEach(([s, tools]) => { const subcategoryId = s as SubcategoryId; if (!quick[subcategoryId]) quick[subcategoryId] = []; - quick[subcategoryId].push(...tools); + // Only include ready tools (have a component or external link) in Quick Access + const readyTools = tools.filter(({ tool }) => tool.component !== null || !!tool.link); + quick[subcategoryId].push(...readyTools); }); } });