docs
docs copied to clipboard
✨ Document tree - Persist opening state of the top X levels sub-pages
Feature Request
Is your feature request related to a problem or unsupported use case? Please describe. We are using docs to store a rather big knowledge base, the 3 first level of sub-pages are used to macro-organize documents. When opening a sub-page on a new page, only the path of the current page is open. It can be a hassle to constantly reopen those first levels.
Describe the solution you'd like Notion choose to keep a state of the 2 first level of subpages, so when you open a new tab the tree stay open up to the second level. I think this approach is interesting. Comparison in video https://www.loom.com/share/a26c949ee2604ea9abf840f44ffcc49d
Do you want to work on it through a Pull Request? Could be :)
Thanks for this issue ! I agree with you ! @rl-83 what’s your take ?
I mostly agree with the behavior. The only issue I see is that in the provided Notion example, the selected document isn't visible in the sidebar because the folders have collapsed to the second level. This isn't a big deal in Notion since there's the breadcrumb navigation at the top.
If we want to go in this direction, I suggest:
- Opening up to the second level by default like Notion
- Expanding the entire hierarchy leading to the current sub-document (the one that’s active on the right)
I do have a concern for users who prefer to keep things neatly collapsed and avoid clutter. If we open up to the second level by default, I worry it might degrade certain user experiences. Maybe a good case for A/B testing, @virgile-dev?
If we open up to the second level by default, I worry it might degrade certain user experiences.
My proposal was to persist in the browser local storage the opening state of the tree and upon refresh or new tab, to retrieve this state and open the tree back up to the second level.
I agree with you that the tree should be fully open to reveal the position of the current document.
It seems we all agree ! Just one confirmation needed on my end, the tree state is shared among user right ? (At least at each reload). @olaurendeau
The idea would be to store the opening state in the user browser local storage. So the state would be shared only within the user browser. For example not between Firefox and Chrome.