techgaun / active-forks

Find active github forks of a repo https://git.io/vSnrC
https://techgaun.github.io/active-forks/index.html
2.28k stars 295 forks source link

Update main.js #52

Closed ttodua closed 3 years ago

ttodua commented 3 years ago

I think the main point of the project (as title says) is to show the Active Forks. However, when we enter the site and type repo-url , it doesn't give the results sorted by the "latest push" (which is the sign of "activeness"). So there should be Last Push instead of Stars. If user wants it to be sorted by stars, then s/he should do it explicitly, as the project is not title "most popular forks", instead the project's first action should be as expected by its name "active" forks.

Would be nice if you defaulted that and to meet expectations of users.

Or, it would be nice if there was "save" (in localstorage or whatever) the preferred action for visitor, so, once I choose by "Last push", then every visit on the site and using the tool, should sort by preferred column.

techgaun commented 3 years ago

@ttodua I think this is a fair point. However, sometimes often the number of stars is also possible indicator that the fork is the most active one in terms of adoption, it may just not have happened to be the last active fork at that very point of time. I like the idea of using a little configuration option that allows user to choose the default fork sorting mechanism and use that. Let me think little bit before I merge this PR. Thanks for your contribution.

ttodua commented 3 years ago

Thanks for input. There might also be a simple js native "localStorage" option, which will ask (only on first enter of site) user , how s/he prefers sorting. Probably around 10 lines of code needed:

let existing = window.localStorage.getItem("chosenSorting");
if (existing=="") {
     let chosen=prompt('Choose your desired sorting ( Last Push, Stars, ...)', ''); 
     window.localStorage.setItem("chosenSorting", chosen);
}
 ...
 ...
const sortColName = window.localStorage.getItem("chosenSorting");

That is Just a phseudo-code to express my idea.