diff --git a/src/components/prompts/CategoryBar.tsx b/src/components/prompts/CategoryBar.tsx index 5e3492db3..15866228c 100644 --- a/src/components/prompts/CategoryBar.tsx +++ b/src/components/prompts/CategoryBar.tsx @@ -1,5 +1,6 @@ "use client"; +import { ChevronRight } from "lucide-react"; import { cn } from "@/lib/utils"; import { ALL_CATEGORIES, CATEGORY_META, type PromptCategory, type PromptTemplate } from "@/config/prompt-library"; @@ -16,31 +17,49 @@ export function CategoryBar({ const counts = new Map( ALL_CATEGORIES.map((cat) => [cat, templates.filter((t) => t.category === cat).length]), ); + const visibleCats = ALL_CATEGORIES.filter((cat) => (counts.get(cat) ?? 0) > 0); + // Fourth horizontal-scroll surface in this codebase needing a mobile + // affordance — Today SummaryBar (4cb018c), Settings tab strip (7ab36d6), + // Projects status chips (0523927), now Prompts categories. Same pattern: + // ui-scroll-fade-right mask + ChevronRight pinned to the right edge of + // the relative wrapper, hidden on sm+ where chips wrap. Adds the fade + // mask that was previously missing here too. Threshold of 4 chips + // matches the pattern (1 All + 4 categories ≈ first overflow point). return ( -
- - {ALL_CATEGORIES.filter((cat) => (counts.get(cat) ?? 0) > 0).map((cat) => { - const meta = CATEGORY_META[cat]; - const isActive = active === cat; - return ( - - ); - })} +
+
+ + {visibleCats.map((cat) => { + const meta = CATEGORY_META[cat]; + const isActive = active === cat; + return ( + + ); + })} +
+ {visibleCats.length >= 3 && ( + + + + )}
); }