fix(watchlist): repos chart bars render at zero due to wrong config field#1275
Open
blinkeye-lcm wants to merge 1 commit into
Open
fix(watchlist): repos chart bars render at zero due to wrong config field#1275blinkeye-lcm wants to merge 1 commit into
blinkeye-lcm wants to merge 1 commit into
Conversation
Contributor
|
Thanks for catching the zero-bar bug, @blinkeye-lcm — the diagnosis is right, but the fix doesn't quite land. const weight = parseFloat(String(repo.config?.emissionShare ?? 0)) || 0;Could you switch to that field and rebase on the latest |
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
The bar chart on the Watchlist repositories tab renders every bar with value
0, contradicting theWeightcolumn shown in the list view directly beneath it. The chart readsrepo.config?.weight, but the API config blob has noweightfield, onlyemissionShare. The access typechecks becauseRepositoryConfigcarries a[key: string]: unknownindex signature, so the value is alwaysundefinedat runtime and every bar collapses to zero.Fixed by reading from the already hoisted
repo.weightfield onWatchedRepoStats, which was added specifically for downstream sort and render code per the type's own comment at src/pages/WatchlistPage.tsx:1020-1030.Reproducer
npm run dev/watchlist?tab=reposRelated Issues
N/A
Type of Change
Screenshots
Before: chart toggled on with two pinned repos, every bar at zero (invisible under log scale).
After: chart toggled on with the same two pinned repos, bars render with values matching the
Weightcolumn in the list view below.Checklist
npm run formatandnpm run lint:fixhave been runnpm run buildpasses