Repository navigation
fix(web): a commit with no checks says so in one line - #671
Conversation
Every commit page opened with a large dashed "No checks reported" card explaining how CI records runs, above the diff; on a phone it filled the screen. A commit with no check runs now gets one quiet line, and the full panel stays for commits that have runs. 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 50 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
The new branch (forge-web/components/repo/commit-content.tsx:188) fires only when ChecksTab would have shown its own empty state, so it hides nothing.
- Members-only runs: the read already merges runs from this commit's blinds into
runs(commit-content.tsx:179-181). If any exist,runs.length > 0and the full panel renders. ChecksTab'suseMembersRunsonly renames runs already in that list. With zero runs it has nothing to resolve. - Untrusted / uncounted runs:
readCheckRunskeeps every newest run and only setstrustedon it (lib/repo/checks.ts:282). It filters nothing out, so a commit with only untrusted runs still gets the panel and its "not counted" notes. - Expected checks: the commit page never passes
expected, so ChecksTab's empty-state test (pull-tabs.tsx:316,runs.length === 0 && expected.length === 0) reduces to the same condition. - Loading / error: while loading,
checks.datais null andundefined === 0is false, so it falls through toLoadingBlock. On a deps change (for example, blinds appear after a members session unlocks),useAsyncresetsdatato null synchronously, so a stale empty result never sits under the new key. Errors still reach ErrorState with retry, because the branch requireserror === null. - Test (
commit-unreachable.test.tsx:73-79): sound. It fails on master, where the mocked ChecksTab renders "0 run(s)". The existing first case still covers runs > 0 rendering the panel. Optional nit: there is no case asserting that loading (data null) or an error keeps the panel. A one-linereadCheckRuns.mockRejectedValueOncecase would lock that in. - Accessibility: the section keeps
aria-label="Checks"and thecommit-checkstestid, the icon isaria-hidden, and the sentence carries the meaning. The empty case has noh2now, which is fine for one line. - Minimal: yes, one early return plus one import.
e2e/ci-checks.spec.tsonly covers a commit with runs, so it still uses the panel path. No other e2e looks for the commit page's empty-state card.
Checked locally on 213996b: vitest run components/repo/commit-unreachable.test.tsx passes (3 tests) and tsc --noEmit is clean.
🤖 Posted autonomously by Claude (claude-opus-5-5) on behalf of pasta.
Every commit page opened with a large dashed "No checks reported for …" card, with an icon and a paragraph on how CI records runs (
dg ci runner new, the GitHub Action,dg ci report). It sat above the diff. Most commits have no checks, so most visitors saw it, and on a phone it took most of the first screen.A commit with no check runs now gets one quiet line: "No checks reported for a61a8f0". A commit with runs (or a read error) still gets the full Checks panel, unchanged. The PR page's Checks tab keeps its explanatory empty state.
Before (live, build 3e672fb) and after (local static build of this branch, 213996b),
prime-number-findercommit a61a8f0 on testnet:Test:
components/repo/commit-unreachable.test.tsxadds a case where the read returns no runs and asserts the one line, with no panel. tsc and eslint are clean.e2e/ci-checks.spec.ts(a commit with runs) still reads thecommit-checkssection.Found in UX wave 5's browse probe.
🤖 Generated with Claude Code