pjeby / pane-relief

Obsidian plugin for per-pane history, pane movement/navigation hotkeys, and more
232 stars 6 forks source link

Linked panes do not persist after closing and restarting #2

Closed foreveryone1 closed 3 years ago

foreveryone1 commented 3 years ago

Pane relief version: 0.0.3 Obsidian version: 0.11.9 Obsidian installer version: 0.11.9

Steps to reproduce issue: Open hamburger menu, select "Link with Pane" Link with another pane Close Obsidian Start Obsidian The link between panes is gone. When pane-relief is disabled, this issue does not occur.

pjeby commented 3 years ago

I can't seem to reproduce this locally, either by switching workspaces or restarting Obsidian. Does it happen if you switch workspaces too?

foreveryone1 commented 3 years ago

This occurs in a new vault with only pane-relief installed both on re-opening and when switching workspaces.

pjeby commented 3 years ago

That is bizarre. I created a new vault, activated pane-relief, did the same thing as you in the first video (w/Untitled and File 1) and the links do not go away. Still there after multiple opens and closes of the vault. I can't figure out what could be different between our machines, unless it's the version of installer (Electron) in use.

foreveryone1 commented 3 years ago

I'm on windows 10, if that clarifies anything.

I'm getting much more utility from pane-relief than I'm losing from this minor inconvenience, so I suppose I'll just have to tolerate it.

Here's hoping a newer release with a different electron version resolves this issue.

Thanks for your time!

pjeby commented 3 years ago

Even so, I can't imagine how it would affect it, unless it's something to do with saving the files or the OS. Also, unless you originally installed Obsidian from an 0.8 version or earlier, you are likely the person with the newer Electron version than me.

pjeby commented 3 years ago

Here's an idea. Suppose you turn off pane-relief, and save a copy of the 'workspace' file from the vault's .obsidian directory after linking and exiting. Then do it again with pane-relief on, and compare the files. There will probably be different dates in there, but if anything else is different it will at least tell us if the problem is with saving or with loading.

A correct workspaces.json or workspace file should have a "group" value on each leaf that is linked with another. If the group ID isn't there in the pane-relief-active version, then it's probably something weird with saving. If it is there, then it's probably an issue with loading.

foreveryone1 commented 3 years ago

When running a comparison between the workspace file with pane-relief enabled and disabled, the main difference is the pane-relief history which has been inserted. The group-id is different, but it still matches internally with another pane.

The same applies to the .json file.

When pane-relief is enabled when I save a workspace, the link is not preserved after loading, despite it being present in the file. However, the link is still intact when pane-relief is turned off and that same workspace is loaded, meaning pane-relief doesn't change the writing of the link.

pjeby commented 3 years ago

Does 0.0.2 have the problem also? Alternately, can you check and see if commenting out these lines in main.js fixes the problem?:

                    // Fix for https://forum.obsidian.md/t/active-leaf-is-saved-but-not-restored/15402
                    app.workspace.rootSplit = result.getRoot();
                    app.workspace.setActiveLeaf(result, false, true);
foreveryone1 commented 3 years ago

Pane-relief 0.0.2 displays this problem, but pane-relief 0.0.1 does not.

Once those 2 lines have been commented out, the plugin no longer breaks links on load.

pjeby commented 3 years ago

So weird. Still don't know why it breaks for you but not for me. I added those lines to fix a bug that is fixed in 0.11.11 so I will happily take them out when 0.11.11 is out for general use.

pjeby commented 3 years ago

Release 0.0.4 removes those lines (and requires 0.11.13), so you should be all set now. Feel free to let me know if it breaks again.