Skip to content
This repository was archived by the owner on Sep 12, 2024. It is now read-only.
This repository was archived by the owner on Sep 12, 2024. It is now read-only.

[FEATURE] Randomize the order of the issues #400

@adityaraute

Description

@adityaraute
Member

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.

Activity

Cahllagerfeld

Cahllagerfeld commented on Dec 29, 2023

@Cahllagerfeld
Member

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

adityaraute

adityaraute commented on Dec 30, 2023

@adityaraute
MemberAuthor

What about ordering them on specific criteria? Does the Github API allow for this?

Bashamega

Bashamega commented on Jan 6, 2024

@Bashamega
Member

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:

  1. A-Z
  2. Z-A
  3. By Stars
  4. Forks
  5. Updated
    If you like this idea please assign me
adityaraute

adityaraute commented on Jan 6, 2024

@adityaraute
MemberAuthor

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

Bashamega

Bashamega commented on Jan 7, 2024

@Bashamega
Member

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

Cahllagerfeld

Cahllagerfeld commented on Jan 7, 2024

@Cahllagerfeld
Member

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?

Bashamega

Bashamega commented on Jan 7, 2024

@Bashamega
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @Cahllagerfeld@adityaraute@Bashamega

        Issue actions

          [FEATURE] Randomize the order of the issues · Issue #400 · EddieHubCommunity/good-first-issue-finder