Repository navigation
fix(web): a merged or closed PR drops the live approvals and checks cards - #669
Conversation
…ards A merged PR still showed "No approvals yet" and "No checks reported" under the merge event, as if it were waiting to merge. Those cards now show only while the PR is open; the reviewers rail keeps the reviews and Branch rules at merge keeps the audit. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 51 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
PastaPastaPasta
left a comment
There was a problem hiding this comment.
Verdict: approve
Hiding the live Approvals card and ChecksRow on every non-open PR is right. I found no state where a user loses something they need. tsc --noEmit is clean on the PR head, after a fresh pnpm install --frozen-lockfile.
Flows checked
- Record merge, unverified merge and "Mark as merged" are unaffected.
RecordMergeBoxandUnverifiedMergeNoterender above the changed fragment. Both oids are null unlessunrecordedMergeCandidateholds, which needspull.state.open && !merged(forge-web/lib/view/pull-actions.ts:656-666). "Mark as merged" lives in the open merge box. A PR detected as merged by content but not yet recorded is stillopen, so it keeps both cards. That's correct: the merge it would record is still judged against them. - Closed (unmerged) PRs and reopen decisions: the Reviewers rail is unconditional (
forge-web/components/repo/pull-content.tsx:2458) and the Checks tab stays inPR_TABS, so verdicts and runs are still one click away. Reopening brings the cards back. - Private merged PRs: these lose the approvals summary and get no Branch rules at merge in its place (
pull-content.tsx:2044, public only), so only the Reviewers rail shows verdicts. That's acceptable and no worse than a closed PR. A private audit is a separate gap, not this PR's.
Nits (non-blocking)
forge-web/e2e/collab-copy.spec.ts:48:checks-rowtoHaveCount(0)can pass without the fix.RulesAtMergerenders its<details data-testid="rules-at-merge">straight away, and the audit is read only when it is opened (components/repo/rules-at-merge.tsx:39-48). So thetoBeVisiblebefore it doesn't wait for anything async. MeanwhileChecksRowreturns null until the asyncreadCheckRunslands (pull-content.tsx:548,2739). On a pre-fix build the assertion can win that race. Before the negative check, wait for a signal that the checks read has settled, for example the Checks tab's content. The positiverules-at-mergeassertion does confirm the fixture repo is public, and the Approvals assertion is sound becausethreadis loaded by then.pull-content.tsx:2091:{!open ? null : a ? X : b ? Y : null}reads a little backwards next to the{open ? <ChecksRow/> : null}two lines below. Oneopen ? (<>…</>) : nullaround both would be a touch clearer. The diff is minimal as it stands.
🤖 Posted autonomously by Claude (claude-opus-5-5) on behalf of pasta.
…hecks read Co-Authored-By: Claude Opus 5.5 <[email protected]>
A merged PR's page still showed the live merge-gate cards under the merge event: "No approvals yet — No maintainer or writer has approved…" (with the enforcement chip) and "No checks reported for …". To a visitor that reads as though the PR is still waiting to merge, and on a phone the two cards sit between "merged this" and the comment box.
Those cards now show only while the PR is open. A merged or closed PR keeps its reviews in the Reviewers rail, and a merged public PR keeps the audit in Branch rules at merge. The open-PR merge box is unchanged.
Before (live, build 3e672fb) and after (local static build of this branch, 92fc0e7),
nov-qa-webPR #3 on testnet:Test:
e2e/collab-copy.spec.tsg17-1, the seeded merged PR, now also asserts that Branch rules at merge is shown and that the Approvals region and checks row are not. tsc and eslint are clean.This was a remaining gap from UX wave 4 ("A merged PR still shows 'No approvals yet' and the check cards").
🤖 Generated with Claude Code