Skip to content

feat(hackathons): show registered project count per hackathon#72

Merged
agustinkassis merged 1 commit into
mainfrom
claude/hackathons-project-count-3ecdef
Jul 22, 2026
Merged

feat(hackathons): show registered project count per hackathon#72
agustinkassis merged 1 commit into
mainfrom
claude/hackathons-project-count-3ecdef

Conversation

@agustinkassis

@agustinkassis agustinkassis commented Jul 22, 2026

Copy link
Copy Markdown
Member

What

Every hackathon on /hackathons now 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)

  • Active card — a FolderGit2 chip (6 proyectos) with a tooltip, emphasized when non-zero.
  • Prev/next peek cards — a compact count line.
  • Rail nodes — the count appended to each node's 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

buildSubmissionsSnapshot swallows 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 therefore number | 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 nostr profile: 5m revalidate / 1w expire).

Refactor

Extracted the Nostr→submission mapper (inlined in several places) into lib/hackathons.ts:toHackathonSubmission and 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.css had 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, and hover:/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 --noEmit clean; pnpm build exits 0.
  • Counts confirmed on the running dev server (list page ↔ detail tab now agree).
  • Accent borders now render (green "en curso" card, purple difficulty pill, orange highlights).
  • Automated regression sweep across /hackathons, /projects, /soldados: 0 elements without an explicit border-color utility changed color — nothing that relied on the old uniform grey regressed.

Note: the CSS change touches a global stylesheet served by Turbopack; a .next cache clear + dev restart was needed for it to take effect during testing.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Hackathon timelines now display project counts for each event.
    • Project counts appear in timeline cards, badges, tooltips, and accessible labels.
    • Counts distinguish known totals from unavailable submission data.
    • Hackathon pages now include combined curated and community project totals.
    • Timeline information reflects the latest available project submissions.
  • Bug Fixes

    • Corrected project totals so tab and badge counts match the projects displayed.
    • Improved border styling so accent border utilities render correctly.

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>
@vercel

vercel Bot commented Jul 22, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
lacrypta-dev Ready Ready Preview, Comment Jul 22, 2026 10:47pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 564e86c1-048a-4076-841e-5b16e5efc66f

📥 Commits

Reviewing files that changed from the base of the PR and between 25ff08a and e28867e.

📒 Files selected for processing (5)
  • app/globals.css
  • app/hackathons/HackathonTimeline.tsx
  • app/hackathons/[id]/page.tsx
  • app/hackathons/page.tsx
  • lib/hackathons.ts

📝 Walkthrough

Walkthrough

Hackathon 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.

Changes

Hackathon project count flow

Layer / File(s) Summary
Submission provenance mapping
lib/hackathons.ts
Adds shared Nostr provenance types and a generic mapper for producing HackathonSubmission objects.
Snapshot-backed timeline counts
app/hackathons/page.tsx
Loads and tags the Nostr snapshot, converts projects, merges submissions, and distinguishes known zero counts from unknown counts.
Timeline project count presentation
app/hackathons/HackathonTimeline.tsx
Adds project-count labels, accessibility text, tooltips, icons, pills, and emphasized chips to timeline cards.
Detail-page merged totals
app/hackathons/[id]/page.tsx
Uses shared conversion and merge utilities to calculate the project total shown by the detail tabs.

Border CSS layering

Layer / File(s) Summary
Base-layer border rule
app/globals.css
Moves the universal border-color rule into @layer base so utility-layer border colors can override it.

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
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: showing registered project counts per hackathon.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/hackathons-project-count-3ecdef

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@agustinkassis
agustinkassis merged commit f4a2418 into main Jul 22, 2026
2 of 3 checks passed
@agustinkassis
agustinkassis deleted the claude/hackathons-project-count-3ecdef branch July 22, 2026 22:47
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.

1 participant