alangrainger / obsidian-lazy-plugins

Load plugins with a delay on Obsidian startup, so that you can get your app startup down into the sub-second loading time.
MIT License
230 stars 1 forks source link

[Feature Request] Allow to order plugin in each dalay type #4

Open l2eused opened 3 months ago

l2eused commented 3 months ago

I have one problem with commander and unicode search plugins in android phone. The problem is when I set my 2 plugins above in same delay (long delay for example), my unicode search command icon can't load in toolbar (I use commander to custom my unicode search command for mobile toolbar) but for advanced table (I also use as command in mobile toolbar too) it doesn't. So I guess it because order of loading is alphabetically order so when commander plugin is loaded, the unicode search command is not yet load and cause error command (question icon in mobile toolbar). So I want to request this feature to fix my problem here.

TLDR; order loading to fix some plugins that need to run before/after others plugin.

my idea:

for example

**plugin list:**
- AA
- BB
- CC
- DD
- FF
- EE

**set**
AA as long delay
BB as long
CC as Instant
DD as long
FF as short
EE as long

**normal loading order**
CC FF AA BB DD EE

**want to set**
DD, AA as last
EE as first

so in order list should be

> set this plugin to first in order (sort by order in this box)
> `EE`

> set this plugin to last in order (sort by order in this box)
> `DD`
> `AA`

**in this case, order is**
CC FF EE BB DD AA

as above example, just add new 2 insert box that is order as first and order as last

the priority would be:

  1. delay set (instant, short, long)
  2. first order box
  3. normal order (alphabet)
  4. last order

and run as

  1. instant first
  2. instant normal
  3. instant last
  4. short first
  5. short normal . . .

This isn't main setup for user, just use it only for few plugins that need to be order. (Should be in advanced settings)

alangrainger commented 3 months ago

Changed my mind - this can be its own issue.

This is a duplicate of #2 , so I will close this one and keep discussion over there. I realise you're talking about load order rather than sidebar order - but it's the same thing. The order that plugins load will dictate the sidebar icon order.

alangrainger commented 3 months ago

I plan to add this in the next release or so, if I can find out a very lean way to add UI dragging/reordering.

l2eused commented 3 months ago

@alangrainger this is other idea (taken from Linter plugin) can using this way too

edited: so it can be add something like button to copy plugin name to help user to write correct name too.

Screenshot_2024-08-30-18-21-59-216_md.obsidian-edit.jpg

alangrainger commented 3 months ago

Thanks for the suggestion :+1: A bit awkward UX for the user, but at least it's a workable option if nothing else presents itself.

edit: Actually, it possible is a good UX, because there are likely only a couple of plugins that require a specific order, so this might be easier than being able to re-order all plugins.

I will think about it.

The other option is adding a "Depends on" dropdown where you could select another plugin which needs to load first.

l2eused commented 3 months ago

The other option is adding a \"Depends on\" dropdown where you could select another plugin which needs to load first.

yeah, if this one will impliment. Please add ui to show which plugin is adding Depends on. May help user who has many plugin to show which plugin is now using in one page, no need to check each plugin if them want to change settings. (sorry for my language skill)