muddler icon indicating copy to clipboard operation
muddler copied to clipboard

How to sort folders?

Open Kebap opened this issue 3 years ago • 15 comments

I didn't find how to acctively influence the order of folders shown in Mudlet.

It seems like they get sorted automatically by muddler? However it's neither alphabetically by name, nor by date of creation. Maybe random? Other sorting still?

For Mudlet with scripts it seems very important to choose actively which is done initially and what order ensues. Please let me know how I can.

Kebap avatar Jun 04 '21 19:06 Kebap

This is a good point and not one I've honestly thought of a good workaround for, except to say that once I figure out associating code with folders it will probably also involve a fix for this.

demonnic avatar Jun 10 '21 14:06 demonnic

Meanwhile, do you know how they are currently sorted?

Kebap avatar Nov 28 '21 09:11 Kebap

Well it seems random to me - and what is worse, it is not consistent either. So when I muddled twice, I got different resulting orders. Am I doing it wrong?

Kebap avatar Nov 29 '21 06:11 Kebap

I'll have to look into it more closely, which is the only reason I didn't answer yesterday. I may be just accepting the order iterated by groovy and need to institute some form of sorting but just haven't had the time to go digging yet.

demonnic avatar Nov 29 '21 20:11 demonnic

Are there any news here?

Kebap avatar Aug 20 '22 23:08 Kebap

I am in fact just accepting the order provided by Groovy, but haven't decided how best to handle enforcing an order. I've made a reminder to look into this tomorrow again and see if I can come up with a good solution. I admit it kind of fell off my radar.

demonnic avatar Aug 21 '22 02:08 demonnic

How does Groovy sort then? Maybe you can influence that? At least having any consistent order would be most welcome.

Kebap avatar Jan 13 '23 09:01 Kebap

From what I can see, Groovy doesn't ensure any particular order. Certainly not one I can ascertain. It would be fairly easy to enforce alphanumeric sorting of the list. Considering doing that while I work out a way to easily set an arbitrary order via file.

demonnic avatar Mar 13 '23 04:03 demonnic

look into this tomorrow again and see if I can come up with a good solution. I admit it kind of fell off my radar.

Any news maybe? 😊 Having an arbitrary order via file would be great!

Kebap avatar Dec 08 '23 11:12 Kebap

I am also interested in this and this would influence me migrating my main GUI. The order of scripts is very important, unless you can give a better way to not have to worry about the order, some programming genius? 🤗

gesslar avatar Jun 21 '24 18:06 gesslar

As a thought, since the json files are arrays, the order of them could be the representation?

gesslar avatar Jun 26 '24 00:06 gesslar

For example, this JSON

[
       {
              "isActive": "yes",
              "isFolder": "no",
              "name": "Main",
              "script": ""
       },
       {
              "isActive": "yes",
              "isFolder": "yes",
              "name": "Utils",
              "script": ""
       },
       {
              "isActive": "yes",
              "isFolder": "no",
              "name": "Number routines",
              "script": ""
       },
       {
              "isActive": "yes",
              "isFolder": "no",
              "name": "String routines",
              "script": ""
       },
       {
              "isActive": "yes",
              "isFolder": "yes",
              "name": "GMCP",
              "script": ""
       },
       {
              "isActive": "yes",
              "isFolder": "no",
              "name": "Connection",
              "script": ""
       },
       {
              "isActive": "yes",
              "isFolder": "no",
              "name": "GUI",
              "script": ""
       },
       {
              "isActive": "yes",
              "isFolder": "yes",
              "name": "Setup",
              "script": ""
       },
       {
              "isActive": "yes",
              "isFolder": "no",
              "name": "Install/Uninstall",
              "script": ""
       }
]

could result in a structure like this image

gesslar avatar Jun 26 '24 00:06 gesslar

For example, this JSON could result in a structure like this

How would that JSON represent a structure like this?

  • Folder
    • Script in folder
  • Script outside folder

Or like that:

  • Folder 1
    • Script in folder 1
    • Folder 2 in folder 1
      • Script in folder 2

Kebap avatar Jun 26 '24 08:06 Kebap

I suppose it couldn't. sigh Oh well, back to the drawing board.

gesslar avatar Jun 26 '24 14:06 gesslar

To pile-on, this is also an issue for me.

mpconley avatar Jun 30 '24 19:06 mpconley