Repository navigation
Commit 513b237
authored
fix(trace-panel): start the waterfall higher in the trace side panel (#3536)
Trims the fixed chrome above the trace waterfall so the first span lands about a third of the way down a 1080p screen instead of past the middle. Nothing the panel shows is dropped: the repeats go, and the zoom hint moves into space the chart already had.
## Summary
Opening a span from search stacked several things above the waterfall that either repeated information or spent a full row on a one-line hint:
- a bordered **SpanName** box repeating the span name that the panel title (the breadcrumb) already shows in bold
- a lone `ServiceName` chip repeating the service from the metadata row right above it
- a full-width row for the "⌘/Ctrl + scroll to zoom" hint
- loose gaps after the minimap, below the trace attributes, and between the axis and the first span
Changes:
- **Trace header:** skip the body box when the panel title is a single breadcrumb holding the span name, and the name is at most 40 characters, so the title shows it in full even in a narrower drawer. Longer names keep the box, and so do breadcrumb trails (a span opened from a session, hops between spans, **View Trace** from a log), where crumbs share one row and can cut the name off. Log panels keep their body box.
- **Service chip:** trace panels no longer add the implicit `serviceNameExpression` chip. The metadata row shows the service, and the span detail pane next to the waterfall still offers **Add to Filters**, **Search for this value only**, and **Copy value** on `ServiceName`. Highlighted attributes configured on the source still render, and log panels keep the chip.
- **Zoom hint:** moves from its own row into the timeline's top-left corner, the empty cell above the span labels next to the axis ticks. It's plain dimmed text in the axis label font, on the same baseline as the ticks, so it reads as the label column's header. The same shortcut is listed in the side panel's keyboard shortcuts dialog.
- **Spacing:** drops the minimap's bottom margin (the controls row below already spaces it), moves the bottom margin of `DBHighlightedAttributesList` to its two callers so the header doesn't stack it on top of its own padding (log panels get the same tighter gap below their chips), and cuts the gap between the axis and the first span from 32px to 20px. The hover time label reaches 37px below the top of the chart, so the first span (now at 44px) still clears it.
Measured on the same trace and data at 1920x945 (a 1080p screen minus browser chrome), identical in light and dark:
| | `main` | This branch |
| :-- | --: | --: |
| Tabs start at | 218px | 82px |
| First waterfall span | 506px (53.6% down) | 307px (32.4% down) |
| Spans visible without scrolling | 18 | 26 |
| First span, long span name or View Trace | 506px | 386px (box kept) |
### Screenshots or video
Same trace, data, viewport (1920x945), and theme on both sides:
| Before | After |
| :----- | :---- |
|  |  |
|  |  |
A span name longer than 40 characters keeps the box, so the full statement stays readable:

The zoom hint in the chart corner, light and dark:


### How to reproduce
**Starting point:** `yarn app:dev:local` connected to the demo server (onboarding, then "Connect to Demo Server"), or the Vercel preview on this PR.
**On `main`:**
1. Open **Search** and pick the **Demo Traces** source.
2. Click any span in the results table.
3. The waterfall starts below the **SpanName** box, the `ServiceName` chip, the tabs, the minimap, the controls, and a separate "⌘/Ctrl + scroll to zoom" row.
**On this branch:**
1. Same steps. The tabs sit right under the metadata row, the hint sits in the chart's top-left corner, and the first span starts noticeably higher.
### How to test on Vercel preview
**Preview routes:** /search
**Steps:**
1. Open /search. If the **Welcome to ClickStack** dialog appears, click **Connect to Demo Server**. Then select the **Demo Traces** source from the source picker.
2. Click the first row in the results table.
3. Verify the side panel opens on the **Trace** tab with no box labeled "SpanName" between the metadata row and the tabs.
4. Verify `[data-testid="timeline-zoom-hint"]` is visible inside the waterfall and reads "⌘/Ctrl + scroll to zoom".
5. Click a different span in the waterfall and confirm its details open next to the waterfall.
### Test plan
- [x] unit: `isSpanNameShownInTitle` and `getHeaderHighlightExpressions` are tested directly in `DBRowSidePanel.compactHeader.test.ts`: the 40/41 character boundary, breadcrumb trails, a title that isn't the span name, no body value, log panels, the service chip on trace and log panels, and configured highlights
- [x] unit: `DBRowSidePanelHeader` tests for `bodyShownInTitle` and the empty attribute list, and a `TimelineChart` test for the hint placement; each new assertion fails when its guarded line is reverted
- [x] full app unit suite, app `ci:lint` (tsc, eslint within the warning budget, stylelint), ratchet, knip
- [x] manual, local stack with a seeded 25-span checkout trace and a long SQL span name: before and after at 1920x945 in light and dark, hover time label clearance on the first span, View Trace from a log, log panel keeps its body box and chip
- [x] viewport: 1920x945 and 1366x768; the corner hint fits the default label column at both, and truncates with an ellipsis if the column is dragged narrower
- States: the waterfall's loading, empty, and error branches render exactly as before; only the header and chart chrome around them changed
### What's not in this PR
- The waterfall controls row wraps when the span detail pane is open on the side (two lines at 1920, three at 1366), same as on `main`. Moving the **Correlated logs** source picker behind **Show Filters** would keep it to one line; that felt like a separate call.
- Log panels also show the service twice (metadata row and chip). I left them alone to keep this change to the trace view.
### References
- Related PRs: #2541 (single drawer header and metadata row), #2552 (timeline minimap)1 parent 0f659fd commit 513b237
9 files changed
Lines changed: 268 additions & 45 deletions
File tree
- .changeset
- packages/app/src/components
- TimelineChart
- __tests__
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
44 | | - | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
242 | 290 | | |
243 | 291 | | |
244 | 292 | | |
| |||
498 | 546 | | |
499 | 547 | | |
500 | 548 | | |
501 | | - | |
502 | | - | |
503 | | - | |
504 | | - | |
505 | | - | |
506 | | - | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
513 | | - | |
514 | | - | |
515 | | - | |
516 | | - | |
517 | | - | |
518 | | - | |
519 | | - | |
520 | | - | |
521 | | - | |
522 | 549 | | |
523 | 550 | | |
524 | 551 | | |
525 | | - | |
| 552 | + | |
526 | 553 | | |
527 | 554 | | |
528 | 555 | | |
| |||
868 | 895 | | |
869 | 896 | | |
870 | 897 | | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
871 | 904 | | |
872 | 905 | | |
873 | 906 | | |
| |||
1075 | 1108 | | |
1076 | 1109 | | |
1077 | 1110 | | |
| 1111 | + | |
1078 | 1112 | | |
1079 | 1113 | | |
1080 | 1114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
27 | 31 | | |
28 | 32 | | |
29 | 33 | | |
30 | 34 | | |
31 | 35 | | |
32 | 36 | | |
| 37 | + | |
33 | 38 | | |
34 | 39 | | |
35 | 40 | | |
| |||
85 | 90 | | |
86 | 91 | | |
87 | 92 | | |
88 | | - | |
| 93 | + | |
89 | 94 | | |
90 | 95 | | |
91 | 96 | | |
| |||
135 | 140 | | |
136 | 141 | | |
137 | 142 | | |
138 | | - | |
139 | | - | |
140 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
141 | 148 | | |
142 | 149 | | |
143 | 150 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1394 | 1394 | | |
1395 | 1395 | | |
1396 | 1396 | | |
1397 | | - | |
1398 | | - | |
1399 | | - | |
1400 | | - | |
1401 | | - | |
1402 | | - | |
| 1397 | + | |
1403 | 1398 | | |
1404 | 1399 | | |
1405 | 1400 | | |
| |||
1618 | 1613 | | |
1619 | 1614 | | |
1620 | 1615 | | |
1621 | | - | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
1622 | 1621 | | |
1623 | 1622 | | |
1624 | 1623 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
81 | 86 | | |
82 | 87 | | |
83 | 88 | | |
| |||
404 | 409 | | |
405 | 410 | | |
406 | 411 | | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | 412 | | |
414 | 413 | | |
415 | 414 | | |
| |||
426 | 425 | | |
427 | 426 | | |
428 | 427 | | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
429 | 432 | | |
430 | | - | |
431 | 433 | | |
| 434 | + | |
432 | 435 | | |
433 | 436 | | |
434 | 437 | | |
435 | 438 | | |
436 | 439 | | |
437 | | - | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
438 | 451 | | |
439 | 452 | | |
440 | 453 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
0 commit comments