feat: Add CI status checks to PR detail view - #158
Merged
Conversation
Fetch statusCheckRollup via gh pr view and render a Checks section in the PR detail panel, with a colored icon/label per CheckRun or legacy StatusContext entry.
Rebase onto main's new workspace-header CiStatusIndicator (gh pr checks rollup) and consolidate the PR view page's checks section onto the same data source and styling instead of the earlier statusCheckRollup-based approach. - Extract rollup_pr_checks in src-tauri and add get_pr_checks_for_pr_impl (PR-number based, for browsing PRs not checked out locally) alongside the existing branch-based get_pr_checks_via_gh_impl. - Add a shared src/lib/ci-status.ts with the CI state styles/icons and bucket-to-state mapping used by both CiStatusIndicator and the PR page. - Split CiStatusIndicator into a presentational CiStatusButton (reused by the PR page) and the data-fetching wrapper for the workspace header. - PrDetail now shows the same CI pill next to the state chip plus a per-job Checks list styled identically to the header indicator.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR adds CI status visibility to the GitHub panel's PR detail view, allowing users to see check results for any PR without needing a local checkout. The implementation shares rollup logic and styling with the existing workspace header CI indicator to ensure consistent presentation across both surfaces.
Key Changes
get_pr_checks_for_pr_impl: Queriesgh pr checksfor a specific PR number in a repo (identified byowner/repo), complementing the existing branch-based lookuprollup_pr_checksfunction that both lookup methods use, ensuring identical pass/fail/pending groupingusePrChecksForPr: Polls CI status for a specific PR number with the same 10s stale time and 15s refetch interval as the branch-based hooksrc/lib/ci-status.tsas a single source of truth for colors, icons, and labels, shared between the workspace header'sCiStatusIndicatorand the new PR detail checks displayCiStatusButtoncomponent: Extracted the compact "passed/total" pill into a reusable presentational component that accepts aPrCiStatusdirectlyPrDetailPanelshowing individual check rows with icons, names, and status labels, styled identically to the header indicatorCheckEntryRowcomponent: Renders individual check entries with consistent styling and click-to-open-link behaviorImplementation Details
GhCheckstruct is now module-level (not nested in the function) to support both lookup methodsget_pr_checks_via_gh_implandget_pr_checks_for_pr_implfollow the same error handling pattern: returningNonefor "no checks reported" and "no PR found" cases, and propagating other errorsciStateForBucket) treats "skipping" as success and "cancel" as failure, matching the rollup logicciStatus.total > 0, avoiding empty sectionsget_pr_checks_for_pr_implfunction with mockedghbinaryhttps://claude.ai/code/session_01RRJSRB256AWXzbU4oLU5ks