Skip to content

feat(pulls): say why the pull request page is empty - #249

Merged
imshashank merged 10 commits into
mainfrom
feat/pulls-empty-state
Aug 8, 2026
Merged

imshashank merged 10 commits into
mainfrom
feat/pulls-empty-state

Conversation

@imshashank

@imshashank imshashank commented Aug 8, 2026 •

Copy link
Copy Markdown
Contributor

The report

"Why does the pull request page look like nothing? We have merged so many PRs."

What is actually happening

Nothing is broken. /pulls reads git_link rows joined to issues, and applyGithubEvent creates a git_link only when the pull request's branch or title names an Orbit issue:

extractIssueIdentifiers(`${event.pullRequest.headRef} ${event.pullRequest.title}`)
// /\b([A-Z][A-Z0-9]{1,5}-\d+)\b/g

Checked against the branches we actually merged:

Branch or title Matches
feat/team-settings no
fix/peek-holds-open no
chore/clickable-affordances no
feat(issues): let the properties panel take you to what it names no
shashank/eng-42-fan-out-delta-packets ENG-42

None of our own pull requests ever named an issue, so none could link, so the page is empty and correct. The problem is that the page never said so.

What changed

The empty state now answers the two cases apart, driven by whether the workspace has an enabled github_repository_sync row.

No repository connected: "No repository is connected yet", with a Connect GitHub button to /settings/integrations.

Connected, nothing linked: "No pull requests linked to your issues", explaining that a pull request links when its branch or title names an issue like ENG-42, and pointing at Copy branch name, which produces exactly that.

Tests

2 new covering both states, and the existing two updated for the new prop. bun run verify green.

Worth knowing

This is presentation only. If you want our own pull requests to appear, the branch has to name the issue, which is what Copy branch name on an issue is for. PR #184 widens matching to issues named in the pull request body, which would also help.

🤖 Generated with Claude Code

Greptile Summary

The PR explains why the pull-request page is empty by distinguishing GitHub installation, suspension, repository-selection, and issue-linking states.

  • Derives GitHub reachability from organization-scoped installation and enabled repository-sync records.
  • Correlates tracked repositories with active installations and prioritizes suspended states.
  • Tailors recovery actions to the user’s integration-management permission.
  • Adds database-backed classification tests and component tests for the empty states.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/web/src/features/pulls/data.ts Adds organization-scoped reachability classification, correctly prioritizing suspension and correlating enabled repositories with active installations.
apps/web/src/features/pulls/pulls-view.tsx Adds distinct empty states and gates integration-management actions using the permission supplied by the page.
apps/web/src/app/(app)/pulls/page.tsx Loads pull requests and GitHub reachability concurrently and supplies the canonical integration-management permission.
apps/web/tests/features/pulls/github-reach.test.ts Covers absent, active, suspended, disabled, legacy, and mixed-installation repository states.
apps/web/tests/features/pulls/pulls-view.test.tsx Covers the user-facing empty-state variants and verifies that non-admin users receive no inaccessible action.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Load pulls page] --> B{Any GitHub installations?}
  B -- No --> C{Enabled repository sync exists?}
  C -- No --> D[Not installed]
  C -- Yes --> E[Connected legacy state]
  B -- Yes --> F{Any active installation?}
  F -- No --> G[Suspended]
  F -- Yes --> H{Enabled repository belongs to active installation?}
  H -- No --> I[No repositories]
  H -- Yes --> J[Connected]
  D --> K{Can manage integrations?}
  G --> K
  I --> K
  K -- Yes --> L[Show settings action]
  K -- No --> M[Explain that an admin must act]
  E --> N[Explain issue identifier linking]
  J --> N
Loading

Reviews (7): Last reviewed commit: "chore: merge main" | Re-trigger Greptile

The page said "No pull requests yet" whether GitHub was never connected
or connected and simply carrying nothing that named an issue. Those need
different answers and the page gave neither.

Read whether the workspace has an enabled repository and answer the two
cases apart: offer a way to connect, or say that a pull request links
when its branch or title names an issue.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@imshashank
imshashank requested a review from pulkitxm as a code owner August 8, 2026 18:10
@vercel

vercel Bot commented Aug 8, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
orbit Ready Ready Preview Aug 8, 2026 8:05pm

Request Review

@github-actions github-actions Bot added tests Test coverage and test infrastructure area: web The Next.js app and its UI labels Aug 8, 2026
@coderabbitai

