Skip to content

feat(spotlight): small-multiples histograms + tab order fix#52

Merged
coccyx merged 1 commit into
masterfrom
feat/spotlight-mini-histograms
May 29, 2026
Merged

feat(spotlight): small-multiples histograms + tab order fix#52
coccyx merged 1 commit into
masterfrom
feat/spotlight-mini-histograms

Conversation

@coccyx
Copy link
Copy Markdown
Contributor

@coccyx coccyx commented May 29, 2026

Summary

Two coupled UX fixes for the Spotlight rail, surfaced during manual validation of the v0.9.0 thread.

Problem 1 — Tab order was incoherent

Spotlight was the default tab but rendered on the right of Facets. Default-active + right-position didn't match.

Fix: Spotlight now renders first/left. Facets is one click away.

Problem 2 — Row-per-value layout ate too much vertical space

The prior card-per-attribute design used ~200px per attribute: header + per-value rows + paired sel/base bars + counts line. The Traces rail (~800px tall) showed 1–2 attributes at a time — scanning required scrolling.

Fix: Honeycomb-style small-multiples. One compact cell per attribute: attr-name + score header on top of a mini-histogram drawn in pure SVG. Each value contributes a pair of vertical bars (SEL accent + BASE muted gray). The human eye picks up asymmetric shapes in a chart grid much faster than rows of numbers.

Click an attribute's header → opens the per-value detail list inline with the same click-to-filter buttons.

Density: ~5–6 attributes visible at once vs 1–2 before. Same vertical space.

Architecture

  • New src/components/SpotlightHistogram.tsx — pure SVG, no chart library. 100-unit viewBox, non-scaling-stroke axis line. Normalized to each attribute's max share so the chart fills its vertical space.
  • SpotlightPanel rewritten to render the small-multiples grid + collapsible detail rows.
  • SpotlightSection (Errors, Service Detail) inherits the new look automatically.
  • Same engine (computeSpotlight), same data — purely a presentation change.

Screenshots

Traces page — Spotlight tab on the left, five attributes visible at once:
00

Click a header to expand per-value detail rows:
01

Service Detail — http.status_code shows stark asymmetry (score 10.93):
02

The big accent bar on one value + big gray bar on a completely different value is the visual signal — "errors and healthy traffic have totally different status codes." That's the conclusion Spotlight is meant to surface.

Test plan

  • npx tsc --noEmit — clean
  • npm run lint — 0 errors
  • npm test — 101/101 passing
  • npm run deploy — packed + uploaded + provisioned on staging
  • Playwright capture spec succeeds (3 shots: Traces collapsed, Traces expanded, Service Detail)

Validate on staging

Scenario: paymentFailure 50% currently on.

  1. Open Traces page — empty state. Click "HTTP 5xx errors" sample chip.
  2. Confirm Spotlight tab is left, active by default
  3. Confirm 5+ attribute mini-charts visible
  4. Click any chart header — per-value detail rows expand
  5. Click a value in the expanded detail — adds a filter row
  6. Open Services → any service. Spotlight section uses the same small-multiples layout.

Follow-ups (not in this PR)

  • Histograms normalize per-chart to max share, so when one value dominates (e.g., 97% of baseline = 200) it eats vertical space and other bars look pixel-sized. Could optionally clip the dominant baseline-only value.
  • Hover tooltip is browser-default SVG <title>. A custom tooltip with better typography is nice-to-have.
  • Detail expansion shows all rows up to maxRowsPerAttr (10). High-cardinality attrs could use a "show more" bound.

Session log

docs/sessions/2026-05-29-spotlight-mini-histograms.md

🤖 Generated with Claude Code

Two coupled UX fixes for the Spotlight rail, surfaced during
manual validation of the v0.9.0 thread.

Tab order: Spotlight is the default rail tab but rendered on the
right of Facets. Default-active + right-position was incoherent.
Spotlight now renders first/left.

Layout: the prior row-per-value card design ate ~200px per
attribute. The Traces rail (~800px tall) showed 1–2 attributes at
a time and scanning required scrolling. Honeycomb-style small-
multiples is the proven pattern for "what stands out?" — the
human eye picks up asymmetric shapes in a chart grid much faster
than it parses rows of numbers.

The new SpotlightPanel renders one compact cell per attribute:
attr-name + score header on top of a mini-histogram drawn in pure
SVG. Each value contributes a pair of vertical bars — SEL accent
+ BASE muted gray. Click an attribute's header to open the per-
value detail list inline with the same click-to-filter buttons
the old design had.

Same data, same engine (computeSpotlight) — purely a presentation
change. SpotlightSection (Errors, Service Detail) inherits the
new look automatically since it composes SpotlightPanel.

A legend below the grid disambiguates the SEL/BASE color mapping.

Density: ~5–6 attributes visible at once instead of 1–2. Service
Detail's http.status_code chart in the captured shot shows the
ideal case — one tall accent bar on the selection-dominant value,
one tall gray bar on a completely different baseline-dominant
value. The asymmetry IS the signal.

New component: src/components/SpotlightHistogram.tsx — pure SVG,
no chart library. Normalized to each attribute's max share so the
chart fills its vertical space.

Validated on staging with paymentFailure 50% scenario active.
Pre-merge: tsc clean, lint 0 errors, 101/101 unit tests.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coccyx coccyx merged commit 630356b into master May 29, 2026
3 checks passed
@coccyx coccyx deleted the feat/spotlight-mini-histograms branch May 29, 2026 16:56
coccyx added a commit that referenced this pull request May 29, 2026
Faceted trace search + Spotlight + Settings page reorganization.

- Faceted-nav data layer + UI primitives (#46, #47)
- Search-page integration with Spotlight rail (#48, #49)
- Spotlight on Errors page + Service Detail (#50, #51, #53)
- Small-multiples / readable-card / rate-bar Spotlight redesigns
  driven by manual validation feedback (#52, #54, #55)
- Settings page reorganization with Setup status card, sticky
  nav, and grouped sections (#56)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant