feat(trace-waterfall): Render warning icon with count#116566
Open
nsdeschenes wants to merge 19 commits into
Open
feat(trace-waterfall): Render warning icon with count#116566nsdeschenes wants to merge 19 commits into
nsdeschenes wants to merge 19 commits into
Conversation
Render child-derived trace issues as a single counted indicator while preserving direct issue icons. Limit colored background patterns to direct issues so inherited child issues do not tint parent spans.
Measure grouped issue indicators when computing trace span text placement. This prevents right-side labels from overlapping the wider counted issue pill on narrow spans.
Anchor grouped child issue pills to the span edge when centering would cross the bar boundary. Update trace label placement to reserve the edge-anchored pill width so labels do not overlap the indicator.
Remove the white border from grouped trace issue pills so the indicator blends with the trace bar styling.
Only edge-anchor trace issue icons when centering them would cross the visible trace viewport boundary. Keep icons centered within narrow spans that are fully visible.
Render grouped trace issue counts as additional issues beside the representative icon. This avoids showing one extra issue when the icon already accounts for the first child-derived issue. Keep trace text placement width calculations aligned with the rendered count and add regression coverage for grouped issue counts. Co-Authored-By: Codex <noreply@openai.com>
Contributor
📊 Type Coverage Diff✅ No new type safety issues introduced. Coverage: 93.60% |
When a trace issue icon snaps to the visible viewport edge, the anchor timestamp could fall outside the span's node_space, producing left values below 0% or above 100% and drawing the pill off the bar. Clamp the anchor timestamp back into the span so the pill stays flush within the bar. Co-authored-by: Cursor <cursoragent@cursor.com>
Guard against a null node_space once and narrow it to a local binding, replacing the eleven props.node_space! assertions in TraceIssueIcons. No behavior change. Co-Authored-By: Claude <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
The styled wrapper is only used within trace.tsx, so the export was flagged by knip as unused. Make it module-private again. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Deduplicates six functions, one interface, and five constants that were copy-pasted between traceIcons.tsx and virtualizedViewManager.tsx.
Truthiness check would silently skip group rendering if the count were ever 0. Use !== undefined to guard against that edge case.
Remove export keyword from getMostSevereTraceIssue, getTraceIssueSeverityRank, and RenderableTraceIssue since they are only used internally within the module. Fixes knip unused-exports violations. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…lacement Compute issue icon edge and anchor timestamp against the physical trace space instead of the scaled trace view, so icons in zoomed views are not incorrectly clamped to the visible trace end. Co-authored-by: Cursor <cursoragent@cursor.com>
Use the shared measured pill width when computing grouped trace issue icon edge clamping. This keeps the rendered pill and duration label collision logic aligned when count text is wider than the old estimate. Co-Authored-By: Codex <noreply@openai.com>
…ults Add WeakMap caches to avoid recomputing error and occurrence sets on every call during trace waterfall rendering. The cache is keyed by node reference so entries are automatically collected when nodes are garbage collected. Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
…idth The truthy check on additionalIssueCount skipped getTraceIconGroupWidth when the count was 0, falling back to the single icon width instead of measuring the grouped pill. Use an explicit undefined check to correctly handle the zero case. Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4b6640e. Configure here.
Drop two tests that exercise the same start-clamped code paths as existing tests: one in traceIcons (identical assertions to the narrow-span-duration test) and one in virtualizedViewManager (same clamping logic as the view-edge anchored grouped pill test). Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
getTraceIconBounds anchored edge-clamped icons to the viewport edge, but TraceIssueIcons clamps the anchor back into the span. When the span starts inside the viewport, the bounds were too far left, making the text placement right bound too small and causing duration labels to overlap the issue pill. Clamp the anchor to the span bounds so the computed icon hitbox matches where the icon actually renders. Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
These constants are only used internally by getTraceIconGroupWidth and do not need to be exported. Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

The goal of this PR is to address an issue where if there we too many warnings in the trace waterfall we would attempt to render all of them in a parent above, example:
This PR makes the change so that we now only render one icon with the count next to it: