Repository navigation
fix(web): the PR checks count says how many are running instead of done/total #41714
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
juliusmarminge
merged 3 commits into
pingdotgg:main
from
SunkenInTime:t3/pr-checks-running-label
Nov 24, 2026
+73
−237
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
6cf77d5
fix(web): the PR checks count says how many are running instead of do…
SunkenInTime 87d12df
Merge remote-tracking branch 'origin/main' into t3/pr-checks-running-…
juliusmarminge 5557707
test(web): cover the checks count label's priority order
juliusmarminge File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
apps/web/src/components/pullRequest/pullRequestPresentation.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| import type { PullRequestCheck } from "@t3tools/contracts"; | ||
| import { describe, expect, it } from "vite-plus/test"; | ||
|
|
||
| import { pullRequestChecksCountLabel } from "./pullRequestPresentation"; | ||
|
|
||
| const checks = (...statuses: ReadonlyArray<PullRequestCheck["status"]>): PullRequestCheck[] => | ||
| statuses.map((status) => ({ name: "ci", status, description: null, url: null })); | ||
|
|
||
| describe("pullRequestChecksCountLabel", () => { | ||
| it("names the most urgent group: failed, then awaiting action, then running", () => { | ||
| expect( | ||
| pullRequestChecksCountLabel( | ||
| checks("failure", "cancelled", "action-required", "pending", "success"), | ||
| ), | ||
| ).toBe("2 failed"); | ||
| expect(pullRequestChecksCountLabel(checks("action-required", "pending", "pending"))).toBe( | ||
| "1 awaiting action", | ||
| ); | ||
| expect(pullRequestChecksCountLabel(checks("pending", "pending", "success", "skipped"))).toBe( | ||
| "2 running", | ||
| ); | ||
| }); | ||
|
|
||
| it("shows nothing once no check is failed, waiting or running", () => { | ||
| expect(pullRequestChecksCountLabel(checks("success", "skipped", "neutral"))).toBeNull(); | ||
| expect(pullRequestChecksCountLabel([])).toBeNull(); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exclude placeholder entries from the awaiting-action count.
A
placeholder: trueentry means the host could not determine that state. It does not represent one check.pullRequestChecksCountLabelcounts it as anaction-requiredcheck, so a failed approval read can show "1 awaiting action" with an unknown real count. Exclude placeholder entries from the count. Decide separately what the label shows when a list contains only placeholders.nullwould show the icon-only all-passed state, which is also incorrect.