Skip to content

feat(ui): add filter bars to Errors and Logs tabs#1329

Merged
MathurAditya724 merged 3 commits into
mainfrom
issue-1315-filter-errors-logs
Jun 24, 2026
Merged

feat(ui): add filter bars to Errors and Logs tabs#1329
MathurAditya724 merged 3 commits into
mainfrom
issue-1315-filter-errors-logs

Conversation

@jared-outpost

@jared-outpost jared-outpost Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Adds per-tab filtering on the top-level Errors and Logs views (#1315). The Errors tab gets a search box (matches message + exception type/value) plus Level and Exception Type dropdowns; the Logs tab gets a search box (matches message body) plus Severity and Logger dropdowns. Filter options are derived from the data actually present, and dropdowns hide themselves when there's nothing to filter by.

Filtering is gated to the standalone tabs — the in-trace error/log lists are unchanged. The bar reuses the existing trace-filter UI pattern, extracted into a shared ListFilter component (traces left untouched to keep the diff focused; converging TraceListFilter onto ListFilter is a reasonable follow-up).

Testing

  • vitest run for the two new hook test files — 13 tests pass.
  • Full vitest run: telemetry/UI suites green; the 21 failures in server/utils/__tests__/docker-compose.test.ts are pre-existing on main and unrelated.
  • biome check clean on all changed files.

Closes #1315

Adds per-tab filtering on the top-level Errors and Logs views:
- Errors: search by message/exception type, filter by level and
  exception type.
- Logs: search by message body, filter by severity and logger name.

Filtering is gated to the standalone tabs and left out of the
in-trace error/log lists. The filter bar UI mirrors the existing
trace filter, extracted into a shared ListFilter component.

Fixes #1315
@vercel

vercel Bot commented Jun 23, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
spotlightjs Skipped Skipped Jun 23, 2026 3:48pm

Request Review

@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Codecov Results 📊

✅ Patch coverage is 100.00%. Project has 678 uncovered lines.
✅ Project coverage is 59.68%. Comparing base (base) to head (head).

Files with missing lines (2)
File Patch % Lines
packages/spotlight/src/ui/telemetry/hooks/useErrorFiltering.tsx 100.00% ⚠️ 4 partials
packages/spotlight/src/ui/telemetry/hooks/useLogsFiltering.tsx 100.00% ⚠️ 1 partials
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    57.62%    59.68%    +2.06%
==========================================
  Files           49        53        +4
  Lines         1602      1672       +70
  Branches      1153      1204       +51
==========================================
+ Hits           924       994       +70
- Misses         678       678         —
- Partials       123       128        +5

Generated by Codecov Action

@github-actions

Copy link
Copy Markdown
Contributor

Codecov Results 📊

✅ Patch coverage is 100.00%. Project has 678 uncovered lines.
✅ Project coverage is 59.77%. Comparing base (base) to head (head).

Files with missing lines (2)
File Patch % Lines
packages/spotlight/src/ui/telemetry/hooks/useErrorFiltering.tsx 100.00% ⚠️ 4 partials
packages/spotlight/src/ui/telemetry/hooks/useLogsFiltering.tsx 100.00% ⚠️ 1 partials
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    57.62%    59.77%    +2.15%
==========================================
  Files           49        53        +4
  Lines         1602      1674       +72
  Branches      1153      1204       +51
==========================================
+ Hits           924       996       +72
- Misses         678       678         —
- Partials       123       128        +5

Generated by Codecov Action

@jared-outpost jared-outpost Bot marked this pull request as ready for review June 23, 2026 15:38
@jared-outpost

jared-outpost Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

Out of draft — all checks are green (unit tests across Node 20/22/24, E2E UI, CodeQL, semgrep, build). Self-review is clean: the filter bar reuses the existing trace-filter pattern via a shared ListFilter, filtering is scoped to the standalone Errors/Logs tabs, and both new hooks have unit coverage. Ready for review.

@jared-outpost

jared-outpost Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

Not enabling auto-merge — this exceeds the threshold for an automated merge (599 lines changed across 9 files vs. the 150-line / 5-file cap for a new UI feature). Leaving it for a maintainer to review and merge.

Comment thread packages/spotlight/src/ui/telemetry/hooks/useLogsFiltering.tsx
Active filters were a flat list of raw option strings, with each
dimension inferred by membership in its option set. When the same
string existed in two dimensions (e.g. a logger and a level both
named "error"), selecting it in one dropdown applied it to both,
forcing rows to satisfy every matching dimension.

Namespace each option value as "<dimension>:<value>" so dropdowns
stay independent, and resolve the human-readable label for the
active-filter badges. Adds regression tests for both hooks.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 26cadfb. Configure here.

Comment thread packages/spotlight/src/ui/telemetry/components/log/LogsList.tsx
When active filters excluded every log, the early return rendered only
the filter bar and empty state, dropping LogDetails. A direct link to
/telemetry/logs/:id then never opened the side panel until the filters
were cleared. Include LogDetails in that branch too.

@MathurAditya724 MathurAditya724 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I reviewed this against #1315. No blocking findings.

The PR correctly adds top-level Errors filtering by message/exception type/level and Logs filtering by message/logger/severity, while bypassing trace-scoped Errors/Logs lists. The hook tests cover query matching, dimension filters, same-value collisions across dimensions, and hidden empty option groups. GitHub CI is green, so I consider this mergeable.

Minor non-blocking risks:

  • packages/spotlight/src/ui/telemetry/hooks/useLogsFiltering.tsx:12-14 only recognizes logger names from attributes["sentry.logger.name"]; logs emitted with a different logger attribute would not expose a logger filter.
  • Filter state is local to the component, so filters reset on tab unmount/navigation/reload. That is acceptable because the issue did not require persistence.
  • ListFilter shows “Clear all” only for dropdown filters, not search-only filtering, though search still has its own clear button.

@MathurAditya724 MathurAditya724 merged commit f265380 into main Jun 24, 2026
25 checks passed
@MathurAditya724 MathurAditya724 deleted the issue-1315-filter-errors-logs branch June 24, 2026 05:23
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.

Add filtering for Errors and Logs tabs

1 participant