Skip to content

Move sort control out of Issues/PR dropdowns into a filter popover #3337

@gregpriday

Description

@gregpriday

Summary

The recently added "Sort by" section in the Issues and Pull Requests dropdowns takes up persistent vertical space in the dropdown header. Sort and filter controls should live behind a filter icon button — matching the compact, consistent pattern used by the worktree sidebar.

Problem Statement

PR #3330 added a "Sort by" radio group that is always visible inside the dropdown header for both the Issues and PR panels. This creates two problems:

  1. Wasted space — the sort section is permanently visible even when the user has no interest in changing it, shrinking the list area.
  2. Inconsistent pattern — the worktree sidebar uses a search input + filter icon button that opens a popover for all sort/filter options. The GitHub dropdowns should follow the same pattern rather than inlining controls.

The worktree filter button (WorktreeFilterPopover) is a well-established pattern in the app: a compact icon that shows a badge when filters are active and opens a popover with sort and filter options. The GitHub resource panels should adopt the same affordance.

Evidence:

Desired Behavior

  • The inline "Sort by" radio section is removed from the GitHubResourceList dropdown header.
  • A small filter icon button appears next to the search input (mirroring the worktree sidebar layout).
  • Clicking the filter icon opens a popover containing the sort order options (and any other per-list filters that may be added in future).
  • When a non-default sort order is active, the filter icon shows an accent badge — consistent with how WorktreeFilterPopover signals active filters.
  • The dropdown header is more compact as a result: just search + filter icon, with state tabs (Open/Merged/Closed) below.
  • Sort order state persists exactly as it does today (via githubFilterStore).

Acceptance Criteria

  • The "Sort by" radio section is no longer visible inline in the Issues or PR dropdown headers
  • A filter icon button appears next to the search input in both dropdowns
  • The filter popover contains sort order options (Newest / Recently updated) for the respective resource type
  • The filter icon displays a visual indicator (badge or accent color) when a non-default sort order is active
  • Sort order changes take effect immediately and re-fetch the list, same as today
  • The dropdown header is visually more compact without the sort section

Edge Cases & Risks

  • The state filter tabs (Open / Merged / Closed) should remain where they are — only the sort section moves.
  • The filter popover should be dismissed by clicking outside or pressing Escape without losing the current sort selection.
  • Non-default sort order badge should reset correctly when the user switches back to the default.

Metadata

Metadata

Assignees

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