Skip to content

fix: show correct history chart data for registry/task-runner averages - #135

Merged
darcyclarke merged 1 commit into
mainfrom
darcy/fix-history-chart-average
Jul 29, 2026
Merged

fix: show correct history chart data for registry/task-runner averages#135
darcyclarke merged 1 commit into
mainfrom
darcy/fix-history-chart-average

Conversation

@vltbaudbot

Copy link
Copy Markdown
Contributor

Summary

The Performance Over Time history chart was showing package manager average data on the registry and task-runner average pages. While PR #134 fixed the bar charts by passing isRegistryRoute/isTaskExecutionRoute props, the underlying history data was still using the PM-only synthetic average.

Problem

When visiting /registries/average or /task-runners/average, the history chart looked up historyData.variations["average"] which was always computed from package management variations (clean, cache, lockfile, etc.). This meant the line graph showed PM average performance instead of registry/task-runner average performance.

Changes

app/src/hooks/use-history-data.ts

  • Extracted the synthetic average computation into a reusable computeSyntheticAverage helper
  • Now computes three synthetic average keys:
    • "average" — from PM variations (clean, node_modules, cache, etc.)
    • "registryAverage" — from registry variations (registry-clean, registry-lockfile)
    • "taskRunnerAverage" — from task-runner variations (build, build-cache, run)

app/src/components/history-chart.tsx

  • When on the average variation with isRegistryRoute, looks up "registryAverage" instead of "average"
  • When on the average variation with isTaskExecutionRoute, looks up "taskRunnerAverage" instead of "average"
  • Package manager average page continues to use "average" as before

Testing

The fix ensures each average page's history chart matches its bar chart data source:

  • PM average page → history from PM variations ✅ (unchanged)
  • Registry average page → history from registry variations ✅ (fixed)
  • Task-runner average page → history from task-runner variations ✅ (fixed)

Co-authored-by: Darcy Clarke darcy@darcyclarke.me

The Performance Over Time history chart was showing package manager average
data on the registry and task-runner average pages. While PR #134 fixed the
bar charts by passing isRegistryRoute/isTaskExecutionRoute props, the
underlying history data was still using the PM-only synthetic average.

Changes:
- useHistoryData: Extract the average computation into a reusable helper and
  compute three synthetic averages: 'average' (PM variations),
  'registryAverage' (registry-clean, registry-lockfile), and
  'taskRunnerAverage' (build, build-cache, run)
- HistoryChart: When on the average variation, look up the route-specific
  synthetic key (registryAverage or taskRunnerAverage) instead of always
  using the PM average

Co-authored-by: Darcy Clarke <darcy@darcyclarke.me>
@darcyclarke
darcyclarke merged commit fc582de into main Jul 29, 2026
9 checks passed
@darcyclarke
darcyclarke deleted the darcy/fix-history-chart-average branch July 29, 2026 07:54
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