Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Sidebar position isn't saved after restarting Obsidian #15

Open
chrisgrieser opened this issue Oct 25, 2021 · 23 comments
Open

Sidebar position isn't saved after restarting Obsidian #15

chrisgrieser opened this issue Oct 25, 2021 · 23 comments

Comments

@chrisgrieser
Copy link

Screen.Recording.2021-10-26.at.01.07.01.mov
@SkepticMystic
Copy link
Owner

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

@chrisgrieser
Copy link
Author

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

@chrisgrieser
Copy link
Author

🥳

@chrisgrieser
Copy link
Author

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

@SkepticMystic
Copy link
Owner

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
Copy link
Owner

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 SkepticMystic reopened this Oct 26, 2021
@SkepticMystic
Copy link
Owner

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

@chrisgrieser
Copy link
Author

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)

@SkepticMystic
Copy link
Owner

Which plugins do this?

@chrisgrieser
Copy link
Author

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

@SkepticMystic
Copy link
Owner

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

image

I'll check out the others now

@SkepticMystic
Copy link
Owner

Haha same as MOC
image

@chrisgrieser
Copy link
Author

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

@SkepticMystic
Copy link
Owner

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

@chrisgrieser
Copy link
Author

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

ლ(ಠ_ಠლ)╯

@SkepticMystic
Copy link
Owner

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

@chrisgrieser
Copy link
Author

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

@SkepticMystic
Copy link
Owner

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

@ghost
Copy link

ghost commented Oct 28, 2021

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?

@SkepticMystic
Copy link
Owner

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

@ghost
Copy link

ghost commented Oct 28, 2021

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.

@SkepticMystic SkepticMystic reopened this Oct 28, 2021
@SkepticMystic
Copy link
Owner

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

@ghost
Copy link

ghost commented Oct 28, 2021

Alright I'll do that right away!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants