Skip to content

feat: Render adhoc dashboard filter inputs - #3343

Draft
pulpdrew wants to merge 1 commit into
drew/adhoc-filters-creation-uifrom
drew/adhoc-filters-inputs
Draft

pulpdrew wants to merge 1 commit into
drew/adhoc-filters-creation-uifrom
drew/adhoc-filters-inputs

Conversation

@pulpdrew

@pulpdrew pulpdrew commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Summary

TODO: re-use existing metadata hooks in useAdhocFilterValues

Screenshots or video

Before After

How to test on Vercel preview

Preview routes:

Steps:

References

  • Linear Issue:
  • Related PRs:

@pulpdrew
pulpdrew added this pull request to stack #3342 October 9, 2026 15:49
@changeset-bot

changeset-bot Bot commented Oct 9, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ed42b33

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

This PR includes changesets to release 4 packages
Name Type
@hyperdx/common-utils Patch
@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

@vercel

vercel Bot commented Oct 9, 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 Oct 9, 2026 3:54pm UTC
hyperdx-storybook Ready Ready Preview Oct 9, 2026 3:54pm UTC

Request Review

@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

E2E Test Results

✅ All tests passed • 414 passed • 1 skipped • 1225s

Status Count
✅ Passed 414
❌ Failed 0
⚠️ Flaky 2
⏭️ Skipped 1

Tests ran across 4 shards in parallel.

View full report →

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Duplicate code analysis

No new duplicate code introduced by this PR.


jscpd compared this branch against origin/main
across app, api and common-utils. Only new clones are listed; the codebase
currently holds 125 in total (1.74%).
Run yarn dupes locally to reproduce, or yarn dupes:all for the full picture.

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Knip - Unused Code Analysis

🔴 1 issue found

Unused exports (1)

  • packages/app/src/components/AdhocDashboardFilter/useAdhocFilterOptions.ts:useAdhocFilterSources

Knip finds unused files, dependencies, and exports in your codebase.
Run yarn knip locally to see full details.

@greptile-apps

greptile-apps Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Medium impact] Adds ad hoc filter UI and state management to dashboards.

The file-size requirement must be satisfied before merging; stale suggestions after source edits are a smaller, non-blocking issue.

Fix All in Claude CodeFindings

  1. P2 Suggestions show the old table ▶
  2. P2 Hook exceeds the file limit ▶

Summary

Adds dashboard controls for choosing, editing, and clearing ad hoc conditions, with SQL and PromQL suggestions and URL persistence.

  • Dashboard users can build ad hoc filter conditions in the filter bar.
  • Ad hoc filter conditions stay in the dashboard URL.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Sources[Configured sources] --> Suggestions[Key and value suggestions]
  Suggestions --> Editor[Condition editor]
  Editor --> Hook[useDashboardFilters]
  Hook --> URL[filters URL parameter]
  URL --> Pills[Condition pills]
  Pills --> Editor
Loading

Reviews (1) · Last reviewed commit: "feat: Render adhoc dashboard filter inpu..." · Reviewed by Greptile

Comment on lines +162 to +168
queryKey: [
'adhoc-filter-keys',
source.id,
start,
end,
isFieldMetadataDisabled,
],

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.

P2 Suggestions show the old table

Both suggestion query keys use source.id without the connection or table settings. Editing a source keeps its ID and only refreshes sources, so reopening the editor with the same time range can show columns and values from the old table for five minutes. Users may pick columns that no longer exist. Include the source settings in both query keys, or clear both caches when the source changes.

Fix in Claude Code Fix in Conductor Fix in Cursor Fix in Codex

Comment on lines +153 to +169
const setAdhocConditions = useCallback(
(filterId: string, conditions: AdhocFilterCondition[]) => {
setFilterValueEntries(prev => {
const target = filters.find(f => f.id === filterId);
const name = target && getFilterVariableName(target);
if (!name) return prev;

const parsed = parseDashboardFilterValues(prev ?? []);
parsed.byVariable.set(name, {
type: 'adhoc',
conditions: uniqConditions(conditions),
});
return rebuildEntries(filters, parsed);
});
},
[setFilterValueEntries, filters],
);

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.

P2 Hook exceeds the file limit

This change grows useDashboardFilters.tsx from 294 to 350 lines, crossing the guide's required 300-line limit for non-test files. This requirement must be satisfied before merging. Move rebuildEntries and its supporting helpers into a sibling module to keep the hook below the limit.

Context Used: AGENTS.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Claude Code Fix in Conductor Fix in Cursor Fix in Codex

This branch was successfully deployed

2 active deployments
Preview – hyperdx-oss — ed42b33b Deployed Oct 9, 2026 by vercel[bot]
Preview – hyperdx-storybook — ed42b33b Deployed Oct 9, 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