diff --git a/web/src/components/app/contacts/CategoryPicker.tsx b/web/src/components/app/contacts/CategoryPicker.tsx index db44f6b2..1106a0d8 100644 --- a/web/src/components/app/contacts/CategoryPicker.tsx +++ b/web/src/components/app/contacts/CategoryPicker.tsx @@ -22,6 +22,7 @@ import toast from "react-hot-toast"; import { useUserProfile } from "@/hooks/context/user"; import useClickOutside from "@/hooks/useClickOutside"; import useFlipPlacement from "@/hooks/useFlipPlacement"; +import clippedTitle from "@/lib/helper/titleWhenClipped"; import useCreateCategory from "@/lib/api/hooks/app/categories/useCreateCategory"; import type Category from "@/lib/api/models/app/Category"; @@ -218,14 +219,19 @@ export function CategoryChip({ category, onRemove, compact, + clamp, }: { category: { id: string; title: string; color: string }; onRemove?: () => void; compact?: boolean; + // For a chip sharing a line with text that has to stay readable (a contact's + // name in the list): hold the label to one width at every breakpoint, and + // hand the rest to a tooltip. + clamp?: boolean; }) { return ( - {category.title} + + {category.title} + {onRemove && (