Skip to content

Conversation

@tariknz
Copy link
Owner

@tariknz tariknz commented Jul 16, 2025

Previously the standings would check if the player is actually there to apply logic to display the players around them. But in qually and practice if the player hasn't set a time then only the top 3 will appear for the player's class.

This change now should show the top 10 for the player's class and top 3 for other classes as normal.

Copilot AI review requested due to automatic review settings July 16, 2025 04:12
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a bug in the standings display where only the top 3 drivers would show for the player's class when the player hasn't set a time in qualifying or practice sessions. The fix ensures that when the player is missing from standings, the top 10 drivers from their class are still displayed while maintaining the top 3 for other classes.

  • Modified sliceRelevantDrivers to use driver class instead of player presence for filtering logic
  • Updated function signature to accept driver class parameter and configurable number of non-class drivers
  • Added comprehensive test coverage for the new behavior when player is missing from standings

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
useDriverStandings.tsx Extracts driver class and passes it to sliceRelevantDrivers function
createStandings.ts Updates sliceRelevantDrivers logic to use driver class instead of player presence, removes unused createStandings function
createStandings.spec.ts Updates tests and adds new test case for missing player scenario, includes local createStandings function for testing
Comments suppressed due to low confidence (1)

@tariknz tariknz merged commit e1183a9 into main Jul 17, 2025
1 check passed
@tariknz tariknz deleted the fix/standings-slicing branch July 17, 2025 03:03
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.

2 participants