Skip to content

Add Show spans/Show logs visibility toggles to trace waterfall panel#2180

Open
MikeShi42 wants to merge 8 commits intomainfrom
cursor/trace-log-filter-toggle-7dd0
Open

Add Show spans/Show logs visibility toggles to trace waterfall panel#2180
MikeShi42 wants to merge 8 commits intomainfrom
cursor/trace-log-filter-toggle-7dd0

Conversation

@MikeShi42
Copy link
Copy Markdown
Contributor

@MikeShi42 MikeShi42 commented May 1, 2026

Summary

Adds dedicated visibility toggles to the trace waterfall panel, enabling users to independently show or hide trace spans, correlated log events, and span events. This makes it much easier to isolate and review logs within a trace context without visually scanning through all the span rows.

Uses a compact Show: [Spans] [Logs] [Span events] chip-toggle pattern — a "Show:" label followed by tight, pill-shaped Mantine Chips with reduced padding (8px inline, 22px height) in muted gray. Active chips show a subtle dark fill with a checkmark; inactive chips fade to near-transparent. The result is sleek and unobtrusive while remaining easy to discover and interact with.

The filtering is client-side only — both data sources are still fetched so toggling is instant with no re-query. The header counts update to reflect only visible rows, with separate span and log tallies (e.g. "4 spans, 4 logs, 2 errors").

Changes

  • Visibility chips: "Spans" chip always visible, "Logs" chip appears when a log source is configured. All active by default, preserving existing behavior.
  • Accurate counts: Header now shows separate span/log counts instead of labeling all rows as "spans". When a type has zero visible rows its count is omitted.
  • Filter-aware empty state: When data exists but all visibility toggles are off, shows "All items are hidden by filters" instead of the misleading "No matching spans or logs found."

Screenshots or video

Default state — all toggles active:

Trace waterfall with all visibility chips active showing 8 spans

Spans toggled off — logs-only view:

Spans chip inactive, waterfall shows only correlated log rows

Logs toggled off — spans-only view:

Logs chip inactive, waterfall shows only span timing bars

Full demo (toggle on/off walkthrough):

pr_demo_trace_visibility_toggles.mp4

How to test locally or on Vercel

  1. Start the dev stack (yarn dev) and ensure you have trace + log data
  2. Open the Search page, select the Traces source, and click on a trace row to open the side panel
  3. Verify the "Show:" label followed by "Spans", "Logs", and "Span events" chip toggles in muted gray
  4. Toggle each chip and confirm:
    • Toggling off "Spans" hides all span rows; header shows only log count
    • Toggling off "Logs" hides all log rows; header shows only span count
    • Toggling both off shows "All items are hidden by filters"
    • Toggling back on restores the full waterfall with combined counts

References

  • Linear Issue: HDX-4133

To show artifacts inline, enable in settings.

Linear Issue: HDX-4133

Open in Web Open in Cursor 

Users can now independently show/hide spans and log events in the trace
waterfall using dedicated checkboxes. The 'Show spans' checkbox is always
visible; the 'Show logs' checkbox appears when a log source is configured.

Filtering is applied client-side after the DAG flattening step, so the
toggle state has no effect on data fetching. Counts in the header update
to reflect only visible rows.

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

changeset-bot Bot commented May 1, 2026

⚠️ No Changeset found

Latest commit: 6394d8d

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

@vercel
Copy link
Copy Markdown

vercel Bot commented May 1, 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 1:59am

Request Review

… controls

Switches from three full Checkbox components to Mantine Chip pills, giving
a more compact, discoverable UI. Chips are visually prominent enough to be
noticed but take significantly less horizontal space than labeled checkboxes.

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

github-actions Bot commented May 1, 2026

E2E Test Results

All tests passed • 159 passed • 3 skipped • 1188s

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

Tests ran across 4 shards in parallel.

View full report →

Adds a 'Show:' label before the chip group, reduces chip padding inline
to 8px and height to 22px, and uses Chip.Group for proper grouping.

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

github-actions Bot commented May 1, 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: 103 (+ 51 in test files, excluded from tier calculation)
  • Branch: cursor/trace-log-filter-toggle-7dd0
  • 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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 1, 2026

{"review": "\n## PR Review\n\n✅ No critical issues found.\n\nMinor observations (non-blocking):\n- spanCount / logCount / errorCount each filter visibleNodes separately (3 array passes). Fine for trace-sized data; could be a single reduce if perf ever matters.\n- initialScrollRowIndex now searches visibleNodes; if the highlighted row's type is toggled off it returns -1 and the auto-scroll silently no-ops. Acceptable, but worth a note in case a future user reports "deep-link doesn't scroll."\n- The header still renders "0 items, 0 errors" briefly when both Spans and Logs are toggled off (the empty-state replaces the chart but the count line remains). Cosmetic only.\n\nTests cover chip presence, log-source gating, and toggle behavior — good coverage for the new logic."}

…t Chip.Group

Show 'All items are hidden by filters' when data exists but visibility
toggles hide everything, instead of the generic 'No matching spans or
logs found'. Replace Chip.Group (unused for controlled chips) with a
plain Group.

Co-authored-by: Mike Shi <mike@hyperdx.io>
The header now reads e.g. '4 spans, 4 logs, 2 errors' instead of
lumping everything under 'spans'. When one type is toggled off and has
zero visible rows, its count is omitted entirely.

Co-authored-by: Mike Shi <mike@hyperdx.io>
Span events only render on span rows, so the toggle is meaningless when
spans are off — disable the chip to avoid confusion. Also change the
zero-count fallback from '0 spans' to '0 items' for accuracy (this path
is only reachable if flattenedNodes is empty).

Co-authored-by: Mike Shi <mike@hyperdx.io>
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