Skip to content

allow sorting results table by solve attempt columns - #308

Open
Victus0660 wants to merge 2 commits into
thewca:mainfrom
Victus0660:sort-results-by-attempt
Open

allow sorting results table by solve attempt columns#308
Victus0660 wants to merge 2 commits into
thewca:mainfrom
Victus0660:sort-results-by-attempt

Conversation

@Victus0660

Copy link
Copy Markdown
Contributor

Motivation

Currently, WCA Live displays round results strictly by official ranking. However, in events like FMC (3x3x3 Fewest Moves), competitors who DNF their overall mean often have impressive single attempts that get buried in the list. Allowing users to sort by individual solve attempt columns makes it easy to see the best scores for each attempt and analyze performance per solve.

Summary of Changes

  • Client-side sorting logic: Added sortResultsByColumn() in client/src/lib/result.js to sort by attempt index or stat column while properly prioritizing valid attempts over incomplete (DNF/DNS/skipped) entries.
  • Header interaction: Integrated Material UI <TableSortLabel> into attempt headers (1, 2, 3, etc.) and stat headers (Best, Average/Mean) in RoundResultsTable.jsx.
  • State management: Added sort state in RoundResults.jsx with a 3-step click cycle (Ascending -> Descending -> Reset to official server order).
  • Preserved official ranking: Kept official ranking numbers in the # column so users can easily reference official placements while sorting.
  • Unit tests: Added test suite covering sortResultsByColumn() in client/src/lib/tests/result.test.js.

Verification

  • Tested with FMC and standard timed events.
  • Confirmed valid solves sort properly while DNFs stay at the bottom in both ascending and descending modes.
  • Verified clearing sort resets the view back to default server rankings.

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.

1 participant