f1-dash icon indicating copy to clipboard operation
f1-dash copied to clipboard

feat(leaderboard): Add sorting functionality to the leaderboard

Open emilioh93 opened this issue 8 months ago • 8 comments

Description

This pull request adds sorting functionality to the leaderboard component. Users can now sort the drivers by various criteria, including:

  • Position
  • Best Lap
  • Last Lap
  • Pit Status
  • Position Change
  • Sector 1, 2, and 3 times
  • Tyre Age

Changes Made

  • Created a new sorting store to manage sorting preferences.
  • Implemented a sorting utility function to handle different sorting criteria.
  • Updated the LeaderBoard component to include a sorting dropdown above the table.
  • Improved the styling of the sorting selector for better visibility.

Please review the changes and let me know if any adjustments are needed.

image

emilioh93 avatar Apr 16 '25 01:04 emilioh93

@emilioh93 is attempting to deploy a commit to the f1-dash Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Apr 16 '25 01:04 vercel[bot]

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
f1-dash ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 25, 2025 11:48am

vercel[bot] avatar Apr 17 '25 20:04 vercel[bot]

@emilioh93 thanks! 2 things:

  1. use the custom select component in the repo. (Its not fully done yet and has weird transparency, which I fixed here, so these changes would need to be ported)

  2. I don't think this design is optimal, it needs more thought and integration...

slowlydev avatar Apr 17 '25 20:04 slowlydev

@emilioh93 thanks! 2 things:

  1. use the custom select component in the repo. (Its not fully done yet and has weird transparency, which I fixed here, so these changes would need to be ported)
  2. I don't think this design is optimal, it needs more thought and integration...

Thanks for the feedback, very clear!

  • Regarding the custom select, do you think we should wait for those changes to be fully integrated before moving forward with this PR, or would you prefer that I incorporate them from now on carrying the corrections you mentioned?
  • And about the design, totally agree that it can be better thought out. do you think it would make sense to close this PR and pick up again when there is a clearer direction, or would you prefer we keep it open while we adjust?

I'm happy to make the changes needed, I just want to make sure the timing and direction is right 😊.

emilioh93 avatar Apr 17 '25 20:04 emilioh93

What about clicking on the column headers sorts according to that column in ascending, click again and its descending.

mathew2103 avatar Apr 19 '25 16:04 mathew2103

What about clicking on the column headers sorts according to that column in ascending, click again and its descending.

yeah that could go in the right direction. maybe we could also hide the dropdown behind a filter or sort icon. which o'clock shows the input or the options right away

slowlydev avatar Apr 20 '25 09:04 slowlydev

based on the last comments, I applied a few changes

emilioh93 avatar Apr 23 '25 22:04 emilioh93

@slowlydev it's been a long time since this PR, maybe it's time to close it?

emilioh93 avatar Sep 05 '25 11:09 emilioh93