advanced-cursors icon indicating copy to clipboard operation
advanced-cursors copied to clipboard

Sidebar position isn't saved after restarting Obsidian

Open chrisgrieser opened this issue 4 years ago • 23 comments

https://user-images.githubusercontent.com/73286100/138782853-742920a5-43c7-483d-a6d4-32ccfb272bf7.mov

chrisgrieser avatar Oct 25 '21 23:10 chrisgrieser

Hmmm yes... I think alot of plugins have this issue. It will require saving the last position and adding it back there. Surely possible, I'll just have to figure out how

SkepticMystic avatar Oct 26 '21 07:10 SkepticMystic

yeah, it is quite annoying with a lot of plugins, tbh :(

chrisgrieser avatar Oct 26 '21 09:10 chrisgrieser

🥳

chrisgrieser avatar Oct 26 '21 11:10 chrisgrieser

I just tested it, and it still doesn't work :/

chrisgrieser avatar Oct 26 '21 19:10 chrisgrieser

Ahh I see. I get the same issue on my main vault. I think the problem is simple, will you let me know if it works in next release?

SkepticMystic avatar Oct 26 '21 19:10 SkepticMystic

Ok, I think it's working properly now. It only tracks 'left' or 'right', so it just groups it into the main split on the corresponding side. ie. it doesn't consider groups of leaves within each side

SkepticMystic avatar Oct 26 '21 19:10 SkepticMystic

Huh no, I still get this on my main vault... I'm not sure what's happening here, I'll try figure it out

SkepticMystic avatar Oct 26 '21 19:10 SkepticMystic

hmm, isn't that something you could simply copy from another plugin? most of the plugins seems to have solved it, since they do not change position in any way (neighet left/right, nor leaf, nor order inside a leave)

chrisgrieser avatar Oct 26 '21 19:10 chrisgrieser

Which plugins do this?

SkepticMystic avatar Oct 26 '21 19:10 SkepticMystic

all of my plugins except longform and advanced cursors, actually.

Just looking at the plugins currently open in my sidebars:

  • dangling links
  • map of contents
  • recent files
  • calendar

chrisgrieser avatar Oct 26 '21 19:10 chrisgrieser

I tried dangling links first, and it just seems to always open in the right:

image

I'll check out the others now

SkepticMystic avatar Oct 26 '21 19:10 SkepticMystic

Haha same as MOC image

SkepticMystic avatar Oct 26 '21 20:10 SkepticMystic

maybe they solve it differently? since for me, they kinda stay at the left 🙃 https://user-images.githubusercontent.com/73286100/138952244-f8c1f8c1-67ba-4ae1-9f67-0106748dd057.mov

chrisgrieser avatar Oct 26 '21 20:10 chrisgrieser

I don't think there's another way of doing it.. recent files, too image

My approach is:

  1. When the user reloads/closes Obs, save the side that the view is on (left or right)
  2. When reloading and initialising the view, read the side to use from settings
  3. Add it to that side

SkepticMystic avatar Oct 26 '21 20:10 SkepticMystic

but why are all those other plugins behave properly while Advanced cursors can't remember where it was in the sidebar?

ლ(ಠ_ಠლ)╯

chrisgrieser avatar Oct 26 '21 20:10 chrisgrieser

hahaha right? And it works on my small test vault... I'll keep trying

SkepticMystic avatar Oct 26 '21 20:10 SkepticMystic

not sure if you did sth, but now it works?

chrisgrieser avatar Oct 27 '21 07:10 chrisgrieser

Huh, ok? Let me know if the working persists :)

SkepticMystic avatar Oct 27 '21 09:10 SkepticMystic

I have the same problem! It keeps returning to the same spot after every restart. I have had such a problem with a few other plugins as well but most of the times it fixes itself I am not sure what must be causing it and what could have fixed it later so could it have something to do with the way obsidian saves the workspace layout instead of it being a problem with the plugin?

ghost avatar Oct 28 '21 11:10 ghost

Yeah, the code I'm using to save the viewSide and load it in again is pretty simple... I don't know what I could be doing differently

SkepticMystic avatar Oct 28 '21 11:10 SkepticMystic

Another thing I would like to add is that closing the panel and then restarting obsidian makes the panel reappear, ideally there should be a setting or a command to enable the sidebar panel and closing the panel should make it not reappear on restart.

ghost avatar Oct 28 '21 11:10 ghost

I get you, and I agree. I'll try make that possible. Can you open a separate issue for that? As this issue is still open

SkepticMystic avatar Oct 28 '21 11:10 SkepticMystic

Alright I'll do that right away!

ghost avatar Oct 28 '21 12:10 ghost