coderabbitai Bot commented Aug 8, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The pulls page now evaluates GitHub installation and repository reachability while loading pull requests. It passes the result and integration-management permission to the pulls view, which renders state-specific empty states.

Changes

Pulls reachability flow

Layer / File(s) Summary
Reachability detection and page wiring
apps/web/src/features/pulls/data.ts, apps/web/src/app/(app)/pulls/page.tsx, apps/web/tests/features/pulls/github-reach.test.ts
Adds the GithubReach type and githubReach function. The page loads pull requests and reachability concurrently. Tests cover installation, suspension, repository tracking, and multiple installations.
Reachability prop propagation
apps/web/src/features/pulls/pulls-realtime.tsx
Passes reach and canManageIntegrations from PullsRealtime to PullsView.
Status-specific empty-state rendering
apps/web/src/features/pulls/pulls-view.tsx, apps/web/tests/features/pulls/pulls-view.test.tsx
Adds PullsEmptyState for uninstalled, suspended, repository-less, and connected states. Integration actions depend on canManageIntegrations. Tests cover the new states and existing linked-pull-request renders.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant PullsPage
  participant githubReach
  participant PullsRealtime
  participant PullsView
  PullsPage->>githubReach: request GitHub reachability
  githubReach-->>PullsPage: return GithubReach
  PullsPage->>PullsRealtime: pass reach and canManageIntegrations
  PullsRealtime->>PullsView: forward reach and permission
  PullsView-->>PullsPage: render status-specific empty state
Loading

Possibly related PRs

  • Noveum/orbit#36: Introduces the pulls UI and data flow extended by this change.

Suggested reviewers: pulkitxm

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: explaining why the pull request page is empty.
Description check ✅ Passed The description directly explains the empty states, GitHub integration status, issue-linking behavior, and test coverage.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/pulls-empty-state

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Comment thread apps/web/src/features/pulls/data.ts Resolved
Checking only for repository sync rows called a workspace that had
installed the app but tracked no repository "not connected", and pointed
it at a connect flow it had already been through. Read the integration
too and answer the three cases apart.

A member who cannot manage integrations is told a workspace admin has to
do it rather than being handed a button that leads somewhere they cannot
act.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Comment thread apps/web/src/features/pulls/data.ts Resolved
imshashank and others added 2 commits August 9, 2026 00:10
A suspended installation keeps its rows, so reading only the presence of
an installation told an admin to go and pick repositories while GitHub
was refusing to send anything at all.

Read the installation status and answer suspension on its own terms.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Comment thread apps/web/src/features/pulls/data.ts Resolved
Reading repositories first returned connected before suspension was ever
considered, so a workspace whose installation GitHub had suspended was
told its pull requests simply named no issue, while nothing was arriving
at all.

Read both, and answer suspension first. Cover the order with tests
against a real database, including the case that was wrong.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Comment thread apps/web/src/features/pulls/data.ts Resolved
Counting installations and repositories separately let an active
installation with nothing tracked borrow a repository belonging to a
suspended one, and report connected while nothing was arriving.

Match a tracked repository to an active installation by integration
before calling the workspace connected.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/web/tests/features/pulls/github-reach.test.ts`:
- Around line 51-53: Add a test fixture near the existing githubReach cases that
creates an integration and an enabled githubRepositorySync for the workspace
without creating a githubInstallation, then assert githubReach returns
“connected”; keep the existing never-connected test unchanged and use the
repository’s established fixture helpers.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 368abcbc-700f-4115-95b5-7829e60c61b5

📥 Commits

Reviewing files that changed from the base of the PR and between 891010b and a730a1a.

📒 Files selected for processing (6)
  • apps/web/src/app/(app)/pulls/page.tsx
  • apps/web/src/features/pulls/data.ts
  • apps/web/src/features/pulls/pulls-realtime.tsx
  • apps/web/src/features/pulls/pulls-view.tsx
  • apps/web/tests/features/pulls/github-reach.test.ts
  • apps/web/tests/features/pulls/pulls-view.test.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/web/tests/features/pulls/pulls-view.test.tsx

@imshashank
imshashank merged commit b420447 into main Aug 8, 2026
13 checks passed
@imshashank
imshashank deleted the feat/pulls-empty-state branch August 8, 2026 20:10

This branch was successfully deployed

1 active deployment
Preview — a289f0e8 Deployed Aug 8, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: web The Next.js app and its UI tests Test coverage and test infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant