From f042e2af92815527d0807f50b99c710bf626278d Mon Sep 17 00:00:00 2001 From: rcourtman Date: Fri, 3 Oct 2025 09:38:51 +0000 Subject: [PATCH] Improve dashboard tag overflow indicator --- .../src/components/Dashboard/TagBadges.tsx | 87 ++++++++++--------- 1 file changed, 46 insertions(+), 41 deletions(-) diff --git a/frontend-modern/src/components/Dashboard/TagBadges.tsx b/frontend-modern/src/components/Dashboard/TagBadges.tsx index 98828c23b..ecb544bd7 100644 --- a/frontend-modern/src/components/Dashboard/TagBadges.tsx +++ b/frontend-modern/src/components/Dashboard/TagBadges.tsx @@ -18,53 +18,58 @@ export const TagBadges: Component = (props) => { const visibleTags = () => props.tags?.slice(0, maxVisible()) || []; const hiddenTags = () => props.tags?.slice(maxVisible()) || []; - const hasHiddenTags = () => hiddenTags().length > 0; + + const TagDot: Component<{ tag: string }> = (dotProps) => { + const colors = () => getTagColorWithSpecial(dotProps.tag, isDark()); + const isActive = () => props.activeSearch?.includes(`tags:${dotProps.tag}`) || false; + + return ( +
{ + const rect = e.currentTarget.getBoundingClientRect(); + showTooltip(dotProps.tag, rect.left + rect.width / 2, rect.top, { + align: 'center', + direction: 'up', + }); + }} + onMouseLeave={() => { + hideTooltip(); + }} + onClick={(e) => { + e.stopPropagation(); + props.onTagClick?.(dotProps.tag); + }} + > +
+
+ ); + }; return ( 0}>
- {(tag) => { - const colors = () => getTagColorWithSpecial(tag, isDark()); - const isActive = () => props.activeSearch?.includes(`tags:${tag}`) || false; - - return ( -
{ - const rect = e.currentTarget.getBoundingClientRect(); - showTooltip(tag, rect.left + rect.width / 2, rect.top, { - align: 'center', - direction: 'up', - }); - }} - onMouseLeave={() => { - hideTooltip(); - }} - onClick={(e) => { - e.stopPropagation(); - props.onTagClick?.(tag); - }} - > - {/* Colored dot indicator */} -
-
- ); - }} + {(tag) => } - {/* Show +X more indicator if there are hidden tags */} - + {/* Show the final dot if only one hidden tag remains */} + + + + + {/* Show +X more indicator if there are multiple hidden tags */} + 1}>
{ @@ -82,7 +87,7 @@ export const TagBadges: Component = (props) => { hideTooltip(); }} > -
+
+{hiddenTags().length}