From f51cea9a85a821850d8131eda7ce6bde01a7d121 Mon Sep 17 00:00:00 2001 From: Wassim SAMAD Date: Fri, 29 May 2026 14:29:46 -0400 Subject: [PATCH] feat(editor): Items category bar as icon-grid with tooltips (#349) Render the function-tree category roots as a Build-style square-tile grid (icon when available, otherwise a two-letter abbreviation) with a hover tooltip for the full name, so the Items and Build panels read the same. Share one TooltipProvider with disableHoverableContent + the icon-grid tooltip class to avoid the flicker when moving between adjacent tiles. Legacy fallback panel category bar wraps instead of scrolling horizontally. Co-authored-by: Claude Opus 4.7 --- .../items-panel/function-tree-panel.tsx | 83 +++++++++++-------- .../ui/sidebar/panels/items-panel/index.tsx | 2 +- 2 files changed, 50 insertions(+), 35 deletions(-) diff --git a/packages/editor/src/components/ui/sidebar/panels/items-panel/function-tree-panel.tsx b/packages/editor/src/components/ui/sidebar/panels/items-panel/function-tree-panel.tsx index b2670789..851170b8 100644 --- a/packages/editor/src/components/ui/sidebar/panels/items-panel/function-tree-panel.tsx +++ b/packages/editor/src/components/ui/sidebar/panels/items-panel/function-tree-panel.tsx @@ -1,10 +1,16 @@ 'use client' import type { AssetInput } from '@pascal-app/core' +import { Root as TooltipRoot } from '@radix-ui/react-tooltip' import NextImage from 'next/image' import { useMemo, useState } from 'react' import { cn } from '../../../../../lib/utils' import { ItemCatalog } from '../../../item-catalog/item-catalog' +import { + TooltipContent, + TooltipProvider, + TooltipTrigger, +} from '../../../../../components/ui/primitives/tooltip' /** A function-axis taxonomy node, assembled into a tree by the embedder. */ export type FunctionTreeNode = { @@ -109,40 +115,49 @@ export function FunctionTreePanel({ return (
- {/* Root nodes as category tabs */} -
- {functionTree.map((root) => { - const isActive = activeRoot?.slug === root.slug - return ( - - ) - })} -
+ {/* Root nodes as a category grid — icon when available, otherwise a + two-letter abbreviation, with the full name in a hover tooltip. + Mirrors the Build tab's tile grid so the two panels read the same. */} + +
+ {functionTree.map((root) => { + const isActive = activeRoot?.slug === root.slug + return ( + + + + + + {root.name} + + + ) + })} +
+
{/* Search + source filter */}
diff --git a/packages/editor/src/components/ui/sidebar/panels/items-panel/index.tsx b/packages/editor/src/components/ui/sidebar/panels/items-panel/index.tsx index e0ec0344..73d58092 100644 --- a/packages/editor/src/components/ui/sidebar/panels/items-panel/index.tsx +++ b/packages/editor/src/components/ui/sidebar/panels/items-panel/index.tsx @@ -173,7 +173,7 @@ function LegacyItemsPanel({ return (
{/* Category tabs */} -
+
{furnishTools.map((cat) => { const isActive = activeCategory.catalogCategory === cat.catalogCategory return (