Skip to content

Carry search filters into widget replay search (7.1)#26168

Merged
dennisoelkers merged 1 commit into
7.1from
backport-7.1/feature/replay-search-with-filters
May 29, 2026
Merged

Carry search filters into widget replay search (7.1)#26168
dennisoelkers merged 1 commit into
7.1from
backport-7.1/feature/replay-search-with-filters

Conversation

@graylog-internal-actions-access

Copy link
Copy Markdown

Note: This is a backport of #26151 to 7.1.

Note: This needs a backport to previous versions.

Description

When clicking "Replay search" on a dashboard widget that has search filters configured, the resulting search now includes those filters. Previously they were dropped, so the replayed search returned a broader result set than the widget.

Filters are persisted to local storage under the replay session-id (alongside parameters) and picked up by NewSearchPage when it builds the saved search view.

Motivation and Context

Fixes Graylog2/graylog-plugin-enterprise#8869. The replay button promises to land the user on the same search the widget ran, but it was only forwarding query/timerange/streams/parameters — search filters were silently lost.

How Has This Been Tested?

  • Extended ReplaySearchButton.test.tsx:
    • link gets a session-id when filters are present
    • no session-id when neither parameters nor filters are present (or filters list is empty)
    • on click, filters are written to local storage under the session id and NewSearchPage can read them back
  • Verified manually in a dashboard widget with search filters configured: replaying lands on a search containing the same filters.

Screenshots (if appropriate):

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.

* Carry search filters into widget replay search

Replaying a dashboard widget previously dropped any search filters
configured on it — only the query string, time range, streams, and
parameters travelled along. ReplaySearchButton now also accepts the
widget's `filters` (a `FiltersType` list of `SearchFilter`), serialises
them into the local-storage payload that the new search page pulls out
via the `session-id` query param, and ensures the session-id is added
to the URL whenever filters or parameters are present.

NewSearchPage's session reader is widened to extract `filters` from the
stored payload and forwards them via `useCreateSavedSearch` →
`ViewGenerator` → `QueryGenerator` (which already accepts a 6th
`searchFilters` positional arg, just lacking a caller).

Also realigns `QueryGenerator`'s `SearchFilter` import to `views/types`
to match what `Query.filters` actually stores — the previous
`components/event-definitions/event-definitions-types` flavour required
fields (`id`, `title`, `disabled`, `negation`) that widget filters
don't necessarily carry.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* Add changelog snippet for #26151

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
(cherry picked from commit a4d1554)
@dennisoelkers dennisoelkers marked this pull request as ready for review May 29, 2026 12:57
@dennisoelkers dennisoelkers merged commit c49113c into 7.1 May 29, 2026
25 checks passed
@dennisoelkers dennisoelkers deleted the backport-7.1/feature/replay-search-with-filters branch May 29, 2026 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants