Skip to content

Feat/live gender ratio - #10

Merged
ad1t1-jha merged 4 commits into
mainfrom
feat/live-gender-ratio
Nov 10, 2026
Merged

ad1t1-jha merged 4 commits into
mainfrom
feat/live-gender-ratio

Conversation

@candle08

@candle08 candle08 commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Live gender ratio on admin page. /admin/live-ratio

Screenshot 2026-10-07 at 12 49 27 AM
  • polling backend every 5 seconds
  • gender decided from pronouns:
    she/her -> woman
    he/him -> man
    everything else is ignored
  • button on /admin that leads to this page

Code was written without being able to connect to Supabase so probably doesn't work 💀

candle08 and others added 2 commits October 6, 2026 21:36
Adds /admin/live-ratio: a standalone split-flap scoreboard showing the
live split between men and women among submitted profiles, for display
during an event.

- GET /api/admin/live-ratio returns the two counts. It uses two parallel
  HEAD count queries rather than selecting the pronouns column and
  tallying in JS, so it transfers no rows on each poll and is not subject
  to PostgREST's row ceiling (which would silently undercount past 1000
  submissions). Admin-only via requireAdminApi, and uncached.
- The board polls every 5s and renders each digit as a split-flap card:
  the old digit's top half hinges down about the centre line while the
  new digit's bottom half swings up behind it, with a per-digit stagger
  so the ones place leads. Shows a women:men ratio and a proportional
  split bar alongside the counts.
- src/lib/gender.ts holds the pronoun patterns. They mirror the mapping
  the matching algorithm uses (the nested getGender in
  matchmaker/embeddings.ts): he/him counts as men, she/her as women, and
  They/Them or Other are not counted. The two need to stay in step.
- Themed via the existing CSS variables, plus a --color-women-pink token
  that is deliberately not theme-swapped, since --color-valentine-pink
  resolves to blue under the default theme.
- Links from the admin dashboard header.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Caps every comment in the scoreboard files at two lines, keeping the
reasoning that is not evident from the code and dropping the narration.
The longest cuts were in globals.css: the split-flap header diagram, the
crease explanation and the box-shadow interpolation note.

Also moves a comment in FlapNumber.tsx back above endFlip, which it
describes. An earlier edit had inserted the creaseKey declaration between
the two, leaving it stranded above something unrelated.

No change to behaviour; comments only.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
speed-dataing Ready Ready Preview Oct 10, 2026 5:31pm UTC

FlapNumber and LiveRatioBoard were colocated under the route directory;
they now sit alongside the other shared components. The route keeps only
page.tsx, so /admin/live-ratio is unchanged.

Both imports become @/app/components/… aliases, matching how the rest of
that folder is imported.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@candle08
candle08 marked this pull request as ready for review October 7, 2026 04:58
@candle08
candle08 requested a review from ad1t1-jha October 7, 2026 05:01
@patel-aaryan
patel-aaryan self-requested a review October 7, 2026 20:21
@ad1t1-jha
ad1t1-jha merged commit 1926bbd into main Nov 10, 2026
2 checks passed

This branch was successfully deployed

1 active deployment
Preview — dfa8a691 Deployed Oct 10, 2026 by vercel[bot]
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.

3 participants