Skip to content

fix: order upcoming tournaments by start time first#3078

Merged
veloce merged 1 commit into
lichess-org:mainfrom
tom-anders:upcoming-tournament-ordering
Apr 30, 2026
Merged

fix: order upcoming tournaments by start time first#3078
veloce merged 1 commit into
lichess-org:mainfrom
tom-anders:upcoming-tournament-ordering

Conversation

@tom-anders

Copy link
Copy Markdown
Collaborator

Users looking at upcoming tournaments most of the time want to enter one that starts soon, so we should order by start date here.

Also, use
https://pub.dev/documentation/collection/latest/collection/ComparatorExtension/then.html to make the whole comparison chain a bit more elegant

Before:

Screenshot_1777490190

After:

Screenshot_1777490181

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adjusts tournament list sorting so upcoming tournaments prioritize those starting soonest, and refactors the comparator chain for readability.

Changes:

  • Passes a _ViewMode into _TournamentListBody so sorting can differ by tab (completed/ongoing/upcoming).
  • Updates system tournament sorting to order upcoming tournaments by startsAt first, using ComparatorExtension.then.
  • (Unrelated/accidental) Introduces unresolved merge-conflict markers in a widget test file.

Reviewed changes

Copilot reviewed 1 out of 1 changed files in this pull request and generated 4 comments.

File Description
lib/src/view/tournament/tournament_list_screen.dart Adds viewMode and updates sorting logic to put upcoming tournaments with earlier start times first.
test/view/analysis/retro_screen_test.dart Contains unresolved merge-conflict markers and an unused import introduced by the conflict.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/src/view/tournament/tournament_list_screen.dart
Comment thread lib/src/view/tournament/tournament_list_screen.dart
Comment thread lib/src/view/tournament/tournament_list_screen.dart Outdated
Comment thread lib/src/view/tournament/tournament_list_screen.dart
@tom-anders tom-anders marked this pull request as ready for review April 29, 2026 19:26
@tom-anders tom-anders force-pushed the upcoming-tournament-ordering branch from e49c6ff to 320e942 Compare April 29, 2026 19:26

@veloce veloce left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't remember why I sorted them that way in the first place. Sorting them by start date definitely makes sense so I trust you on this. Thanks!

@veloce veloce merged commit 8c94057 into lichess-org:main Apr 30, 2026
1 check passed
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.

3 participants