Skip to content

feat(heroes): Add Turbo vs Normal win rate difference column - #3394

Merged
howardchung merged 1 commit into
odota:masterfrom
Axelodo7:feat/heroes-turbo-vs-normal-win-rate
Oct 3, 2026
Merged

howardchung merged 1 commit into
odota:masterfrom
Axelodo7:feat/heroes-turbo-vs-normal-win-rate

Conversation

@Axelodo7

@Axelodo7 Axelodo7 commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

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 in generateTurboTabColumns with a function-based sortFn computing winRateTurbo − winRatePub (no API change; both rates already exist on each row) and a displayFn that renders a signed value (\+ for positive) and – when either stat is missing.
  • src/lang/en-US.json, src/lang/ru-RU.json: add hero_turbo_win_rate_diff localization (PT-BR / zh-CN are Crowdin-synced partial files and fall back to English).

Verified

  • npm run typecheck passes
  • npm run build passes (vite + tsc)
  • Prettier clean on changed files

Note: as the issue mentions, the comparison is approximate because public vs turbo stats may not cover the exact same window (see #2826).

return "–";
}
const diff = value * 100;
return `${diff > 0 ? "+" : ""}${diff.toFixed(1)}`;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Shouldn't we show - if it's negative?

@timoHaario timoHaario Oct 2, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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
howardchung merged commit 3e872e8 into odota:master Oct 3, 2026
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.

[Heroes] Show Turbo vs normal win rate difference on the Turbo tab

3 participants