burhan-syed / troddit

A web client for Reddit with authenticated logins and a variety of browsing options
https://www.troddit.com
GNU Affero General Public License v3.0
551 stars 80 forks source link

Add default comment sort order setting, refactor comment sorter #149

Closed c-oreills closed 1 year ago

c-oreills commented 1 year ago

Partially addresses https://github.com/burhan-syed/troddit/issues/146 by adding a Default Comment Sort Order setting with a dropdown.

Default post sort order is more involved, due to the nested range parameter within the Top sort setting. I've started with comments since they're simpler.

The settings code should be extensible to adding default post sort order in future, though the menu will either need nesting or the range displayed in the main list.

SortSelector.tsx borrows heavily from the existing ThemeSelector.tsx. There is an opportunity to refactor the two to make a generic settings selector. I have not had time to implement this so have left a comment in the new SortSelector.tsx file.

Manual tests run:

Screenshot 2023-01-29 at 23 45 37
vercel[bot] commented 1 year ago

@c-oreills is attempting to deploy a commit to the syDev Team on Vercel.

A member of the Team first needs to authorize it.

burhan-syed commented 1 year ago

Can you move the setting to the comments section? And shorten the setting name from "Default Comment Sort Order" to "Default Comment Sort" to reduce line wrapping on small devices. Thanks for the PR!

c-oreills commented 1 year ago

@burhan-syed yep, done!

vercel[bot] commented 1 year ago

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

Name Status Preview Comments Updated
troddit ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Jan 30, 2023 at 10:44PM (UTC)