ucsb-cs156-f24 / proj-happycows-f24-10

0 stars 0 forks source link

BUG: Fix Leaderboard Sort by Total Wealth #7

Open github-actions[bot] opened 21 hours ago

github-actions[bot] commented 21 hours ago

Have you updated the title?

Summary

We have noticed that the leaderboard incorrectly ranks Farmers when sorting by total wealth, under certain conditions.

Expected Behavior

Clicking on the "Total Wealth" table column on the leaderboard should sort the Farmers from least to greatest wealth, and clicking it again should sort from greatest to least wealth.

Current / Observed Behavior

When a farmer has between $0 and $1000 (non inclusive), we notice that they are inaccurately sorted on the leaderboard.

Screenshot 2024-11-14 at 5 23 57 PM

Sorting from greatest to least should have put the first 2 farmers at the very bottom of the list, instead it puts them at the top.

We see this when sorting from least to greatest:

Screenshot 2024-11-14 at 5 24 17 PM

The farmers with $100 and $199 should have been ranked at the top of the leaderboard for having the least wealth, but they do not appear until the very bottom

Steps to Reproduce

  1. https://happycows.dokku-00.cs.ucsb.edu/
  2. Navigate to the Testing Commons
  3. Navigate to the leaderboard
  4. Sort by Total Wealth

Discussion

The issue is probably one related to sorting "strings" vs. sorting "numbers", and will involve having to understand internal details of the OurTable component.

Recognize that the OurTable component is used in many places in the application, so you need a solution that doesn't involve putting specific special case code into that component.