Skip to content

Searching in the Pull Requests label filter drops the selected label's color and count #43653

Done

Description

@AymanKhan9

Bug

In the web /pull-requests Filters -> Labels submenu (apps/web/src/components/pullRequest/PullRequestListFilters.tsx), typing a search query that filters out a currently selected label causes that pinned selected label to lose its color dot (turning grey) and its pull request count.

Steps to reproduce

  1. Open /pull-requests and open Filters -> Labels.
  2. Select a colored label from the loaded list (for example bug with a color dot and count 5).
  3. Type a search query matching a different label (for example docs).

Observed behavior

PullRequestLabelChoices falls back to { name, color: null, count: 0 } for any selected label not in the post-search choices list, so bug remains shown at the top with a grey dot and no count, even though options still carries its color and count.

Expected behavior

Like PullRequestAuthorChoices (selectedPullRequestAuthor) directly above it, PullRequestLabelChoices should resolve pinned selected labels against loaded options and hosted.labels first so they retain their color dot and count while searching, falling back to { name, color: null, count: 0 } only when neither source knows the label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions