Files
kandev/apps/web/components
João Salavisa c31dcd973a fix(web): gate merge button on required_reviews so it matches GitHub (#993)
* fix(web): gate merge button on required_reviews so it matches GitHub

GitHub's mergeable_state can lag branch-protection state (dismissed
approvals, fresh-commit invalidations, partial polls), letting the
green merge button appear when GitHub itself still says blocked.
isPRReadyToMerge now refuses to surface the button when the recorded
approval count is below required_reviews, mirroring the "K / M required"
pair the CI popover already renders. isPRAwaitingReview follows the
same gate so the icon shows sky-blue "awaiting review" instead of
plain green when approvals are short.

* test(web): cover bug-repro path in getPRStatusColor + trim guard comments

Address Claude review on #993: trim the two new multi-line guard comments
in isPRReadyToMerge / isPRAwaitingReview to one short line each (per
CLAUDE.md), and add a getPRStatusColor regression test that confirms the
icon downgrades from emerald to sky-400 in the stale-clean + unmet
required_reviews scenario the PR fixes.

* chore(web): collapse required_reviews guard comment to one line

Final pass on CLAUDE.md's one-short-line-max comment rule, per Claude
review thread on #993.

---------

Co-authored-by: Kandev Agent <agent@kandev.dev>
2026-05-21 15:29:18 +01:00
..
2026-02-19 22:18:01 +00:00