fix(web): showtime chips buy the exact showing — per-showtime ticketUrl from payload - #76
Conversation
…rl from payload Pressing a time pill on the /agent-showtimes card could not purchase anything: every chip's href was ticketLinkout(film.title), a Fandango title SEARCH (and the Fandango affiliate program is defunct — the page removed, FlexOffers/Admitad list it inactive). The real AMC purchase URLs never reached the card. The payload (additive v:1) now carries ticket links and the chip href resolves in priority order: 1. the showtime's own ticketUrl — AMC per-showing checkout deep link 2. the cinema's ticketUrl — source-level fallback 3. ticketLinkout(title) — legacy title search, old payloads only ShowtimeV1 and CinemaV1 gain optional ticketUrl; buildFilmSections threads the cinema fallback; contract doc updated (shared-payloads.md). Agent side ships the matching payload fields (spool-agent: per-showtime purchaseUrl threaded marshal → source → card composer). Tests: chip prefers per-showtime link, falls back to cinema link, legacy payloads keep the search fallback, and format-grouped showings carry per-chip links. 731 tests green. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
📝 WalkthroughWalkthroughThe showtimes payload contract now accepts optional showtime- and cinema-level ticket URLs. Chip rendering prioritizes those links and retains the legacy Fandango fallback, with tests covering standard and format-grouped showings. ChangesShowtime Ticket Links
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
services/__tests__/agentShowtimesCard.test.ts (1)
119-189: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winConsider adding a test for the full priority chain (showtime
ticketUrlover cinematicketUrl).The three new tests each exercise two levels of the priority chain, but none verify that a per-showtime
ticketUrltakes precedence over a cinema-levelticketUrlwhen both are present. A test combining both would close the gap and confirm the complete resolution order in a single case.🧪 Suggested test
it('per-showtime ticketUrl takes priority over cinema-level ticketUrl', () => { const buy = 'https://www.amctheatres.com/showtimes/all/2026-07-13/bay-street/all/111'; const cinemaBuy = 'https://www.amctheatres.com/movie-theatres/bay-street-16'; const view = buildShowtimesView( singleFilmPayload({ cinemas: [ cinema({ ticketUrl: cinemaBuy, films: [ { movieGluId: 100, title: 'Dune: Part Two', times: [ { start: '2026-07-12T19:30:00-07:00', label: '7:30 PM', ticketUrl: buy }, { start: '2026-07-12T22:00:00-07:00', label: '10:00 PM' }, ], }, ], }), ], }), ); if (view.kind !== 'loaded') throw new Error('expected loaded'); const chips = view.cinemas[0].films[0].sections[0].chips; expect(chips[0].href).toBe(buy); // showtime wins expect(chips[1].href).toBe(cinemaBuy); // linkless sibling falls to cinema });🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@services/__tests__/agentShowtimesCard.test.ts` around lines 119 - 189, Add a test alongside the existing href-priority tests that sets both cinema.ticketUrl and per-showtime ticketUrl using buildShowtimesView. Assert the showtime chip uses its own ticketUrl, while a linkless sibling falls back to the cinema-level URL, covering the complete priority chain.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@services/__tests__/agentShowtimesCard.test.ts`:
- Around line 119-189: Add a test alongside the existing href-priority tests
that sets both cinema.ticketUrl and per-showtime ticketUrl using
buildShowtimesView. Assert the showtime chip uses its own ticketUrl, while a
linkless sibling falls back to the cinema-level URL, covering the complete
priority chain.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: c0704909-5a30-4384-986c-9710c0a41d55
📒 Files selected for processing (3)
docs/contracts/shared-payloads.mdservices/__tests__/agentShowtimesCard.test.tsservices/agentShowtimesCard.ts
Why
Pressing a time pill on the showtimes card opened a Fandango title search — not a purchase. The AMC per-showing checkout URLs (live since this morning's spool-agent deploy) never reached the card payload, and the web chips had a hardcoded search placeholder from before AMC went live.
What
ShowtimeV1andCinemaV1gain optionalticketUrl(additivev:1, old payloads parse and render unchanged).purchaseUrlper showtime through marshal → source → card composer, with composer tests.Tests
Chip prefers the per-showtime link, falls back to the cinema link, keeps the legacy search for old payloads, and format-grouped showings carry per-chip links. Full suite 731 green.
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation