Skip to content

feat: Add CI status checks to PR detail view - #158

Merged
Ziinc merged 3 commits into
mainfrom
claude/ci-status-view-pr-page-o9lhpa
Aug 5, 2026
Merged

feat: Add CI status checks to PR detail view#158
Ziinc merged 3 commits into
mainfrom
claude/ci-status-view-pr-page-o9lhpa

Conversation

@Ziinc

@Ziinc Ziinc commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

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

  • New backend function get_pr_checks_for_pr_impl: Queries gh pr checks for a specific PR number in a repo (identified by owner/repo), complementing the existing branch-based lookup
  • Extracted shared rollup logic: Moved CI status aggregation into a new rollup_pr_checks function that both lookup methods use, ensuring identical pass/fail/pending grouping
  • New frontend hook usePrChecksForPr: Polls CI status for a specific PR number with the same 10s stale time and 15s refetch interval as the branch-based hook
  • Extracted CI styling module: Created src/lib/ci-status.ts as a single source of truth for colors, icons, and labels, shared between the workspace header's CiStatusIndicator and the new PR detail checks display
  • New CiStatusButton component: Extracted the compact "passed/total" pill into a reusable presentational component that accepts a PrCiStatus directly
  • PR detail checks section: Added a "Checks" section to PrDetailPanel showing individual check rows with icons, names, and status labels, styled identically to the header indicator
  • New CheckEntryRow component: Renders individual check entries with consistent styling and click-to-open-link behavior

Implementation Details

  • The GhCheck struct is now module-level (not nested in the function) to support both lookup methods
  • Both get_pr_checks_via_gh_impl and get_pr_checks_for_pr_impl follow the same error handling pattern: returning None for "no checks reported" and "no PR found" cases, and propagating other errors
  • CI state mapping (ciStateForBucket) treats "skipping" as success and "cancel" as failure, matching the rollup logic
  • The PR detail view only renders the checks section when ciStatus.total > 0, avoiding empty sections
  • Comprehensive test coverage added for the new get_pr_checks_for_pr_impl function with mocked gh binary
  • Screenshot tests added to verify the checks section renders correctly with mixed statuses and is absent when no checks exist
    https://claude.ai/code/session_01RRJSRB256AWXzbU4oLU5ks

claude added 2 commits August 4, 2026 11:10
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.
@Ziinc Ziinc changed the title Add CI status checks to PR detail view feat: Add CI status checks to PR detail view Aug 5, 2026
@Ziinc
Ziinc merged commit 869785d into main Aug 5, 2026
11 checks passed
@Ziinc
Ziinc deleted the claude/ci-status-view-pr-page-o9lhpa branch August 5, 2026 03:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants