Skip to content

Fix "Test against stream" dropdown closing on scroll - #25849

Merged
linuspahl merged 9 commits into
masterfrom
fix/issue-18694
Jun 3, 2026
Merged

Fix "Test against stream" dropdown closing on scroll#25849
linuspahl merged 9 commits into
masterfrom
fix/issue-18694

Conversation

@kmerz

@kmerz kmerz commented Apr 28, 2026

Copy link
Copy Markdown
Member

Description

Replace the DropdownButton/MenuItem-based "Test against stream" UI with SelectPopover, an existing reusable component backed by OverlayTrigger with rootClose.

Motivation and Context

Mantine Menu (which backs DropdownButton) closes on scroll events originating outside the menu. When a user has many streams and the list is taller than the viewport, scrolling to find a stream immediately dismisses
the dropdown, making it unusable.

SelectPopover uses rootClose (closes on click-outside only, not on scroll) and includes a built-in text filter input, making it a better fit for this use case.

How Has This Been Tested?

  • Existing unit tests updated and passing (MessageActions.test.tsx)
  • Manually verified: dropdown stays open while scrolling the stream list, filter input narrows results, clicking a stream navigates correctly, default streams are rendered with reduced opacity and clicking them is a no-op

Screenshots (if appropriate):

Bildschirmfoto 2026-04-28 um 16 26 01

Fixes #18694

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have requested a documentation update.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

@linuspahl

Copy link
Copy Markdown
Contributor

I noticed the "close on scroll" issue can also be fixed by adding hideDetached={false} to the Menu component.

@linuspahl

Copy link
Copy Markdown
Contributor

It improves the behavior, but the new popover can still close on scroll in some cases, which might be annoying.

I suggest we add hideDetached={false} to our general popover component (and ideally also our general Menu component).

Another thought, there is this issue about the issue of loading all streams #21543. I am not sure how difficult it is, but this might be a good opportunity to implement the paginated streams endpoint for this use case.

kmerz and others added 4 commits June 1, 2026 11:53
Replace the `DropdownButton`/`MenuItem` implementation with `SelectPopover`,
which uses `OverlayTrigger` with `rootClose` (closes on click-outside only,
not on scroll). This fixes the UX issue where scrolling a long stream list
would immediately close the dropdown.

Also adds a built-in text filter input for quickly finding streams.
Replace the prop-based stream list (fetched all at once) with a
paginated fetch using the existing useStreams hook against
/streams/paginated. The SelectPopover is replaced with an
OverlayTrigger-based popover that includes a debounced search input,
a paginated ListGroup of streams, and PaginatedList navigation
controls (page size 10).

Removes the allStreams prop from MessageActions, MessageDetail,
MessageTableEntry, and ShowMessagePage since streams are now fetched
directly inside TestAgainstStreamButton.
@kmerz
kmerz force-pushed the fix/issue-18694 branch from 26188ee to 1968651 Compare June 1, 2026 09:54
@linuspahl
linuspahl merged commit 3e9c27f into master Jun 3, 2026
24 checks passed
@linuspahl
linuspahl deleted the fix/issue-18694 branch June 3, 2026 07:51
dennisoelkers pushed a commit that referenced this pull request Jun 4, 2026
* Fix "Test against stream" dropdown closing on scroll

Replace the `DropdownButton`/`MenuItem` implementation with `SelectPopover`,
which uses `OverlayTrigger` with `rootClose` (closes on click-outside only,
not on scroll). This fixes the UX issue where scrolling a long stream list
would immediately close the dropdown.

Also adds a built-in text filter input for quickly finding streams.

* Add pull request reference to issue 18694

* Use paginated streams endpoint in 'Test against stream' popover

Replace the prop-based stream list (fetched all at once) with a
paginated fetch using the existing useStreams hook against
/streams/paginated. The SelectPopover is replaced with an
OverlayTrigger-based popover that includes a debounced search input,
a paginated ListGroup of streams, and PaginatedList navigation
controls (page size 10).

Removes the allStreams prop from MessageActions, MessageDetail,
MessageTableEntry, and ShowMessagePage since streams are now fetched
directly inside TestAgainstStreamButton.

* Remove useCallback wrapper — React Compiler handles memoization

* Fix duplicate id on stream filter input; use findBy in tests

* Fix TS error: move title to span inside disabled ListGroupItem

* Display stream names as actual links.

* Fixing linter hints

---------

Co-authored-by: Linus Pahl <linus.pahl@graylog.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Test against stream" drop down isn't sorted

2 participants