Files
MC-SurvivalWiki-Tips/tips/2026-06-19-008-social-recently-viewed-widget-on-homepage.md

1.1 KiB

Tip #8 — Recently-Viewed widget on homepage

Date: 2026-06-19
Category: social
Source: MC-Survival Wiki Daily Tip (backfilled from state.json)

Recently-Viewed widget on homepage

A recently-viewed widget tracks the last 20 recipes a user opened (server-side for logged-in, localStorage for anonymous) and renders them as a horizontal scroll row on the homepage. It solves the cold-start problem of returning users, who otherwise have to remember or re-search for what they were reading yesterday. The signal is session analytics: the most-clicked element on most wikis is 'go back to what I was just doing', and a recently-viewed strip is the simplest way to surface that. The horizontal scroll pattern matches the existing nav-card components, so the implementation cost is essentially zero once the tracking is in place.

Implementation tips

  1. Track recipe views server-side in a RecipeView table (or just count in the Recipe model).
  2. For anonymous: localStorage of last 20 viewed slugs. For logged-in: server-side list of last 20.
  3. Render as a horizontal scroll-row on the homepage — same component as the existing nav cards.