feat(card): real FOMO door tally on rejection screen#2307
Conversation
The 'not tonight' Berghain screen rendered a hardcoded '213 tried · 7 got in' (props defaulted to 213/7 and the page never passed real values). Now /card returns waitlistTotal + admittedTotal; the screen inflates 'tried' for FOMO (real waitlist size x3, floored at 213 — mirrors the /shhhhh ScarcityCounter fake-scarcity flex) and shows the real 'got in'. Inflation is a pure, deterministic fn so it never jitters between renders; a sane 213/7 fallback covers the still-loading window. /dev/rejection-builder now drives the real counts and previews the inflated result. Requires the BE PR (waitlistTotal/admittedTotal on /card) deployed first.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 9 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
Comment |
Code-analysis diffPainscore total: 5843.8 → 5850.46 (+6.66) 🆕 New findings (14)
✅ Resolved (13)
📈 Painscore deltas (top movers)
|
🧪 UI test report — ✅ all greenSuites
📊 Coverage (unit)
⏱ 10 slowest test cases
|
CI typecheck caught existing CardInfoResponse mocks (e.g. cardState.utils .test.ts) breaking because the new fields were required. Optional is also the correct contract: the BE deploys first, but the FE must tolerate undefined during the rollout window (and for any older API) — computeDoorTally already falls back to 213/7. Full `tsc --noEmit` + `npm test` now green.
At x3 the real number is masked by the 213 floor (prod waitlist ~55 -> 55x3 = 165 < 213, so it just renders the hardcoded-looking 213). x5 = 275 clears the floor, so the real inflated count actually shows. Counts source + floor + fallback unchanged.
What
The Berghain "not tonight" card-rejection screen showed a hardcoded door tally —
CardRejectionScreendefaultedapplicants = 213, admitted = 7andcard/page.tsxnever passed real values, so the static defaults always rendered.Now it's real / semi-real:
/card→waitlistTotal) inflated for FOMO —max(213, round(waitlistTotal × 5)). Mirrors how/shhhhh'sScarcityCounteralready fakes scarcity ("only 20 a week")./card→admittedTotal), shown verbatim.The inflation lives in a new pure helper
src/components/Card/doorTally.utils.ts(inflateApplicants/computeDoorTally), so it's deterministic per render (noMath.random, no jitter). A213 / 7fallback covers the still-loading window. Hardcoded213/7defaults removed from the component (props are nowwaitlistTotal/admittedTotal, both optional so existing mocks + the BE-deploys-first rollout tolerateundefined)./dev/rejection-builderupdated: sliders now drive the real backend counts and the panel previews the inflated "renders as: N tried · M got in".Design (3 lines)
GET /card→waitlistTotal(all who joined the queue) +admittedTotal(all released/granted).tried = max(213, round(waitlistTotal × 5));got in = admittedTotal(verbatim). ×5 (not ×3) so the real count clears the 213 floor at the current prod waitlist size (~55 → 275 > 213); below that the floor would mask it and the tally would look frozen at 213.Cross-repo — BE must deploy first
feat/door-tally-real-counts), which addswaitlistTotal/admittedTotaltoGET /card. Merge + deploy that first. Until then the FE readsundefinedand renders the213 / 7fallback — safe (no crash, just the old static-looking copy), but not the real numbers.Tests
src/components/Card/__tests__/doorTally.utils.test.ts: ×5 multiplier, floor clamp, "clears the floor at ~55" case, rounding, fallbacks (undefined/NaN/0/negative/Infinity), determinism,admitted=0is real (not the fallback). Fulltsc --noEmit+ fullnpm testgreen; prettier clean.eslint note
The repo-wide
eslintcheck is red on pre-existing violations in files this PR does not touch (add-money/*,dev/debug/page.tsx). None of this PR's files appear in the eslint output, and the requiredci-successaggregate passes regardless (eslint is advisory per the ruleset).