sergiokas/Extensity

[feature request] being able to sort the item on the menu

Closed this issue · 3 comments

Currently, the items are alphabetically sorted. I need to put on the top of the list certain extension I often enable/disable (to avoid searching for them each time). It could look like this:

image

Or this

Thanks!

ps: I'm sorry to add another feature request to the (very long!) list, you are the victim of your success!

Yanno, this would be pretty simple if you were to refine the requirements.

See, the workload here (notwithstanding the stupid amount of QA and testing across multiple platforms and versions of chrome and operating systems) is attempting to make the whole list two-way sortable.

This would require an additional serialization routine, additional per-extension storage (or at the very least, an obnoxious numeric parser), and worst of all, a whole new set of UI functionality (especially since you seem to be requesting drag-and-drop functionality).

The whole set of requirements here could be satisfied with a very straightforward ♡/♥︎ Icon system, either by placing an empty heart next to every extension in the list from the dropdown, or by adding one to the profiles screen (or hell, even hard-coding a "favorites" profile IN the profiles screen, enabled/disabled by a checkbox in the options screen). Favorites would be rendered above non-favorites, below Actives, in simple alphabetical order.

You've already got the code to sort. You have the code to sort Active to the top. This would be adding a single additional flag, the storage of which could be accomplished with a single, delimited string:

|cfhdojbkjhnklbpkdaibdccddilifddb|epcnnfbjfcgphgdmggkamkmgojdagdnn|cjpalhdlnbpafiamejdnhcphjbkeiagm|

Note the presence of pipe at SOL and EOL: this is so we can wrap the target extension ID in pipes |cjpalhdlnbpafiamejdnhcphjbkeiagm| for easy/fast searching via indexOf, and modification via replace (JS pseudo code here):

// Initial declarative (var, to encourage hoisting) begins with the lead pipe. 
    var favList = '|';
// On 'Add to Favs' we just tack on to the end (along with another pipe)
    favList += e.target.extId + '|';
// On 'Remove from Favs' we replace '|extension_id|' with '|'. Wrapping them this way precludes accidental substring matches, on the (very) remote chance there's overlap
   favList = favList.replace('|' + e.target.extId + '|', '|');

   updateExtensionLocalStore(); // Again: pseudo-code here. I'm assuming you have a routine for this.

Outputting them would be so simple as taking your current, sorted list, splitting the favList string, iterating the resultant array, pulling those items from the list in the same order (or hell, into an array and .sorting them again; it's lightweight).

But then, you could always just do what I do:

image

Set up an "Always On" profile (containing all the must-havs, regardless of the active profile), and START WITH THAT whenever drafting a profile. It should also be pointed out that profile selection is ADDITIVE. Meaning you can have your:

"Always On" (base set)

Add to it your current activity set:

  • "Development" (activity set Α)
  • "High Security" (activity set Β)
  • "Master" (activity set Γ)

Then tack on your extended need set (if applicable)

  • "Browse" (specialty set α)
  • "GitHub" (specialty set β)
  • "Shopping" (specialty set γ)
  • "Torrent" (specialty set δ)
  • "Video" (specialty set ε)

Use a certain combination often? So do I. Hence "Master+Browse"

You may also note the presence of a _Disable All Profile. I find this vital; I have 200+ extensions installed, and the whole "flip the on/off switch" approach will often lag my Mac Pro so bad I can go make a sandwich. That's easier. Prepending the "_" to the name ensures it sorts to the bottom.

As NerdyDeedsLLC said, there is a (2 actually) much better option that are inbuilt: profile (I just need to select the profile I need to turn ON/OFF the extensions), and the text field (at the top, I missed it) to search for a specific extension.
So it's perfect (and even more).
Thanks a lot!