Skip to content

Add alert filtering: search by name, filter by tag and creator#2204

Open
MikeShi42 wants to merge 9 commits intomainfrom
cursor/alert-filtering-9c46
Open

Add alert filtering: search by name, filter by tag and creator#2204
MikeShi42 wants to merge 9 commits intomainfrom
cursor/alert-filtering-9c46

Conversation

@MikeShi42
Copy link
Copy Markdown
Contributor

@MikeShi42 MikeShi42 commented May 6, 2026

Summary

Adds filtering capabilities to the Alerts page so teams with many alerts can quickly find relevant ones. This addresses the customer request in HDX-4151 for filtering alerts by naming convention, tags, or creator.

Three filter controls are added at the top of the alerts page:

  • Search by name: Text input that filters alerts by their display name (dashboard + tile name, or saved search name) and tags. Persisted to URL via nuqs (?search=...).
  • Filter by tag: Dropdown populated from dashboard/saved search tags associated with each alert. Persisted to URL (?tag=...).
  • Filter by creator: Dropdown populated from alert creators (name or email). Persisted to URL (?creator=...).

All three filters are persisted to the URL so filtered views can be bookmarked and shared.

Tags are now also displayed as badges on each alert card for visibility.

The implementation follows the existing pattern from DashboardsListPage which uses the same useQueryState + Select approach for tag filtering.

E2E Tests

Added a comprehensive Playwright E2E test suite (Alert Filtering describe block in alerts.spec.ts) with 6 tests:

  • Filter controls visibility (search, tag, creator dropdowns)
  • Search by name filtering with URL persistence
  • Tag filter with clear/restore behavior
  • Tag filter across alert sources
  • Empty state when no alerts match filters
  • Loading filtered view from URL params directly

Also added filter-related methods to the AlertsPage page object.

Screenshots or video

Before After
No filter controls on alerts page Filter controls with search, tag, and creator dropdowns

Alerts page with all filters visible:

Alerts page with filter controls

Search filter in action (filtering by "Production"):

Search filter results

Tag filter (filtering by "staging"):

Tag filter results

Creator filter (filtering by "Alice Smith"):

Creator filter results

Full demo video:

alert_filtering_demo.mp4

How to test locally or on Vercel

  1. Start the dev stack with yarn dev
  2. Create dashboards with tags, and set up alerts on dashboard tiles or saved searches
  3. Navigate to /alerts — filter controls appear at the top when alerts exist
  4. Test search by name, tag filter, and creator filter
  5. Verify URL updates with ?search=..., ?tag=... and ?creator=... query parameters
  6. Verify filtered URLs can be bookmarked and shared
  7. Run E2E tests: ./scripts/test-e2e.sh --quiet alerts --grep "Alert Filtering"

References

  • Linear Issue: HDX-4151

To show artifacts inline, enable in settings.

Linear Issue: HDX-4151

Open in Web Open in Cursor 

- Add search input (filters by alert display name and tags)
- Add tag filter dropdown (populated from dashboard/saved search tags)
- Add creator filter dropdown (populated from alert creators)
- Tag and creator filters persist to URL via nuqs for bookmarking/sharing
- Display tags on each alert card
- Show empty state when filters match no alerts

Co-authored-by: Mike Shi <mike@hyperdx.io>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 6, 2026

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

Project Deployment Actions Updated (UTC)
hyperdx-oss Ready Ready Preview, Comment May 6, 2026 6:15am

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 6, 2026

⚠️ No Changeset found

Latest commit: ca9726f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

E2E Test Results

All tests passed • 166 passed • 3 skipped • 1142s

Status Count
✅ Passed 166
❌ Failed 0
⚠️ Flaky 3
⏭️ Skipped 3

Tests ran across 4 shards in parallel.

View full report →

Use useQueryState('search') instead of local useState so the search
text is also persisted in the URL, making filtered views fully
bookmarkable and shareable.

Co-authored-by: Mike Shi <mike@hyperdx.io>
Tests cover:
- Filter controls visibility (search, tag, creator dropdowns)
- Search by name filtering and URL persistence
- Tag filter with clear/restore behavior
- Tag filter across alert sources (dashboard + saved search)
- Empty state when no alerts match filters
- Loading filtered view from URL params directly

Co-authored-by: Mike Shi <mike@hyperdx.io>
Use path.join(__dirname, ...) for the auth state file in beforeAll
so the test works regardless of the CWD.

Co-authored-by: Mike Shi <mike@hyperdx.io>
Use three saved search alerts with different tags instead of
dashboard tile alerts which require complex tile config formatting.
This makes the test seeding simpler and more reliable.

Co-authored-by: Mike Shi <mike@hyperdx.io>
…ook URL

- Type the tag name in the searchable Select to narrow options before
  clicking, avoiding issues with many tags from parallel test runs
- Use Date.now() suffix in webhook URL to avoid collisions on retries

Co-authored-by: Mike Shi <mike@hyperdx.io>
Co-authored-by: Mike Shi <mike@hyperdx.io>
…double-seeding

- selectTag/selectCreator: In Mantine v9, data-testid on Select is applied to
  the <input> element directly (via ...others spread to InputBase/Input). Use
  .fill() directly on the locator instead of .getByRole('combobox'/.fill().

- clearTagFilter/clearCreatorFilter: Mantine v9's ComboboxClearButton sets
  aria-hidden='true' on the clear button, making getByRole('button') unable to
  find it. Use locator('..').locator('button') instead (CSS selector bypasses
  aria-hidden filtering).

- Alert Filtering describe block: Add test.describe.configure({ mode: 'serial' })
  so that beforeAll seeding runs exactly once. Without this, Playwright runs
  tests from the block across multiple workers, each calling beforeAll
  independently and creating duplicate alert cards for the same timestamp,
  causing strict mode violations.

Co-authored-by: Mike Shi <mike@hyperdx.io>
@MikeShi42 MikeShi42 marked this pull request as ready for review May 6, 2026 06:50
@github-actions github-actions Bot added the review/tier-2 Low risk — AI review + quick human skim label May 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

🔵 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: 1
  • Production lines changed: 134 (+ 263 in test files, excluded from tier calculation)
  • Branch: cursor/alert-filtering-9c46
  • Author: MikeShi42

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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