brown-puzzle-hq / bph-site

1 stars 0 forks source link

Make hint/team tables sortable #137

Closed brian-xu closed 1 week ago

brian-xu commented 2 weeks ago

Columns are sortable alphabetically/chronologically by default. Hint table is sortable by claimed/unclaimed.

vercel[bot] commented 2 weeks ago

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

Name Status Preview Comments Updated (UTC)
bph-site ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 19, 2024 4:30am
alex-j-wang commented 2 weeks ago

Nice! I think we might want a slightly different "Claimed By" sort order though, something like

  1. Claimed by the user
  2. Unclaimed
  3. Claimed by somebody else (but unanswered)
  4. Answered by the user (should have a refund button, although we may want to rethink this to prevent accidental refunds)
  5. Answered by somebody else (maybe hide these?)

Would also be nice to default to sorting by the "Claimed By" column and show dropdown arrows while sorting, similar to Wikipedia.

qiaochloe commented 2 weeks ago

Since we recently pushed the refund hints functionality & changed the "Claimed By" column to "status," we might have to make adjustments the sort order here. (+1 on the default sorting too). I also have to reload every time I try to see the hints page—this might be a separate bug.

After that, this PR should be good to go.

qiaochloe commented 1 week ago

Looks great! I am going to slight adjust the status sort order again. Then LGTM ("let's get this merged").

qiaochloe commented 1 week ago

Oh, the irregularities were because of inconsistent data in my hint database. As a future improvement, we can probably make some sort of state diagram abstraction for HintTable, hint-page/HintStatusBox.tsx, and hint-table/HintStatusBox.tsx.

Let's merge this! @alex-j-wang

qiaochloe commented 1 week ago

Testing Vercel Hobby limitations on this branch, stand by