codidact / qpixel

Q&A-based community knowledge-sharing software
https://codidact.com
GNU Affero General Public License v3.0
375 stars 70 forks source link

On question pages, don't show answer sorting buttons until there are answers #1350

Open cellio opened 1 month ago

cellio commented 1 month ago

meta:290806

The answer sorting buttons (Score, Active, Age) serve no function until there are two or more answers (that the current user can see -- this could include deleted answers). Let's not show the sorting buttons until there's something to sort.

I believe that every action that could lead to a new answer showing up involves a page refresh, so we aren't risking an answer "winking in" while the buttons are gone. Some sites work like that, but as far as I can tell, qpixel doesn't -- you won't see new (or undeleted) answers until you refresh the page, at which point we'd recheck whether to show the buttons.