feat: trace waterfall redesign#2565
Conversation
🦋 Changeset detectedLatest commit: 5107605 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🟡 Tier 3 — StandardIntroduces new logic, modifies core functionality, or touches areas with non-trivial risk. Why this tier:
Review process: Full human review — logic, architecture, edge cases. Stats
|
Greptile SummaryThis PR redesigns the trace waterfall chart with per-service colors, a revised label/bar layout, and depth-level collapse controls; it also cleans up the surrounding trace panel by moving the correlated-log source selector into the controls bar and removing the duplicated trace ID.
Confidence Score: 5/5Safe to merge — the redesign is well-scoped, the new filter-error fallback prevents chart blanking on bad filters, and the depth-control helpers are covered by thorough unit tests. All the new logic paths are correctly handled: the dual-query fallback in useFilteredEventsAroundFocus correctly isolates filter failures from fatal errors, the URL-first language seeding resolves the previously noted shared-link inconsistency, and the collapse/expand helpers are pure functions with good test coverage. The one concern — parentIdsByLevel being recomputed on every collapse action — is a performance trade-off, not a correctness issue, and would only be noticeable on very large traces. DBTraceWaterfallChart.tsx — the parentIdsByLevel computation shares a useMemo with flattenedNodes; worth revisiting if collapse interactions feel sluggish on large traces. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[useFilteredEventsAroundFocus] --> B[Run filtered query\nhiddenRowExpression set]
B --> C{Query error?}
C -- No --> D[Return filtered rows\nfatalError: undefined\nfilterError: undefined]
C -- Yes --> E{Is filterFailed?\nenabled && expr && error}
E -- Yes --> F[Run fallback query\nhiddenRowExpression: undefined]
F --> G{Fallback error?}
G -- No --> H[Return unfiltered rows\nfilterError: filtered.error\nfatalError: undefined]
G -- Yes --> I[Return undefined rows\nfilterError: undefined\nfatalError: fallback.error]
E -- No --> J[Return undefined rows\nfatalError: filtered.error]
H --> K[Inline filter error shown\nbelow filter input]
I --> L[Full-chart error block]
J --> L
D --> M[Chart renders normally]
H --> M
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[useFilteredEventsAroundFocus] --> B[Run filtered query\nhiddenRowExpression set]
B --> C{Query error?}
C -- No --> D[Return filtered rows\nfatalError: undefined\nfilterError: undefined]
C -- Yes --> E{Is filterFailed?\nenabled && expr && error}
E -- Yes --> F[Run fallback query\nhiddenRowExpression: undefined]
F --> G{Fallback error?}
G -- No --> H[Return unfiltered rows\nfilterError: filtered.error\nfatalError: undefined]
G -- Yes --> I[Return undefined rows\nfilterError: undefined\nfatalError: fallback.error]
E -- No --> J[Return undefined rows\nfatalError: filtered.error]
H --> K[Inline filter error shown\nbelow filter input]
I --> L[Full-chart error block]
J --> L
D --> M[Chart renders normally]
H --> M
Reviews (10): Last reviewed commit: "use separate filter values" | Re-trigger Greptile |
E2E Test Results✅ All tests passed • 225 passed • 3 skipped • 1427s
Tests ran across 4 shards in parallel. |
Deep ReviewScope: PR #2565 — trace waterfall redesign. Frontend-only (React/TS) diff across ✅ No critical issues found. No P0/P1 defects surfaced. The filter-language URL persistence is correctly wired end-to-end, the removed 🟡 P2 -- recommended
🔵 P3 nitpicks (2)
Reviewers (2 returned of 10 dispatched): ce-agent-native-reviewer, ce-learnings-researcher. The other 8 dispatched personas (correctness, adversarial, testing, maintainability, project-standards, performance, kieran-typescript, julik-frontend-races) did not return before synthesis; the findings above combine the returned reviewers with direct orchestrator analysis of the full diff. No prior Testing gaps:
|
141473a to
c185d3f
Compare
c185d3f to
8953644
Compare
8953644 to
c8a287b
Compare
Thanks for taking a look @elizabetdev! Both of those points should already be addressed in #2541 The changes here are focused mostly on the waterfall/timeline. |
eb9103a to
c57c581
Compare
|
@karl-power the P0 is a legit issue with the combined filters approach
Before: separate log/trace filter, no issue Combined, if you search for something like SpanName='whatever', you will get this error as |
|
This PR currently has a merge conflict. Please resolve this and then re-add the |
Prefer the URL's whereLanguage param when seeding the filter language toggle so a shared link / reload shows the same language the query runs in, and reset the toggle on clear so a stale value isn't re-serialized into the URL on the next submit. Also drop the now-unused getChartColorErrorHighlight / getChartColorWarningHighlight exports.
c57c581 to
cf3689a
Compare
Thanks, I missed this. I just updated it now to split the combined filter into separate spans and logs inputs. A failing filter falls back to unfiltered results with the error surfaced inline next to its input. |
4849b87 to
5107605
Compare



Summary
Redesigns the trace waterfall chart and cleans up the surrounding trace panel layout.
Waterfall redesign (HDX-3945)
Trace panel layout (HDX-3952)
Collapse hint bug (HDX-4444)
CollapseTooltipLabel/useDisclosure) that could render multiple times when chevrons were highlighted in quick succession. Collapse is now an always-present chevron control.Supporting changes
useWaterfallSearchStatenow persists the filter language (whereLanguage) in the URL so shared links / reloads rebuild the query in the language it was written in.SearchWhereInputaccepts aparentReffor popover positioning.Testing
DBTraceWaterfallChart.test.tsxcovering the depth-control logic.DBTracePanel.test.tsxfor the new layout.Screenshots or video
How to test on Vercel preview
Preview routes:
/searchSteps:
References