Repository navigation
feat(heroes): Add Turbo vs Normal win rate difference column - #3394
Merged
howardchung merged 1 commit intoOct 3, 2026
Merged
Conversation
howardchung
reviewed
Oct 2, 2026
| return "–"; | ||
| } | ||
| const diff = value * 100; | ||
| return `${diff > 0 ? "+" : ""}${diff.toFixed(1)}`; |
Member
There was a problem hiding this comment.
Shouldn't we show - if it's negative?
There was a problem hiding this comment.
toFixed returns a string and already returns negative values with the minus sign, this just adds the + for positive numbers.
However there's a small possible issue with the implementation above. Now the function first chooses the sign and then rounds the number, which for numbers close to 0 would result with either +0.0 or -0.0 . This could be a bug or a feature; user could read -0.0 as something that's slightly under zero (more informative), but if you want to keep it simpler so that each rounded value has the same representation, you'd want to round first and then choose the sign, like following:
displayFn: (_row: Row, _col: string, value: any) => {
if (!Number.isFinite(value)) {
return "–";
}
const diff = Number((value * 100).toFixed(1)) || 0;
return `${diff > 0 ? "+" : ""}${diff.toFixed(1)}`;
},
howardchung
approved these changes
Oct 3, 2026
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.
Fixes #3393
Adds a sortable "Win % vs Normal" column to the Turbo tab of /heroes. It shows (Turbo W% − Overall W%) in percentage points, with a leading "+" for heroes relatively stronger in Turbo, e.g. Bristleback +6.2, Visage −5.4.
Changes
src/components/Heroes/rankColumns.ts: new column ingenerateTurboTabColumnswith a function-basedsortFncomputingwinRateTurbo − winRatePub(no API change; both rates already exist on each row) and adisplayFnthat renders a signed value (\+for positive) and–when either stat is missing.src/lang/en-US.json,src/lang/ru-RU.json: addhero_turbo_win_rate_difflocalization (PT-BR / zh-CN are Crowdin-synced partial files and fall back to English).Verified
npm run typecheckpassesnpm run buildpasses (vite + tsc)Note: as the issue mentions, the comparison is approximate because public vs turbo stats may not cover the exact same window (see #2826).