Skip to content

Roasters: group pinned roasters above the directory, collapsed past three - #24

Merged
jameshiggins merged 1 commit into
mainfrom
feat/pinned-roasters-section
Sep 25, 2026
Merged

jameshiggins merged 1 commit into
mainfrom
feat/pinned-roasters-section

Conversation

@jameshiggins

Copy link
Copy Markdown
Owner

Summary

Pinned roasters used to be partitioned to the top of the same list. With more than a handful pinned, the first screen was all favourites and the directory started below the fold.

They now render as their own Pinned roasters (N) group above the directory, on both the mobile card list and the desktop table.

  • Up to three pins: the group is always open with a static heading.
  • More than three: it starts collapsed with a name preview (Alpha, Bravo, Charlie +2) and a chevron. The heading is a real <button> with aria-expanded / aria-controls. The visitor's open/closed choice is remembered in localStorage (new usePinnedSectionOpen hook).
  • No duplicates: pinned roasters no longer repeat in the main list, which gets an "All roasters" divider when both groups are present.
  • Filters and sort: the group honours the active region/country/search filters and the active sort. Mobile and desktop share the same expanded state.
  • Pinned chip behaviour is unchanged. With it on, the whole list is favourites so no separate group is shown. Signed out, nothing changes from today.

The card and row renderers were extracted into shared functions so the two groups cannot drift apart visually. No visual change to the rows themselves.

Test plan

  • npm run lint (0 errors, 15 pre-existing warnings)
  • npm run typecheck
  • npm test (343 passing; 9 in RoastersPage.pins.test.jsx cover threshold, persisted toggle, ?region= filtering, Pinned chip, mobile mirror, signed out)
  • npm run build
  • Manual: sign in, pin 4+ roasters, confirm collapsed group on /roasters with preview and that reopening persists across reloads

🤖 Generated with Claude Code

https://claude.ai/code/session_01WQPoqZvpFtcjR76PFyVv99


Generated by Claude Code

…hree

Pinned roasters used to be partitioned to the top of the same list, so
once a visitor had more than a handful pinned the first screen was all
favourites and the directory started below the fold.

They now render as their own "Pinned roasters (N)" group above the
directory, on both the mobile card list and the desktop table:

- Up to three pins the group is always open with a static heading.
- Past three it starts collapsed, with a name preview ("Alpha, Bravo,
  Charlie +2") and a chevron; the heading is a real button with
  aria-expanded / aria-controls. The visitor's open/closed choice is
  remembered in localStorage (usePinnedSectionOpen).
- Pinned roasters no longer repeat in the main list, which gets an
  "All roasters" divider when both groups are present.
- The group honours the active filters and sort, mirrors state across
  the mobile and desktop layouts, and disappears when the Pinned chip
  is on (the whole list is favourites then) or the visitor is signed out.

The card and row renderers are shared by both groups so they cannot
drift apart visually. Tests cover the threshold, the persisted toggle,
filter interaction, the Pinned chip, and the signed-out case.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WQPoqZvpFtcjR76PFyVv99
@vercel

vercel Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
coffee-tracker-react Ready Ready Preview Sep 24, 2026 9:21pm UTC
coffee-tracker-react-rrhm Ready Ready Preview Sep 24, 2026 9:21pm UTC

@jameshiggins
jameshiggins marked this pull request as ready for review September 25, 2026 02:24
@jameshiggins
jameshiggins merged commit 284e8a4 into main Sep 25, 2026
4 checks passed

This branch was successfully deployed

2 active deployments
Preview – coffee-tracker-react — 007fab8d Deployed Sep 24, 2026 by vercel[bot]
Preview – coffee-tracker-react-rrhm — 007fab8d Deployed Sep 24, 2026 by vercel[bot]
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.

2 participants