Align venue card actions and hide venues with no beer inventory - #132
Merged
Merged
Conversation
Exclude venues with no On Tap or In Can beer at the /where-to-buy page boundary so they never reach grouping, filter options, or counts — a venue showing no inventory (e.g. Island Flavor) no longer renders. Bottom-align card action rows with a flex column + mt-auto so buttons line up across a grid row regardless of beer-list length. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Reviewer's GuideThe PR centralizes a format-based stocked-venue rule and applies it at the public page data boundary, preventing empty venues from affecting rendering or derived filters, while updating fixture/test coverage and making venue action rows bottom-align across cards of different content heights. Sequence diagram for public venue directory data preparationsequenceDiagram
participant Page as WhereToBuyPage
participant VenueSource as getVenues
participant Filter as venueIsStocked
participant Options as carriedBeerOptions
participant Islands as distinctIslands
participant Directory as VenueDirectory
Page->>VenueSource: getVenues()
VenueSource-->>Page: fetchedVenues
Page->>Filter: venueIsStocked(venue)
Filter-->>Page: stocked venues
Page->>Options: carriedBeerOptions(venues, beers)
Page->>Islands: distinctIslands(venues)
Page->>Directory: render filtered venues and derived data
Flow diagram for stocked venue filteringflowchart LR
A[getVenues] --> B[venueIsStocked]
B -->|tapBeerSlugs or canBeerSlugs present| C[Public venues]
B -->|neither format has beer| D[Excluded venues]
C --> E[carriedBeerOptions]
C --> F[distinctIslands]
C --> G[VenueDirectory]
D -.-> H[No public rendering or derived filters]
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two related /where-to-buy fixes:
flex flex-colwith the actions wrapper onmt-auto pt-4, so Directions / Website / Instagram / Facebook line up regardless of how many beer lines each card shows.tapBeerSlugsorcanBeerSlugs— the same predicateVenueCarduses to render its On Tap / In Can lines.carriesBeerSlugsalone does not count (it produces no visible inventory). Filtering happens at the page data boundary inwhere-to-buy/page.tsx, beforecarriedBeerOptions,distinctIslands, andVenueDirectory— so unstocked venues cannot affect counts, island groups, filter options, empty states, or analytics, and cannot be resurrected via query-string filters.Closes #130
Changes
lib/venue-filters.ts— newvenueIsStockedhelper;hasAnyFormatDatanow delegates to it.app/(pages)/where-to-buy/page.tsx—venues.filter(venueIsStocked)right aftergetVenues().app/(pages)/where-to-buy-fixture/page.tsx— same filter so the test route exercises the production rule.components/venue-card.tsx— card rootflex h-full flex-col; actionsmt-4→mt-auto pt-4.lib/where-to-buy-fixture.ts— Quiet Cafe now lists pilsner on tap (preserves the Where to Buy fragments Saba venues into multiple sections with lowercase headings #116 three-locality coverage); Bottle Shop gains a website link; newFixture Empty Cantina(Statia, valid name/location/type/links, zero beer) as the Island Flavor-style regression venue.tests/lib/venue-filters.test.ts— newvenueIsStockeddescribe covering tap-only / can-only / both / neither / carries-only, plus downstream island/group/beer-option exclusion; fixture-based expectations updated.smoke-tests/where-to-buy-filters.spec.ts— new tests: empty venue absent + Statia group/option absent +?island=statiasanitizes away; action-row top alignment ≤1px at 1280px. Updated counts for Quiet Cafe's new beer.Verification
npm cinpm run check:react-versions— react/react-dom 19.3.0 matchnpx tsc --noEmit— cleannpm run lint— clean (pre-existing TSSatisfiesExpression parser note only)npm test— 355/355 passnpm run test:rules— 29/29 passnpm run build— cleannpx playwright test— 123/123 pass (includes 2 new tests)npm run check:md-links— all links resolvenpm audit --omit=dev— 0 vulnerabilitiesBrowser-verified at 1280px: Tavern (2 beer lines) and Bottle Shop (1 line) action rows both at y=588 — 0px delta. The new alignment test fails against the old implementation (28px misalignment). At 375px, stacking is natural with no horizontal overflow.
Risk / deployment notes
Generated with Devin
Summary by Sourcery
Hide venues without visible beer inventory and align venue card actions across grid rows.
New Features:
Bug Fixes:
Enhancements:
Tests: