Skip to content

Hide charts with no recent data by default in group view#8

Merged
myrrc merged 1 commit into
developfrom
claude/hide-empty-benchmark-charts-is05e2
Jul 9, 2026
Merged

Hide charts with no recent data by default in group view#8
myrrc merged 1 commit into
developfrom
claude/hide-empty-benchmark-charts-is05e2

Conversation

@connortsui20

Copy link
Copy Markdown
Member

Summary

Adds functionality to automatically hide charts that have no data in the latest 100 commits (the default window) when viewing a group, with a toggle in the group toolbar to reveal them. This reduces visual clutter on the landing page while keeping all data accessible.

Key Changes

  • Empty chart detection: Introduced chartHasRecentData() utility that inspects only the trailing window of a chart payload to determine if it contains any real data points. Works consistently across bounded ?n=100 payloads and full history responses.

  • Store enhancements: Extended GroupSnapshot with:

    • emptyCharts: array of chart slugs classified as having no recent data
    • showEmptyCharts: toggle state for revealing hidden empty charts
    • New functions: noteChartRecentData(), setShowEmptyCharts(), chartIsHiddenAsEmpty()
  • Classification on bundle fetch: Charts are classified as empty immediately when the group bundle is fetched in ensureGroupBundle(), allowing cards to hide without waiting for individual chart hydration or intersection observation.

  • Chart component integration:

    • Added hiddenAsEmpty() check to prevent constructing Chart.js into hidden (display:none) canvases
    • Calls noteChartRecentData() when payloads arrive (both default window and full history)
    • Re-enters maybeConstruct() when the empty-charts toggle reveals a card
  • UI additions:

    • New "Show/Hide empty charts" toggle button in GroupToolbar, positioned left of the Reset button
    • Toggle only appears once at least one empty chart is classified
    • Label singularizes based on count and changes to "Hide" when revealed
    • CSS rule explicitly hides cards with [hidden] attribute via display: none
  • Reset behavior: resetGroup() now also resets showEmptyCharts to false (re-hiding revealed empty charts), while preserving the classification data itself.

Implementation Details

  • Classification happens eagerly at bundle fetch time, before any chart intersection observation, ensuring cards hide immediately without layout thrashing
  • The chartHasRecentData() function inspects only the trailing windowSize slots, making it produce identical verdicts whether called on a bounded ?n=100 payload or the tail of a full history
  • Empty chart state is data-derived (like knownSeries), so it persists across group resets but is cleared when the payload cache is reset
  • Comprehensive test coverage added for store mutations, UI rendering, and the full integration flow

https://claude.ai/code/session_01RvL7reZ8o1qo3NGtXXNuwP

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

Vercel preview for d2de383eb688f5b1ee3aeff6060f266e8ca63a2f: https://benchmarks-website-lncc1iakh-vortex-data.vercel.app

Several groups (appian, clickbench, polarsignals/100000,
statpopgen/100000, tpcds, tpch sf=10/100, some wide-table charts)
render compression-size cards as bare axes because their fact rows all
predate the default latest-100 commit window. Hide those cards by
default and add a per-group toolbar toggle (left of "Reset group") that
reveals them.

- chart-format: `chartHasRecentData` inspects only the trailing
  latest-100 slots of each series, so the bounded `?n=100` payload, its
  normalized form, and a full `?n=all` history all classify a chart
  identically.
- chart-store: `GroupSnapshot` gains `emptyCharts` (data-derived, kept
  across Reset like `knownSeries`) and `showEmptyCharts` (user toggle,
  Reset returns it to hidden). The group-bundle prime classifies every
  chart in the group, including cards that never intersect the
  viewport; the per-chart `?n=100` and full-history paths classify as
  fallbacks.
- Chart island: the card gets the `hidden` attribute while classified
  empty and not revealed; `maybeConstruct` bails on hidden cards (a
  display:none canvas would build a zero-size chart) and a reveal
  effect re-enters construction once the un-hidden DOM is committed.
- GroupToolbar: a "Show/Hide N empty charts" button renders once the
  group has classified at least one empty chart, with a title
  explaining the latest-100 rule.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RvL7reZ8o1qo3NGtXXNuwP
Signed-off-by: Claude <noreply@anthropic.com>
@connortsui20
connortsui20 force-pushed the claude/hide-empty-benchmark-charts-is05e2 branch from f6f19d5 to 86692bc Compare July 9, 2026 17:00
@myrrc
myrrc merged commit 3f0084a into develop Jul 9, 2026
4 checks passed
@myrrc
myrrc deleted the claude/hide-empty-benchmark-charts-is05e2 branch July 9, 2026 17:05
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.

3 participants