feat(hackathons): show registered project count per hackathon#72
Conversation
Each hackathon on /hackathons now surfaces how many projects are registered for it — curated JSON + community Nostr submissions, deduped via the existing mergeWithSubmissions() so the number matches the detail page's list one click away. - Timeline: count chip on the active StageCard (with tooltip), a count line on the prev/next peek cards, and the count folded into each rail node's aria-label. - Detail page: the "Proyectos" tab badge was curated-only and would have contradicted the new list number; it now uses the same merged count. - Extract the shared Nostr->submission mapper into lib/hackathons.ts (toHackathonSubmission) and drop the detail page's local copy. - Empty relay snapshots read as "unknown" rather than asserting "Sin proyectos", since this page has no client-side rescan to correct a bad read; Spanish tooltip agrees with the count (1 proyecto anotado). - Tag the page cache with the nostr submission tags so it revalidates with the shared relay snapshot. fix(css): scope the default border-color rule to @layer base The unlayered `* { border-color: var(--border) }` outranked Tailwind 4's @layer utilities, silently overriding every accent border in the app (border-bitcoin/*, border-success/*, border-border-strong, hover/focus variants). Moving it into @layer base restores those while still superseding Preflight's default. Verified no regressions: elements without an explicit border-color utility keep the flat default. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughHackathon pages now use Nostr snapshots and shared merge utilities to calculate project counts, display them across timeline and detail views, and preserve unknown states. A global border rule is moved into Tailwind’s base layer to preserve utility precedence. ChangesHackathon project count flow
Border CSS layering
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant HackathonsPage
participant NostrSnapshot
participant toHackathonSubmission
participant mergeWithSubmissions
participant HackathonTimeline
NostrSnapshot-->>HackathonsPage: return project snapshot and cache tags
HackathonsPage->>toHackathonSubmission: convert snapshot projects
HackathonsPage->>mergeWithSubmissions: merge projects for each hackathon
mergeWithSubmissions-->>HackathonsPage: deduplicated project counts
HackathonsPage->>HackathonTimeline: provide timeline items with projectCount
HackathonTimeline-->>HackathonsPage: render count labels and cards
Possibly related PRs
🚥 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 |
What
Every hackathon on
/hackathonsnow shows how many projects are registered for it.The count is curated JSON projects + community Nostr submissions, deduped by id/repo/name via the existing
mergeWithSubmissions()— the same merge the detail page's list renders, so the number matches what you see one click away.Where it shows (all three surfaces of the timeline)
FolderGit2chip (6 proyectos) with a tooltip, emphasized when non-zero.aria-label.Consistency fix
The detail page's "Proyectos" tab badge was counting curated only, so it would have contradicted the new list number. It now uses the same merged count. Verified live: commerce shows 10 on both pages (the tab previously showed 6); ai-agents shows 6 on both (the tab previously showed nothing).
Robustness
buildSubmissionsSnapshotswallows relay errors and returns[], so a relay outage is indistinguishable from "nobody entered" — and unlike the detail page, this list has no client-side rescan to correct a bad read. The count is thereforenumber | null; an empty snapshot renders nothing rather than asserting "Sin proyectos". Spanish tooltip copy also agrees with the count (1 proyecto anotado … para verlo).Caching
The page is tagged with the nostr submission tags so it revalidates with the shared relay snapshot (picks up the
nostrprofile: 5m revalidate / 1w expire).Refactor
Extracted the Nostr→submission mapper (inlined in several places) into
lib/hackathons.ts:toHackathonSubmissionand used it to drop the detail page's local copy.Bonus: CSS cascade-layer bug fix
While verifying, I found a pre-existing, repo-wide bug:
app/globals.csshad an unlayered* { border-color: var(--border) }. In Tailwind 4, utilities live in@layer utilities, and unlayered CSS outranks every layer — so that one rule silently overrode every accent border in the app (border-bitcoin/*,border-success/*,border-nostr/*,border-border-strong, andhover:/focus-visible:variants). None of them rendered.Fixed by scoping the rule to
@layer base, where it still supersedes Preflight's default but any utility wins.Verification
tsc --noEmitclean;pnpm buildexits 0./hackathons,/projects,/soldados: 0 elements without an explicit border-color utility changed color — nothing that relied on the old uniform grey regressed.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes