nothingislost/obsidian-hover-editor

Activating the plugin will result in two preview pages.

zhl111 opened this issue · 12 comments

pjeby commented

I assume from the picture that you mean there are two setting pages for the built-in Page Preview plugin? I cannot reproduce this in any of my vaults, including a sandbox with only Hover Editor. What version of Obsidian are you using?

v1.2.7

default.mp4
pjeby commented

It doesn't do that for me on 1.2.7 even if I change the language to match. Perhaps it's an interaction with another plugin? Can you reproduce it in a sandbox vault with Hover Editor as the only plugin? If not, then it's some setting or plugin specific to your vault. (You may also want to check the debug console in the vault that's doing this, to see if any error messages appear the first time the duplicate setting page is created.)

I found it:Obsidian Leaflet

pjeby commented

I can't reproduce it even with the Leaflet plugin enabled in the sandbox. But probably one has to have actually used the leaflet plugin within the session. My first guess is that this would somehow be related to third-party Javascript being used by the two plugins; Hover Editor does its best to remove its own Javascript on disable, but not all plugins do. Likewise if Leaflet ties into the page preview plugin in some way, that might be the issue.

I would suggest you work on reproducing this within a sandbox or scratch vault, so that the minimal steps to make it happen can be found. That will make it easier for plugin developers to find out what's going on.

I am very lacking in IT knowledge and I am not sure how to use sandbox and repository. I am very sorry. All I know is that these two plugins can reduce page previews regardless of which one is turned off.

pjeby commented

Use F1, the command palette, or ribbon to open Obsidian's Help function, then choose the option to open the sandbox vault. This will open a fresh Obsidian instance with no plugins or theme in it, you can then install plugins in it or edit the notes in it. The goal is to identify what steps anyone can take to make the problem happen, starting from a new sandbox vault.

Currently, the steps I have tried to make it happen are to open a sandbox vault, install and enable both Hover Editor and Leaflet, and then turn Hover Editor on and off. This does not produce the problem you describe, so there must be other steps required to make the problem happen. Without steps that allow someone to make the problem happen from scratch, it would be very hard for me or the Leaflet developer to have any idea why the problem is happening for you or how to fix it.

There is an issue where when I disable one of the plugins and one of the "page previews" disappears, and when I reopen the plugin, the extra "page preview" does not immediately reappear. Usually, I have to restart OB to restore the phenomenon of two "page previews". I installed the plugins in a sandbox, and the situation that may occur is that I won't be able to reproduce this problem without restarting, but if I restart the sandbox, everything I installed will disappear. How can this be resolved?

pjeby commented

Create a new empty vault instead of the sandbox, then. You can delete it once the problem is resolved. The main purpose of the sandbox is just to be a convenient temporary vault with known contents, but if you start from an empty vault and make note of all your steps then it's possible in principle for someone else to match those steps.

pjeby commented

Ok, I've identified the issue. Both hover editor and leaflet turn the page preview plugin off and on again to get it to pick up their changes. But recently the page preview plugin has changed such that it doesn't immediately add its settings tab or set up event subscriptions; it schedules it to happen a short while after. So at startup, when both hover editor and leaflet do this, Obsidian ends up scheduling the addition twice.

Fixing this is going to be complicated. A workaround I would suggest trying is to deactivate all your plugins, then activate the leaflet plugin, and then all your other plugins except Hover Editor, and finally activate Hover Editor. This will rearrange your plugin list so that other plugins will load between the two, giving Leaflet's on-off cycle time to finish before Hover Editor's one starts. I don't know if that will actually fix the problem or not, but you can give it a try until I have something figured out.

Thanks for your patience and efforts.

Your suggested solution doesn't seem to be working. This issue isn't a big deal, but it's just a bit strange and has caused you some trouble.

Thanks for your patience and efforts.too.