From 7e684176ab0f48acf8c129a13c9694bba4bbfce3 Mon Sep 17 00:00:00 2001 From: Jean-Luc Makiola Date: Sun, 19 Apr 2026 20:14:28 +0200 Subject: [PATCH] fix(35): WR-04 use startsWith/slice for brand-stripping to avoid mid-string matches Co-Authored-By: Claude Sonnet 4.6 --- src/client/components/ItemCard.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/client/components/ItemCard.tsx b/src/client/components/ItemCard.tsx index 974898a..a0c8a4a 100644 --- a/src/client/components/ItemCard.tsx +++ b/src/client/components/ItemCard.tsx @@ -60,6 +60,11 @@ export function ItemCard({ const openExternalLink = useUIStore((s) => s.openExternalLink); const duplicateItem = useDuplicateItem(); + const displayName = + brand && name.startsWith(`${brand} `) + ? name.slice(brand.length + 1) + : name; + const handleClick = linkTo === null ? undefined @@ -230,7 +235,7 @@ export function ItemCard({ )}

- {brand ? name.replace(`${brand} `, "") : name} + {displayName}

{quantity != null && quantity > 1 && (