Skip to content

[AAASM-5146] ✨ (dashboard/alerts): Add free-text search to the filter bar - #1779

Merged
Chisanan232 merged 9 commits into
mainfrom
v0.0.1/AAASM-5146/feat/alerts_search
Jul 28, 2026
Merged

[AAASM-5146] ✨ (dashboard/alerts): Add free-text search to the filter bar#1779
Chisanan232 merged 9 commits into
mainfrom
v0.0.1/AAASM-5146/feat/alerts_search

Conversation

@Chisanan232

@Chisanan232 Chisanan232 commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Description

Design-QA re-audit finding (AAASM-5146): the hi-fi mock (design/v1/hi-fi/alerts.jsx:180-184) ships a "search message or agent…" free-text input as the Alerts page's primary find affordance, matching over message + agent_id + id. The shipped AlertFilterBar only had an Agent field (bound to the server-ignored agent param), so there was no way to find an alert by its rule name or its own id.

Adds a q field to AlertFilters / the URL filter state, a new Search input in the filter bar (placed ahead of the existing Agent field, matching the mock's ordering and placeholder text), and a client-side predicate that matches `${ruleName} ${agentId ?? ''} ${id}`.toLowerCase() — mirroring the mock's haystack construction but with the app's actual Alert field names (ruleName/id in place of the mock's message/id, since the shipped Alert type has no free-text message field).

Type of Change

  • ✨ New feature
  • 🐛 Bug fix
  • ♻️ Refactoring
  • 🍀 Performance improvement
  • 📝 Documentation update
  • 🔧 Configuration / CI change
  • ⬆️ Dependency upgrade
  • 🚀 Release

Breaking Changes

Does this PR introduce any breaking changes to public APIs or behaviour?

  • No
  • Yes (describe below)

Related Issues

  • Related Jira ticket: AAASM-5146
  • Related GitHub issues: n/a

Testing

  • Unit tests added / updated — alertFilters.test.ts (q matches rule name / agent id / alert id, case-insensitively), AlertFilterBar.test.tsx (search input emits q changes), urlFilters.test.ts (round-trip now exercises q)
  • Integration tests added / updated
  • Manual testing performed — pnpm dev + Playwright against a stubbed /api/v1/alerts backend (no aa-gateway available locally); screenshots in dashboard/verify/5146/:
    • 01-search-field-visible.png — Search field rendered with the mock's placeholder ("search message or agent…"), positioned before the Agent field, 3 unfiltered rows
    • 02-filtered-by-rule-name.png — typing "anomaly" narrows to the "Anomaly spike" row
    • 03-filtered-by-agent-id.png — typing "aa-001" narrows to that agent's row
    • 04-filtered-by-alert-id.png — typing "alert-003" narrows to that alert's row
  • No tests required (explain why) — n/a

Local checks (Node v22, pnpm, in dashboard/): pnpm exec tsc --noEmit clean, pnpm exec eslint . clean, pnpm exec vitest run — 275 files / 3063 tests passed.

Checklist

  • Code follows project style guidelines (cargo fmt, cargo clippy) — N/A, TypeScript change; ESLint/Prettier equivalent is clean
  • Self-review of the diff completed
  • Documentation updated if behaviour changed — N/A, no doc surface for this filter bar
  • All CI checks passing — GH Actions is intermittently billing-blocked for this org; validated locally instead (see Testing)
  • Commits are small and follow the Gitmoji convention

Security note

Per ticket scope: this is a client-side filter over an already-fetched page (same pattern as the existing agentQuery predicate in alertFilters.ts) — no new backend call, no new injection surface. No other security-relevant findings during this change.

The mock's primary find affordance (design/v1/hi-fi/alerts.jsx:180-184)
matches free text over message + agent_id + id; the shipped Agent field
only ever matched agentId + ruleName. Add the q predicate alongside it
so an alert can be found by its rule name or its own id, not just its
agent.
Mirrors design/v1/hi-fi/alerts.jsx:180-184's primary find affordance,
placed ahead of the Agent field per the mock's filter-bar ordering.
Confirms the search box renders with the mock's placeholder text and
that typing narrows the alert list by rule name, agent id, and alert
id — verified against a stubbed backend since aa-gateway is out of
scope for local frontend dev.
@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.88889% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
dashboard/src/features/alerts/alertFilters.ts 83.33% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@sonarqubecloud

Copy link
Copy Markdown

@Chisanan232 Chisanan232 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

✅ LGTM — reviewed and approved by Claude Code

(COMMENT review because GitHub blocks self-approval; this is the sign-off of record.)

Requirement correctness — AAASM-5146

Adds free-text search to the Alerts filter bar per design/v1/hi-fi/alerts.jsx:180-184. Verified: q added to AlertFilters + DEFAULT_ALERT_FILTERS (+ the ALL_ALERTS literal in OverviewPage, avoiding a tsc break); URL round-trip via ?q=; the search input uses the mock's exact placeholder "search message or agent…"; applyClientFilters matches q over ruleName + agentId + id case-insensitively, kept as a separate predicate from the existing agentQuery (no behavior change to the latter). Tests cover all three match fields (it.each), the input emitting q changes, and the URL round-trip. Correctly client-side only (the mock's primary find affordance), no server param invented.

CI — all checks green (CI Success pass).

Security — client-side filter over already-fetched, already-authorized alert data; no new request, no injection surface.

Merging as org admin with a merge commit.

🤖 Reviewed with Claude Code

@Chisanan232
Chisanan232 merged commit 1183757 into main Jul 28, 2026
40 checks passed
@Chisanan232
Chisanan232 deleted the v0.0.1/AAASM-5146/feat/alerts_search branch July 28, 2026 12:55
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