From 9bb90f406f474666d9d4418d7cee437a67cc8530 Mon Sep 17 00:00:00 2001 From: ericsocrat Date: Thu, 19 Mar 2026 20:27:02 +0100 Subject: [PATCH] =?UTF-8?q?fix(frontend):=20standardize=20dashboard=20arro?= =?UTF-8?q?w=20icons=20=E2=80=94=20remove=20text=20arrows=20from=20i18n,?= =?UTF-8?q?=20add=20ArrowRight=20icons=20(#973)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove Unicode '→' from viewAll and viewHistory i18n keys in en/pl/de locales - Add ArrowRight lucide icon to CategoriesBrowse 'View all' link - Add ArrowRight lucide icon to NutritionTip 'Learn more' link - Fix double-arrow bug in RecentlyViewed 'View history' link (i18n '→' + icon) - All 4 dashboard navigation links now use consistent pattern: text + ArrowRight icon - Add 3 new tests verifying arrow icon presence and no text arrow artifacts - Update RecentlyViewed test mock to match new i18n values Closes #973 --- frontend/messages/de.json | 4 ++-- frontend/messages/en.json | 4 ++-- frontend/messages/pl.json | 4 ++-- .../dashboard/CategoriesBrowse.test.tsx | 16 ++++++++++++++++ .../components/dashboard/CategoriesBrowse.tsx | 4 +++- .../components/dashboard/NutritionTip.test.tsx | 9 ++++++++- .../src/components/dashboard/NutritionTip.tsx | 8 +++++--- .../components/dashboard/RecentlyViewed.test.tsx | 11 ++++++++++- 8 files changed, 48 insertions(+), 12 deletions(-) diff --git a/frontend/messages/de.json b/frontend/messages/de.json index 5fdde62b..aa020733 100644 --- a/frontend/messages/de.json +++ b/frontend/messages/de.json @@ -116,8 +116,8 @@ "favoritesEmptyCta": "Tippen Sie ❤️ auf einem Produkt", "newProducts": "Neue Produkte", "newInCategory": "Neu in {category}", - "viewAll": "Alle anzeigen →", - "viewHistory": "Verlauf anzeigen →", + "viewAll": "Alle anzeigen", + "viewHistory": "Verlauf anzeigen", "browse": "Durchsuchen →", "scanned": "Gescannt", "viewed": "Angesehen", diff --git a/frontend/messages/en.json b/frontend/messages/en.json index ec25813f..6443b6c6 100644 --- a/frontend/messages/en.json +++ b/frontend/messages/en.json @@ -116,8 +116,8 @@ "favoritesEmptyCta": "Tap \u2764\uFE0F on any product", "newProducts": "New Products", "newInCategory": "New {category}", - "viewAll": "View all →", - "viewHistory": "View history →", + "viewAll": "View all", + "viewHistory": "View history", "browse": "Browse →", "scanned": "Scanned", "viewed": "Viewed", diff --git a/frontend/messages/pl.json b/frontend/messages/pl.json index 424faabe..e24f93d2 100644 --- a/frontend/messages/pl.json +++ b/frontend/messages/pl.json @@ -116,8 +116,8 @@ "favoritesEmptyCta": "Kliknij \u2764\uFE0F przy produkcie", "newProducts": "Nowe produkty", "newInCategory": "Nowe {category}", - "viewAll": "Pokaż wszystko →", - "viewHistory": "Historia →", + "viewAll": "Pokaż wszystko", + "viewHistory": "Historia", "browse": "Przeglądaj →", "scanned": "Zeskanowane", "viewed": "Przeglądane", diff --git a/frontend/src/components/dashboard/CategoriesBrowse.test.tsx b/frontend/src/components/dashboard/CategoriesBrowse.test.tsx index 9f090df6..91e9716c 100644 --- a/frontend/src/components/dashboard/CategoriesBrowse.test.tsx +++ b/frontend/src/components/dashboard/CategoriesBrowse.test.tsx @@ -146,6 +146,22 @@ describe("CategoriesBrowse", () => { }); }); + it("View All link includes an arrow icon (no text arrow)", async () => { + mockGetCategoryOverview.mockResolvedValue({ + ok: true, + data: MOCK_CATEGORIES, + }); + render(, { wrapper: createWrapper() }); + await vi.waitFor(() => { + const viewAll = screen.getAllByRole("link").find( + (l) => l.getAttribute("href") === "/app/categories", + ); + expect(viewAll).toBeDefined(); + expect(viewAll!.querySelector("svg")).toBeInTheDocument(); + expect(viewAll!.textContent).not.toContain("\u2192"); + }); + }); + it("renders category icons for each chip", async () => { mockGetCategoryOverview.mockResolvedValue({ ok: true, diff --git a/frontend/src/components/dashboard/CategoriesBrowse.tsx b/frontend/src/components/dashboard/CategoriesBrowse.tsx index c878d35a..7c4d9261 100644 --- a/frontend/src/components/dashboard/CategoriesBrowse.tsx +++ b/frontend/src/components/dashboard/CategoriesBrowse.tsx @@ -10,6 +10,7 @@ import { queryKeys, staleTimes } from "@/lib/query-keys"; import { createClient } from "@/lib/supabase/client"; import type { CategoryOverviewItem } from "@/lib/types"; import { useQuery } from "@tanstack/react-query"; +import { ArrowRight } from "lucide-react"; import Link from "next/link"; function CategoryChip({ @@ -68,9 +69,10 @@ export function CategoriesBrowse() { {t("dashboard.viewAll")} +