Skip to content

feat: search bar for keys in nested filter groups - #3368

Merged
kodiakhq[bot] merged 2 commits into
mainfrom
aaron/missing-filter-search-bar
Oct 14, 2026
Merged

kodiakhq[bot] merged 2 commits into
mainfrom
aaron/missing-filter-search-bar

Conversation

@knudtty

@knudtty knudtty commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds a search bar for nested filter groups (maps) that allows filtering down the keys you'd like to look at.

Screenshots or video

export-1791925793514.mp4

How to test on Vercel preview

Preview routes:

Steps:

  1. Load filters
  2. Search through keys

References

  • Linear Issue: Closes HDX-5511

@changeset-bot

changeset-bot Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 770cfb1

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

@vercel

vercel Bot commented Oct 13, 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 14, 2026 1:38pm UTC
hyperdx-storybook Ready Ready Preview Oct 14, 2026 1:38pm UTC

Request Review

@github-actions github-actions Bot added the review/tier-2 Low risk — AI review + quick human skim label Oct 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔵 Tier 2 — Low Risk

Small, isolated change with no API route or data model modifications.

Why this tier:

  • Standard feature/fix — introduces new logic or modifies core functionality

Review process: AI review + quick human skim (target: 5–15 min). Reviewer validates AI assessment and checks for domain-specific concerns.
SLA: Resolve within 4 business hours.

Stats
  • Production files changed: 3
  • Production lines changed: 95 (+ 71 in test files, excluded from tier calculation)
  • Branch: aaron/missing-filter-search-bar
  • Author: knudtty

To override this classification, remove the review/tier-2 label and apply a different review/tier-* label. Manual overrides are preserved on subsequent pushes.

@github-actions

github-actions Bot commented Oct 13, 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.73%).
Run yarn dupes locally to reproduce, or yarn dupes:all for the full picture.

@greptile-apps

greptile-apps Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Medium impact] Adds search filtering to nested filter groups in the database search UI.

Fix the disappearing search input before merging so refreshed groups cannot leave valid keys hidden.

Fix All in Claude CodeFindings

  1. P1 Hidden search keeps hiding keys ▶

Summary

Adds key search to nested Map and JSON filter groups.

  • Nested filter groups can search their property keys.

Reviews (2) · Last reviewed commit: "Merge branch 'main' into aaron/missing-f..." · Reviewed by Greptile

