Skip to content

Stream filters enhancement#629

Open
arturminchukov wants to merge 5 commits intomainfrom
stream-filters-enhancement
Open

Stream filters enhancement#629
arturminchukov wants to merge 5 commits intomainfrom
stream-filters-enhancement

Conversation

@arturminchukov
Copy link
Copy Markdown
Member

@arturminchukov arturminchukov commented Apr 27, 2026

Describe Your Changes

Add stream filters as a sidebar. It makes it easy to see which stream names exist and provides a simpler way to interact with them.

Screen.Recording.2026-05-08.at.13.52.52.mov

Checklist

The following checks are mandatory:


Summary by cubic

Moves stream filters into a toolbar with a popover for browsing labels and values. Selected values show as removable chips under the query. Suggestions respect the current selection and ignore pipes; filters work in both code and builder modes.

  • New Features

    • Stream filters bar in Explore; button opens a popover with a label list and a searchable values panel (values show hit counts and percentages).
    • Selected values render as chips under the query; remove with one click.
    • One-click actions: copy filters as LogsQL and clear all.
    • Requests scope results with extra_stream_filters (labels reflect full selection; the value panel ignores its own label) and ignore pipes via ignore_pipes=1.
  • Refactors

    • Introduced StreamFiltersProvider and hooks (useStreamFilters, useFetchedValues, updated useFetchStreamFilters); replaced old inline filters with the bar + popover.
    • Added shared CopyButton and Chip; improved value escaping and moved stream filter utils.
    • Backend: added IgnorePipes to fields queries and wired through the language_provider.
    • Stream filter operator is now in only; clipped Monaco query field content to rounded borders.

Written for commit 3b4ce76. Summary will update on new commits.

@arturminchukov arturminchukov self-assigned this Apr 27, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

3 issues found across 22 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/components/shared/Chip/Chip.tsx">

<violation number="1" location="src/components/shared/Chip/Chip.tsx:64">
P2: Make the value span non-inline before using `max-width`/`text-overflow`; otherwise the ellipsis truncation won't work and long values can overflow the chip.</violation>
</file>

<file name="src/components/QueryEditor/StreamFilters/StreamLabelList.tsx">

<violation number="1" location="src/components/QueryEditor/StreamFilters/StreamLabelList.tsx:52">
P2: Initial stream-label loading has no failure handling, and the called loader can remain pending on fetch errors. This can leave the sidebar stuck without updating after a failed request.</violation>
</file>

<file name="src/components/shared/CopyButton/CopyButton.tsx">

<violation number="1" location="src/components/shared/CopyButton/CopyButton.tsx:64">
P2: Avoid calling `navigator.clipboard.writeText` directly here; it bypasses Grafana's clipboard fallback, so icon-only copy can fail in insecure contexts or browsers without the Clipboard API.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.

Comment thread src/components/shared/Chip/Chip.tsx
Comment thread src/components/QueryEditor/StreamFilters/StreamLabelList.tsx Outdated
Comment thread src/components/shared/CopyButton/CopyButton.tsx Outdated
Comment thread src/components/QueryEditor/StreamFilters/useFetchedValues.ts
Comment thread src/components/QueryEditor/StreamFilters/StreamValuesList.tsx
Comment thread src/components/QueryEditor/StreamFilters/StreamLabelList.tsx
@hagen1778
Copy link
Copy Markdown
Contributor

I love the initiative! But pretty much concerned with the amount of empty space it introduces below the query area. We should think of minimizing that unused space.

  Add overflow: hidden to the Monaco query field container so its inner
  viewport does not paint over the rounded corners of the outer border.
 The ignore_pipes=1 query arg is needed in order to ignore pipes in the query when returning the list of log stream field names and values.
@arturminchukov arturminchukov force-pushed the stream-filters-enhancement branch from 2dc8ab0 to df920a3 Compare May 8, 2026 09:32
  - Stream filters now live in a dedicated sidebar instead of an inline
    form above the query — labels stay visible while you edit the
    expression, with no extra scrolling
  - Sidebar fits Explore's vertical layout, so adding more filters no
    longer pushes the query field down
  - Header exposes one-click actions: clear-all and copy-as-LogsQL for
    the whole filter set
  - Selected values render as chips under the query — active streams are
    visible at a glance without expanding each filter row
@arturminchukov arturminchukov force-pushed the stream-filters-enhancement branch from df920a3 to 3b4ce76 Compare May 8, 2026 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request vl-datasource

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants