Releasing MaVoice: A free app to vote on repo issues

2 min read 0 comments Report broken page

First off, some news: I agreed to be this yearā€™s CSS content lead for the Web Almanac! One of the first things to do is to flesh out what statistics we should study to answer the question ā€œWhat is the state of CSS in 2020?ā€. You can see last yearā€™s chapter to get an idea of what kind of statistics could help answer that question.

Of course, my first thought was ā€œWe should involve the community! People might have great ideas of statistics we could study!ā€. But what should we use to vote on ideas and make them rise to the top?

I wanted to use a repo to manage all this, since I like all the conveniences for managing issues. However, there is not much on Github for voting. You can add šŸ‘ reactions, but not sort by them, and voting itself is tedious: you need to open the comment, click on the reaction, then go back to the list of issues, rinse and repeat. Ideally, I wanted something like UserVoiceā„¢ļø, which lets you vote with one click, and sorts proposals by votes.

And then it dawned on me: Iā€™ll just build a Mavo app on top of the repo issues, that displays them as proposals to be voted on and sorts by šŸ‘ reactions, UserVoiceā„¢ļø-style but without the UserVoiceā„¢ļø price tag. šŸ˜Ž In fact, I had started such a Mavo app a couple years ago, and never finished or released it. So, I just dug it up and resurrected it from its ashes! Itā€™s ā€” quite fittingly I think ā€” called MaVoice.

You can set it to any repo via the repo URL parameter, and any label via the labels URL param (defaults to enhancement) to create a customized URL for any repo you want in seconds! For example, hereā€™s the URL for the css-almanac repo, which only displays issues with the label ā€œproposed statā€: https://projects.verou.me/mavoice/?repo=leaverou/css-almanac&labels=proposed%20stat

While this did need some custom JS, unlike other Mavo apps which need none, Iā€™m still pretty happy I could spin up this kind of app with < 100 lines of JS :)

Yes, itā€™s still rough around the edges, and Iā€™m sure you can find many things that could be improved, but it does the job for now, and PRs are always welcome šŸ¤·šŸ½ā€ā™€ļø

The main caveat if you decide to use this for your own repo: Because (to my knowledge) Github API still does not provide a way to sort issues by šŸ‘ reactions, or even reactions in general (in either the v3 REST API, or the GraphQL API), issues are instead requested sorted by comment count, and are sorted by šŸ‘ reactions client-side, right before render. Due to API limitations, this API call can only fetch the top 100 results. This means that if you have more than 100 issues to display (i.e. more than 100 open issues with the given label), it could potentially be inaccurate, especially if you have issues with many reactions and few comments.

Another caveat is that because this is basically reactions on Github issues, there is no limit on how many issues someone can vote on. In theory, if theyā€™re a bad actor (or just overexcited), they can just vote on everything. But I suppose thatā€™s an intrinsic problem with using reactions to vote for things, having a UI for it just reveals the existing issue, it doesnā€™t create it.

Hope you enjoy, and donā€™t forget to vote on which CSS stats we should study!