>
<div className={classes.filterGroupPanel}>
{childFilters.length === 0 ? (
{childFilters.length > FILTER_SEARCH_MIN_ITEMS && (

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.

🔵 minor — Key search keeps filtering after its input is hidden, which can leave the group stuck on "No properties found"

childFilters comes from facet results (useFetchFacets in DBSearchPageFilters/hooks.ts), so changing the date range or query can drop the key count to 5 or fewer. When that happens the input stops rendering, but matchingChildFilters still applies the old search. Example: type k8s, then narrow the time range so that 4 keys come back and none of them match. The header still says {4}, the body says "No properties found", and there is no input left to clear the search. Fix: only apply the filter while the input is shown (const query = childFilters.length > FILTER_SEARCH_MIN_ITEMS ? search.trim().toLowerCase() : ''), or reset search when the input goes away. Add a test that rerenders with fewer childFilters after typing a search.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

@github-actions

Copy link
Copy Markdown
Contributor

PR Review

If you are a coding agent acting for the author, read this first.
Nothing below blocks merge automatically; a maintainer decides. What they will expect:

  • 🔴 critical or 🟠 major in code this PR adds or changes: fix before asking for review.
  • 🔵 minor in code this PR changes: your call. Fix if small, otherwise reply.
  • Anything about surrounding code, or asking you to widen the change (hoist a helper,
    dedupe with another file, fix other call sites): never fix here, whatever the
    severity. Reply with one sentence; if it is critical, say so plainly so a human sees it.

One commit per review round. After two rounds, stop and ask a maintainer to review
scope rather than addressing more automated findings. Full rule: AGENTS.md.

2 finding(s): 🔴 0 critical · 🟠 0 major · 🔵 2 minor

1 posted as inline comment(s) on the changed lines. 1 listed below.

Findings outside the changed lines

1 minor
  • 🔵 packages/app/src/components/__tests__/DBSearchPageFilters.test.tsx:195 — useVirtualizer mock copies an existing one → packages/app/src/__tests__/HDXMultiSeriesTableChart.test.tsx:25 already mocks @tanstack/react-virtual with the same render-every-row useVirtualizer stub. Move it into a shared test helper (for example a __mocks__/@tanstack/react-virtual.ts or a util exported from the test setup) and have both files use it, so there aren't two copies to keep in sync.

Severity is the reviewer's own estimate and is used for ordering, not filtering. No finding blocks merge automatically; a maintainer decides.

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

E2E Test Results

✅ All tests passed • 411 passed • 1 skipped • 1404s

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

Tests ran across 4 shards in parallel.

View full report →

@pulpdrew pulpdrew left a comment

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.

LGTM

>
<div className={classes.filterGroupPanel}>
{childFilters.length === 0 ? (
{childFilters.length > FILTER_SEARCH_MIN_ITEMS && (

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.

P1 Hidden search keeps hiding keys

When a refresh leaves an existing group with five or fewer keys, this condition hides the search input but keeps its query active. NestedFilterGroup keeps the same React key, so nonmatching keys stay hidden with no way to clear the search—even after collapsing and reopening the group. Users can see “No properties found” despite valid keys being available.

Keep the input visible while search is nonempty, or stop applying the query when the input disappears.

Suggested change
{childFilters.length > FILTER_SEARCH_MIN_ITEMS && (
{(childFilters.length > FILTER_SEARCH_MIN_ITEMS || search !== '') && (

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

@github-actions

Copy link
Copy Markdown
Contributor

Deep Review

✅ No critical issues found.

This is a clean, well-scoped refactor: the value-search TextInput is extracted into a reusable FilterSearchInput (preserving the existing markup, threshold, and onChange behavior) and reused to add a key search to nested Map/JSON filter groups. The new behavior ships with three focused tests, types are sound, the onChange contract swap is compatible at both call sites, and the changeset is valid. No P0/P1/P2 issues survived re-grading.

🔵 P3 nitpicks (4)
  • packages/app/src/components/DBSearchPageFilters/NestedFilterGroup.tsx:201 — matchingChildFilters[virtualRow.index] is dereferenced as child.key with no guard; safe today because the virtualizer clamps indices to the current count, but count is now dynamic per keystroke so the deref is slightly more exposed than before.
    • Fix: Add if (!child) return null; after reading matchingChildFilters[virtualRow.index] for defense in depth.
    • correctness, kieran-typescript, adversarial
  • packages/app/src/components/DBSearchPageFilters/NestedFilterGroup.tsx:111 — scroll position is not reset when the query changes, so typing after scrolling down the full key list can leave the panel scrolled into the middle of the shrunken result set or flash blank for a frame.
    • Fix: Reset the scroll container to the top on search change via a layout effect (e.g. scrollContainerRef.current.scrollTop = 0).
    • julik-frontend-races
  • packages/app/src/components/DBSearchPageFilters/NestedFilterGroup.tsx:171 — the exact threshold boundary for showing the key search is untested; tests cover 2 keys (hidden) and 6 keys (shown) but not 5, leaving the > 5 condition unprotected against a >= regression.
    • Fix: Add a test with exactly FILTER_SEARCH_MIN_ITEMS keys asserting the Search keys... input is absent.
  • packages/app/src/components/DBSearchPageFilters/NestedFilterGroup.tsx:100 — search-state persistence across collapse/reopen and the whitespace-only trim() branch are untested, so neither the retained-query UX nor the "all keys shown for blank query" path is pinned down.
    • Fix: Add tests for type-query → collapse → reopen and for a whitespace-only query returning all keys.
    • testing, maintainability

Reviewers (10): correctness, testing, maintainability, project-standards, kieran-typescript, julik-frontend-races, adversarial, previous-comments, agent-native, learnings-researcher.

Testing gaps: The new jest.mock of @tanstack/react-virtual renders all rows as visible, so real virtualization (scroll windowing, index→row mapping under shrink) is never exercised — an acceptable jsdom tradeoff, but the post-filter index mapping is only validated under the always-render-all mock.

No finding blocks merge automatically. A maintainer will expect P0/P1 findings in code this PR changes to be fixed; P2/P3 are your call -- fix or reply. Never fix findings about surrounding code here; reply instead. Do not widen the PR. How to respond

@kodiakhq
kodiakhq Bot merged commit b000bbb into main Oct 14, 2026
31 checks passed
@kodiakhq
kodiakhq Bot deleted the aaron/missing-filter-search-bar branch October 14, 2026 13:42

This branch was successfully deployed

2 active deployments
Preview – hyperdx-oss — 770cfb1c Deployed Oct 14, 2026 by vercel[bot]
Preview – hyperdx-storybook — 770cfb1c Deployed Oct 14, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge review/tier-2 Low risk — AI review + quick human skim

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants