Skip to content

feat: SQL query filter follow-ups: table autocomplete, type rename, type-switch fix, E2E tests - #3719

Draft
karl-power wants to merge 4 commits into
sql-dashboard-variables-sourcefrom
claude/sql-filter-autocomplete
Draft

karl-power wants to merge 4 commits into
sql-dashboard-variables-sourcefrom
claude/sql-filter-autocomplete

Conversation

@karl-power

Copy link
Copy Markdown
Contributor

Summary

Follow-ups from review on #3678: autocomplete table and column names in the SQL query filter editor, rename "Queried values", fix a validation bug when switching filter types, and add E2E coverage for SQL query filters. One commit per change:

  • feat: autocomplete table and column names in the SQL query filter editor. The editor now suggests the tables and columns of the selected connection's sources, like the Raw SQL tile. A connection variable suggests the tables of the connection it currently selects. The tile's table-list logic moves to a shared getTableConnectionsForConnection() in utils.ts, which both editors use.
  • feat: rename the Queried values filter type to SQL expression values. This tells it apart from "SQL query values" and "PromQL label values". The two SQL types are now next to each other in the type dropdown.
  • fix: clear the previous filter type's rules when switching types. react-hook-form keeps a field's validation rules after its input unmounts, and merges the next input's rules over them. Switching from "PromQL label values" to "SQL query values" failed with "Select a PromQL source", and a new SQL query filter couldn't be saved without a source because "SQL expression values" (the default type) requires one. Changing the type now clears the old rules before the next editor registers its own.
  • test: add E2E tests for SQL query dashboard filters. Five tests: values listed in query order and selected by variable name, values narrowed by another filter's variable using $__sourceTable and $__filter, a connection variable, a data source variable, and a query error shown in the preview and on the dropdown.

Screenshots or video

Not captured. The visible changes are autocomplete suggestions in the SQL query filter editor and the renamed, reordered type dropdown.

How to reproduce

Starting point: yarn dev, any dashboard, with a Logs source on the local connection.

On the base branch (#3691):

  1. Click Edit filters and variables, then Add new filter, and choose PromQL label values.
  2. Switch the type to SQL query values, fill in a name, connection and query, and click Save filter. It fails with "Select a PromQL source".
  3. In the SQL editor, start typing a table name. Only keywords, functions and macros are suggested.

On this branch:

  1. Repeat step 2. The filter saves.
  2. In the SQL editor, type otel. The tables of the connection's sources are suggested, and after FROM, their columns.
  3. Open the Type dropdown. It lists SQL expression values then SQL query values, and "Queried values" is gone.

How to test on Vercel preview

Preview routes: /dashboards

Steps:

  1. Create a new dashboard and click Edit filters and variables, then Add new filter.
  2. Open the Type dropdown and verify the first two options are "SQL expression values" and "SQL query values".
  3. Choose SQL query values, pick the demo connection, and type SELECT * FROM otel in the SQL editor. Verify table names appear in the suggestions.

References

@vercel

vercel Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
hyperdx-oss Ready Ready Preview Nov 18, 2026 6:01pm UTC
hyperdx-storybook Ready Ready Preview Nov 18, 2026 6:01pm UTC

Request Review

@changeset-bot

changeset-bot Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: faebc7c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@hyperdx/app Patch
@hyperdx/api Patch
@hyperdx/otel-collector Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

This branch was successfully deployed

2 active deployments
Preview – hyperdx-oss — faebc7cd Deployed Nov 18, 2026 by vercel[bot]
Preview – hyperdx-storybook — faebc7cd Deployed Nov 18, 2026 by vercel[bot]
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.

1 participant