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
- When a logged-in user views the PR list, the
useVoteStatushook callsGET /api/vote-status?prs=1,2,3,...with their session cookie. - The API endpoint authenticates via
GET /user, then batch-fetches reactions fromGET /repos/.../issues/{n}/reactionsfor each PR — the same reactions API the existing vote feature already uses. - Each PR card receives its vote status (
up,down, ornull) and renders a glow on the corresponding arrow. - When a user casts a new vote, the status updates optimistically via
onVotedcallback — 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.