Skip to content

[#5] Gallery: contributor credit + new-since-last-visit badge - #14

Open
lincai505011-ops wants to merge 1 commit into
quicksilverj2:mainfrom
lincai505011-ops:bounty-5
Open

[#5] Gallery: contributor credit + new-since-last-visit badge#14
lincai505011-ops wants to merge 1 commit into
quicksilverj2:mainfrom
lincai505011-ops:bounty-5

Conversation

@lincai505011-ops

Copy link
Copy Markdown

claiming #5

What

Shows contributor credit and "new since last visit" badge on gallery cards.

Changes

  • lib/api.ts — Added createdBy and createdAt fields to the Clone type (API already returns them)
  • app/page.tsx
    • Reads last-visit timestamp from localStorage on mount
    • Persists current timestamp after clones load
    • Shows green NEW badge on clones created after last visit
    • Shows "Built by <author>" for clones with a non-seed creator
  • app/globals.css — Styling for .card-header (flex), .new-badge (green pill), .card-author and .author-name

Design decisions

  • Uses useMemo for the new-slug set to avoid re-render flicker
  • Skips createdBy === 'seed' to keep the default seeded clone clean
  • Badge is temporary — resets when the viewer visits again and localStorage updates

Tested

  • ✅ Three files changed, TSX/CSS only
  • ✅ No regressions — existing card layout preserved, just wrapped in .card-header flex container

…badge

- Add createdBy/createdAt to frontend Clone type
- Show 'Built by <author>' on each clone card (skips 'seed' author)
- Persist last-visit timestamp in localStorage
- Display NEW badge on clones created after last visit
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.

1 participant