Conversation
Author
|
Any opinion on this @NGPixel ? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We are currently adopting wikijs as a new wiki at our organization, and I quite like it. However, there is one thing that is really unintuitive and has confused me, as well as other people:
When you go to a page that is a folder (i.e. has children), the tree sidebar shows the folder and all it's siblings. I would expect it to show the children of the folder/page you are on.
This is especially confusing when navigating in the tree to a page. When you click on the page and it loads, the sidebar automatically "goes back up" one level in the hierarchy. I would expect the sidebar to stay the same after clicking/showing any page. Note: There is an old PR #2933 where people have mentioned the same problem.
This PR fixes that by showing the children instead of siblings for pages which have children. Pages which have no children behave exactly the same. Only two small changes are necessary:
treegraphql query is changed a bit for queries with apath: For pages which are a folder, the children are queried instead of the siblings. Queries totreewith aparentbehave as before. This should not impact anything else, as the navbar is the only place I could find where atreequery withpathis made.I have tested this locally and it works really well.
I know that this changes previous behaviour a bit, but I think this way it is much more intuitive. I would really appreciate if this could be merged!