PR #201

7 votes · 7 up · 0 down

View on GitHub
7
Total Votes
+7
Upvotes
-0
Downvotes
+7-0

Comments(2)

bigintersmindComment#201Your arrows glow to show the flow of every vote below

Deployment Notes

No configuration changes needed. This feature works with the existing GitHub OAuth app and environment variables (GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET). No new env vars, no scope changes, no permission updates.

How it works

  1. When a logged-in user views the PR list, the useVoteStatus hook calls GET /api/vote-status?prs=1,2,3,... with their session cookie.
  2. The API endpoint authenticates via GET /user, then batch-fetches reactions from GET /repos/.../issues/{n}/reactions for each PR — the same reactions API the existing vote feature already uses.
  3. Each PR card receives its vote status (up, down, or null) and renders a glow on the corresponding arrow.
  4. When a user casts a new vote, the status updates optimistically via onVoted callback — no extra API round-trip needed.

Rate limiting

The endpoint caps at 50 PRs × 10 pages max per request. Failures on individual PRs are caught by Promise.allSettled and logged server-side — the rest of the votes still load. Users see a non-intrusive warning if something goes wrong.

openchaos-bot[bot]Comment#201Your arrows glow to show the flow of every vote below

🤖 OpenChaos Bot

Summary: This PR introduces a client-side hook and API endpoint to track and display a user's vote (up or down) on individual PRs using GitHub reactions. It also updates the UI to reflect the voting status with distinct styling.

Files changed: 9 (src/app/api/vote-status/route.ts, src/app/web2/web2.css, src/components/ExpandablePRSection.tsx, src/components/PRCard.tsx, src/components/ascii/ExpandablePRSection.tsx, src/components/ascii/PRCard.tsx, src/hooks/useVoteStatus.ts)

Vibe: Finally, a way to know if my rage-click actually registered in this beautiful dumpster fire!


openchaos-bot

All Activity(12)

bigintersmindComment#201Your arrows glow to show the flow of every vote below

Deployment Notes

No configuration changes needed. This feature works with the existing GitHub OAuth app and environment variables (GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET). No new env vars, no scope changes, no permission updates.

How it works

  1. When a logged-in user views the PR list, the useVoteStatus hook calls GET /api/vote-status?prs=1,2,3,... with their session cookie.
  2. The API endpoint authenticates via GET /user, then batch-fetches reactions from GET /repos/.../issues/{n}/reactions for each PR — the same reactions API the existing vote feature already uses.
  3. Each PR card receives its vote status (up, down, or null) and renders a glow on the corresponding arrow.
  4. When a user casts a new vote, the status updates optimistically via onVoted callback — no extra API round-trip needed.

Rate limiting

The endpoint caps at 50 PRs × 10 pages max per request. Failures on individual PRs are caught by Promise.allSettled and logged server-side — the rest of the votes still load. Users see a non-intrusive warning if something goes wrong.

openchaos-bot[bot]Comment#201Your arrows glow to show the flow of every vote below

🤖 OpenChaos Bot

Summary: This PR introduces a client-side hook and API endpoint to track and display a user's vote (up or down) on individual PRs using GitHub reactions. It also updates the UI to reflect the voting status with distinct styling.

Files changed: 9 (src/app/api/vote-status/route.ts, src/app/web2/web2.css, src/components/ExpandablePRSection.tsx, src/components/PRCard.tsx, src/components/ascii/ExpandablePRSection.tsx, src/components/ascii/PRCard.tsx, src/hooks/useVoteStatus.ts)

Vibe: Finally, a way to know if my rage-click actually registered in this beautiful dumpster fire!


openchaos-bot