Skip to content

fix(supergroups): Hoist stream issues to the first page of the drawer#113192

Merged
scttcper merged 1 commit intomasterfrom
scttcper/supergroup-drawer-sort
Apr 16, 2026
Merged

fix(supergroups): Hoist stream issues to the first page of the drawer#113192
scttcper merged 1 commit intomasterfrom
scttcper/supergroup-drawer-sort

Conversation

@scttcper
Copy link
Copy Markdown
Member

@scttcper scttcper commented Apr 16, 2026

Make sure issues that match the current stream query land on page 1 of the supergroup drawer, instead of being sorted only within whatever page they happened to fall on.

…e drawer

The supergroup drawer paginates `group_ids` in page-size chunks, then
filters each page against the current stream query. If the matched
issues sit past the first page in the underlying list, they never show
up when you open the drawer — which is the whole point of opening it.

Run the stream-query match over the full `group_ids` list up front, sort
matched issues first, then paginate. The per-page sort is gone since
the order is already right, and the page index gets clamped in case the
list shrinks.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 16, 2026
@scttcper scttcper changed the title fix(supergroups): Hoist stream-matched issues to the first page of the drawer fix(supergroups): Hoist stream issues to the first page of the drawer Apr 16, 2026
@scttcper scttcper marked this pull request as ready for review April 16, 2026 17:32
@scttcper scttcper requested a review from a team as a code owner April 16, 2026 17:32
group: pageGroupIds.map(String),
project: ALL_ACCESS_PROJECTS,
},
staleTime: 30_000,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bug: The query for matched issues is limited by per_page: PAGE_SIZE, so if more than 25 issues match, only the first 25 are hoisted to the top.
Severity: MEDIUM

Suggested Fix

Remove the per_page: PAGE_SIZE parameter from the API query that fetches the matchedIds. This will ensure that all matching issue IDs from the full groupIds list are retrieved, allowing the sorting logic to correctly hoist all matched issues to the beginning of the list before pagination is applied.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: static/app/views/issueList/supergroups/supergroupDrawer.tsx#L168

Potential issue: The logic to hoist issues matching a stream query is incomplete. The
API call to find these matched issues is limited by `per_page: PAGE_SIZE`, which is 25.
If more than 25 issues match the query across all `groupIds`, only the first 25 are
identified and hoisted to the top of the list. Any matched issues beyond this initial
set will not be sorted to the top and will remain scattered across subsequent pages.
This contradicts the intended behavior of sorting all matched issues first before
applying pagination.

Did we get this right? 👍 / 👎 to inform future reviews.

@scttcper scttcper enabled auto-merge (squash) April 16, 2026 17:52
@scttcper scttcper merged commit 9a2d659 into master Apr 16, 2026
76 of 78 checks passed
@scttcper scttcper deleted the scttcper/supergroup-drawer-sort branch April 16, 2026 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants