feat: add average variation for registries and task runners - #133
Merged
Conversation
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>
darcyclarke
approved these changes
Jul 29, 2026
There was a problem hiding this comment.
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-runnersand/registriesindex 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"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add an
averagevariation 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: GeneralizedcalculateAverageVariationData()to accept anoptionsparameter with custom variation names, data sources, and package manager lists. Added"average"to the task execution and registry variation category lists ingetVariationCategories().app/src/hooks/use-chart-data.ts: Calculate task runner average (acrossbuild,build-cache,run) and registry average (acrossregistry-clean,registry-lockfile) using the appropriate data sources and package managers. Store route-specific averages onBenchmarkChartData.app/src/types/chart-data.ts: AddedtaskRunnerAverageData,taskRunnerAveragePerPackageData,registryAverageData, andregistryAveragePerPackageDatafields toBenchmarkChartData.app/src/components/variation/index.tsx: MadeVariationPageroute-aware — when the variation is"average", selects the correct data based on the current route (package-managers,task-runners, orregistries).app/src/routes.tsx: Updated default routes for task runners ("build"→"average") and registries ("registry-clean"→"average").Build
Co-authored-by: Darcy Clarke darcy@vlt.sh