Skip to content

feat: add average variation for registries and task runners - #133

Merged
darcyclarke merged 1 commit into
mainfrom
darcy/add-averages
Jul 29, 2026
Merged

feat: add average variation for registries and task runners#133
darcyclarke merged 1 commit into
mainfrom
darcy/add-averages

Conversation

@vltbaudbot

Copy link
Copy Markdown
Contributor

Summary

Add an average variation to the task runners and registries sections, matching the existing package managers average behavior. Each section now defaults to showing the average across its variations as the landing view.

Changes

  • app/src/lib/utils.ts: Generalized calculateAverageVariationData() to accept an options parameter with custom variation names, data sources, and package manager lists. Added "average" to the task execution and registry variation category lists in getVariationCategories().

  • app/src/hooks/use-chart-data.ts: Calculate task runner average (across build, build-cache, run) and registry average (across registry-clean, registry-lockfile) using the appropriate data sources and package managers. Store route-specific averages on BenchmarkChartData.

  • app/src/types/chart-data.ts: Added taskRunnerAverageData, taskRunnerAveragePerPackageData, registryAverageData, and registryAveragePerPackageData fields to BenchmarkChartData.

  • app/src/components/variation/index.tsx: Made VariationPage route-aware — when the variation is "average", selects the correct data based on the current route (package-managers, task-runners, or registries).

  • app/src/routes.tsx: Updated default routes for task runners ("build""average") and registries ("registry-clean""average").

Build

✅ tsc -b passes
✅ vite build passes
✅ eslint passes

Co-authored-by: Darcy Clarke darcy@vlt.sh

Add an 'average' variation to the task runners and registries sections,
matching the existing package managers average behavior:

- Generalize calculateAverageVariationData() to accept custom variation
  names, data sources, and package manager lists via an options parameter
- Calculate task runner average across build, build-cache, and run variations
- Calculate registry average across registry-clean and registry-lockfile
  variations using the registry-specific data sources and package managers
- Store route-specific averages on BenchmarkChartData (taskRunnerAverageData,
  registryAverageData, and their per-package counterparts)
- Make VariationPage route-aware: when variation is 'average', select the
  correct data based on the current route (package-managers, task-runners,
  or registries)
- Add 'average' to task execution and registry variation category lists in
  getVariationCategories() so it appears in the UI navigation
- Update default routes: task-runners and registries now default to 'average'
  instead of 'build' and 'registry-clean' respectively

Co-authored-by: Darcy Clarke <darcy@vlt.sh>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds an "average" variation for task runners and registries, aligning them with the existing package-manager average behavior and updating default navigation so those sections land on the average view.

Changes:

  • Generalizes average calculation to support custom variation sets/data sources, and exposes "average" in the task-runner and registry variation category lists.
  • Computes and stores route-specific averages (task runners + registries) on BenchmarkChartData, and updates the variation page to select the correct average dataset by route.
  • Updates routing defaults so /task-runners and /registries index routes redirect to /average.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
app/src/types/chart-data.ts Adds fields on BenchmarkChartData to store task-runner and registry average datasets.
app/src/routes.tsx Changes default index redirects for task runners and registries to land on average.
app/src/lib/utils.ts Extends average computation to be configurable and includes average in variation categories for task runners/registries.
app/src/hooks/use-chart-data.ts Computes and stores task-runner and registry averages using appropriate variation sets and sources.
app/src/components/variation/index.tsx Makes the “average” variation route-aware and selects the correct average dataset for the active route.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +161 to +167
// For "average", determine from the route context
const isTaskExecution =
isTaskExecutionVariation(variation as string) ||
(isAverage && baseRoute === "task-runners");
const isRegistry =
isRegistryVariation(variation as string) ||
(isAverage && baseRoute === "registries");
@darcyclarke
darcyclarke merged commit 324d6de into main Jul 29, 2026
10 checks passed
@darcyclarke
darcyclarke deleted the darcy/add-averages branch July 29, 2026 04: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.

4 participants