Skip to content

feat(dashboard): RecentlyViewed enrichment — images, NutriScore badges, time pills (#964)#970

Merged
ericsocrat merged 1 commit intomainfrom
feat/964-recently-viewed-enrichment
Mar 19, 2026
Merged

feat(dashboard): RecentlyViewed enrichment — images, NutriScore badges, time pills (#964)#970
ericsocrat merged 1 commit intomainfrom
feat/964-recently-viewed-enrichment

Conversation

@ericsocrat
Copy link
Owner

Summary

Enriches the RecentlyViewed compact list with product thumbnail images, NutriScore badges, styled time pills, and staggered slide-in-right animations.

Changes

  • Product thumbnails: next/image with OFF image URL, colored initial circle fallback
  • NutriScoreBadge: sm-size badge when nutri_score_label is present
  • Time pill: rounded-full bg-surface-secondary styled pill
  • Staggered animation: animate-slide-in-right with 30ms increment delay per item
  • View history link: renamed from View all to View history
  • i18n: added dashboard.viewHistory key (en/pl/de)

Tests

  • 6 new test cases (image rendering, fallback, NutriScoreBadge presence/absence, time pill styling, staggered animation)
  • Updated existing View all link test to View history
  • 20/20 tests pass

Closes #964

Copilot AI review requested due to automatic review settings March 19, 2026 18:17
@vercel
Copy link

vercel bot commented Mar 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tryvit Ready Ready Preview, Comment Mar 19, 2026 6:18pm

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@github-actions
Copy link

📸 PR Screenshots

Captured 6 screenshots (3 mobile, 3 desktop) for 3 changed page(s):

  • global-dashboard
  • global-scanner
  • i18n-dashboard

📥 Download screenshots from workflow artifacts.

Captured by PR Screenshots workflow • 2026-03-19

@github-actions
Copy link

Bundle Size Report

Metric Value
Main baseline 0 KB
This PR 0 KB
Delta +0 KB (+0%)
JS chunks 0
Hard limit 4000 KB

✅ Bundle size is within acceptable limits.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enriches the dashboard’s RecentlyViewed compact list by adding product thumbnails, Nutri-Score badges, a styled relative-time pill, and staggered entrance animations, along with an updated “View history” link label and new i18n strings.

Changes:

  • Render OFF thumbnail images (via next/image) with a fallback when no image is available.
  • Show NutriScoreBadge (sm) when nutri_score_label is present; style the relative time as a pill.
  • Add animate-slide-in-right with per-row staggered delays; rename “View all” to “View history” and add i18n keys/tests.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
frontend/src/styles/globals.css Adds --animate-slide-in-right motion token and reformats existing keyframes blocks.
frontend/src/components/dashboard/RecentlyViewed.tsx Adds thumbnail + NutriScore badge + time pill; wraps rows for staggered slide-in animation; updates link label to dashboard.viewHistory.
frontend/src/components/dashboard/RecentlyViewed.test.tsx Adds tests for image rendering/fallback, NutriScoreBadge presence, time pill styling, and staggered animation delay; updates link text expectation.
frontend/messages/en.json Adds dashboard.viewHistory translation.
frontend/messages/pl.json Adds dashboard.viewHistory translation.
frontend/messages/de.json Adds dashboard.viewHistory translation.

Comment on lines 55 to 61
<Link
href="/app/search"
className="inline-flex items-center gap-1 text-xs font-medium text-primary hover:underline"
>
{t("dashboard.viewAll")}
{t("dashboard.viewHistory")}
<ArrowRight className="h-3 w-3" aria-hidden="true" />
</Link>
Comment on lines 76 to 81
return (
<Link
<div
key={product.product_id}
href={`/app/product/${product.product_id}`}
data-testid="recently-viewed-item"
className="card hover-lift-press flex items-center gap-3 px-3 py-2.5 transition-shadow hover:shadow-md"
className="animate-slide-in-right"
style={{ animationDelay: `${index * 30}ms`, animationFillMode: "both" }}
>
Comment on lines +87 to +107
{/* Product thumbnail or score circle fallback */}
{product.image_thumb_url ? (
<Image
src={product.image_thumb_url}
alt={product.product_name}
width={36}
height={36}
className="h-9 w-9 shrink-0 rounded-lg object-cover"
loading="lazy"
/>
) : (
<div
className={`flex h-9 w-9 shrink-0 items-center justify-center rounded-full ${band?.bgColor ?? "bg-muted"}`}
>
<span
className={`text-xs font-bold tabular-nums ${band?.textColor ?? "text-foreground-secondary"}`}
>
{tryVit ?? "–"}
</span>
</div>
)}
@ericsocrat ericsocrat merged commit 7aa5106 into main Mar 19, 2026
22 checks passed
@ericsocrat ericsocrat deleted the feat/964-recently-viewed-enrichment branch March 19, 2026 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(dashboard): RecentlyViewed enrichment — images, NutriScore badges, time pills (#960)

2 participants