Skip to content

Add option to exclude draft pull requests from repository #791

@hudsonbay

Description

@hudsonbay

Description

Currently, the repository widget fetches all open pull requests from GitHub, including draft PRs. Draft pull requests are often work-in-progress and may not be ready for review, which can create noise in the widget display.

What problem would this feature solve?
When monitoring a repository, users typically want to see pull requests that are actually ready for review rather than all open PRs including drafts. Draft PRs represent work-in-progress that may not be actionable by reviewers, so including them can:

  • Create visual clutter in the widget
  • Make it harder to identify PRs that actually need attention
  • Provide misleading information about the repository's review workload

Proposed solution
Add a new configuration option exclude-draft-prs (or similar) to the repository widget that allows users to filter out draft pull requests from the display.

Configuration example

- type: repository
  repository: owner/repo
  token: ${GITHUB_TOKEN}
  pull-requests-limit: 5
  exclude-draft-prs: true  # New option - defaults to false for backward compatibility

Implementation details
The GitHub Search API already supports excluding draft PRs using the -is:draft qualifier. The current query:

is:pr+is:open+repo:%s

Would become:

is:pr+is:open+repo:%s-is:draft

when the option is enabled.

Are there any potential downsides?

  • Minimal - this is an optional feature that defaults to current behavior
  • Users who want to see draft PRs can simply leave the option unset or set it to `false

Implementation location
The change would primarily affect the fetchRepositoryDetailsFromGithub function in internal/glance/widget-repository.go, specifically the PR search query construction around line 105.

This feature would enhance the widget's usability by allowing users to focus on actionable pull requests while maintaining backward compatibility with existing configurations.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions