Skip to content

[FIX] Reviews tab: GitHub-approved PRs leave open work - #16

Merged
haimbj1 merged 1 commit into
mainfrom
fix/gh-approved-state
Sep 24, 2026
Merged

haimbj1 merged 1 commit into
mainfrom
fix/gh-approved-state

Conversation

@haimbj1

@haimbj1 haimbj1 commented Sep 24, 2026

Copy link
Copy Markdown
Owner

Why

A PR approved on GitHub kept sitting under "open work". Two causes:

  1. GitHub removes the review request the moment a review is submitted, so the approved PR vanishes from the collector's review-requested: search — the approval was never collected. The row survived only via its offline review file, which carries no GitHub state.
  2. my_review took the single most recent review event. A later thread reply lands as a COMMENTED review and masked a standing approval.

What

  • New reviewed-by:<login> search in collect.sh writes my_reviews.json (url → my effective review state) for open PRs I already reviewed; best-effort, a failed fetch keeps the previous file.
  • my_review is now the effective state: the newest APPROVED / CHANGES_REQUESTED wins over trailing COMMENTED events (last:10 instead of last:1).
  • build.py ships the map as DATA.my_reviews; the page seeds GH_MY_REVIEW from it, so the existing decided logic and the "✓ approved on GitHub" pill now cover rows with no live request too.

Verified: shellcheck, py_compile, CI script-extraction + node --check, jq fixtures for the effective-state expression (approve-then-comment stays APPROVED), and the live reviewed-by query returns the expected APPROVED map.

@haimbj1
haimbj1 merged commit ac464be into main Sep 24, 2026
1 check passed
@haimbj1
haimbj1 deleted the fix/gh-approved-state branch September 24, 2026 07:35
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