reddit / devvit

Reddit for Developers
https://developers.reddit.com
BSD 3-Clause "New" or "Revised" License
59 stars 13 forks source link

Menu Items: add a flexible way of controlling menu item visibility #72

Open fsvreddit opened 3 months ago

fsvreddit commented 3 months ago

Right now, the only options for menu item visibility is via forUserType and the options are relatively limiting.

I would like the ability to write code that returns a boolean value that would control whether a menu item was visible. This could allow conditional display based on subreddit settings, whether the item is a top level comment or not, or even based on something like user flair (e.g. if you had a "trusted users" concept who could do pseudo-moderation).

I am aware that this could have downsides - if the code in the function wasn't extremely fast it could degrade the user experience.