Skip to content

Fix numeric sorting in dashboard standings - #1825

Open
bensynapse wants to merge 1 commit into
evroon:masterfrom
bensynapse:fix/standings-numeric-points
Open

Fix numeric sorting in dashboard standings#1825
bensynapse wants to merge 1 commit into
evroon:masterfrom
bensynapse:fix/standings-numeric-points

Conversation

@bensynapse

Copy link
Copy Markdown

I maintain Live Tennis API.

Fixes #1294.

The API returns points as decimal strings, and both existing comparisons sorted them as text, placing 9 above 12. Use one numeric comparison for the Points/Elo columns, preserve the order of equal scores, and sort a copy before applying the row limit. The Name header now compares team.name instead of a missing field on the standings input.

Validation:

  • cd frontend && pnpm test passes (TypeScript and formatting).
  • docker build --file frontend/Dockerfile frontend passes. The build emits Vite configuration/plugin and bundle-size warnings.
  • 25 browser checks pass against the actual dashboard in both the Vite development server and the Docker client, using mocked tournament/stage API responses. They cover descending/ascending points, negative and decimal values, equal scores, both Swiss Elo headers, team names, the 100-row limit, and empty standings. The same checks produced 17 sorting failures before the fix. No browser page errors occurred.

To reproduce the reported case, load a round-robin stage with point totals 9, 12, 11, and 10: the initial order is now 12, 11, 10, 9, and clicking Points reverses it numerically. Backend/database integration was not exercised.

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.

Round Robin Points Sorting by First Digit Instead of Full Number

1 participant