Open adityaraute opened 10 months ago
The idea in general is good, I'm a bit worried that we can implement that, because the data is retrieved from the github api, and paginated, so even when randomizing them it will only be the ones that are returned per page by github
What about ordering them on specific criteria? Does the Github API allow for this?
Hello:) I would like to work on this issue. I can make like a dropdown and from there you can choose how to sort and these will be the options:
I like this if we can implement an ascending and descending order for all criteria. Every contributor may be looking for something different. But again, not sure if this fits with the API
I like this if we can implement an ascending and descending order for all criteria. Every contributor may be looking for something different. But again, not sure if this fits with the API
We can use the built sort feature or create our own sorting function. This is the documentation here If you want you can assign me and I will start working on it
I think adding the filter function isn't the same thing as a random order (what this issue is about). The filter will also return a fixed set of issues, and not a random collection of them. Or am I missing something?
I think adding the filter function isn't the same thing as a random order (what this issue is about). The filter will also return a fixed set of issues, and not a random collection of them. Or am I missing something?
Your correct, I thought he wanted to order in deferent orders. If he wants to randomize, we can randomize it using svelte. This is an example of how we can randomize it:
function shuffle<T>(array: T[]): T[] {
let currentIndex = array.length, randomIndex;
// While there remain elements to shuffle.
while (currentIndex != 0) {
// Pick a remaining element.
randomIndex = Math.floor(Math.random() * currentIndex);
currentIndex--;
// And swap it with the current element.
[array[currentIndex], array[randomIndex]] = [
array[randomIndex], array[currentIndex]];
}
return array;
};
And then call it somewhere in the api
Description
Currently we are only seeing issues ordered by their date/time of creation. Introducing some randomness here would serve as a great way to ensure all projects get visibility.
Additional information
We could perhaps introduce several criteria for ordering like oldest, newest, most stars on repo, latest activity, most comments, etc.