Sort status checks to group failures first
Status checks in the PR overview are displayed in arbitrary order, requiring users to scroll through all checks to find failures. GitHub's web UI groups failing checks at the top for quick identification.
Changes
-
Sort status checks by state in
StatusCheckDetailscomponent- Order: Failure → Pending → Neutral → Success → Unknown
- Added
CHECK_STATE_ORDERconstant for consistent sort priority
const CHECK_STATE_ORDER: Record<CheckState, number> = {
[CheckState.Failure]: 0,
[CheckState.Pending]: 1,
[CheckState.Neutral]: 2,
[CheckState.Success]: 3,
[CheckState.Unknown]: 4,
};
const StatusCheckDetails = ({ statuses }: { statuses: PullRequestCheckStatus[] }) => {
const sortedStatuses = [...statuses].sort((a, b) => {
return CHECK_STATE_ORDER[a.state] - CHECK_STATE_ORDER[b.state];
});
// ... render sortedStatuses
};
This matches the GitHub web experience where failing checks are grouped together at the top.
Original prompt
This section details on the original issue you should resolve
<issue_title>Add failing checks together like in the website</issue_title> <issue_description>Testing microsoft/vscode-pull-request-github#7424
I love the PR experience in the editor! One of the things I missed from the website was that it groups the failing checks together:
![]()
It would be nice if the in editor experience also grouped them, so I didn't have to scroll through the checks to find the missing ones:
![]()
</issue_description>
Comments on the Issue (you are @copilot in this section)
- Fixes microsoft/vscode-pull-request-github#7449
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.