Add accordions to docs menu
My proposal for improving the navigation tree. Now the tree only expands when the user hovers the cursor over the item. This is my first time contribuiting to this project so please let me know if I'm doing things right!
Gave this a try. It does nicely expand things on mouse over. Things never collapse again.
Also with the filter things are expanded to show matches.
I'm not sure if those things simply weren't planned for or if this is just a first step in the implementation process.
Now instead of hover above to expand the items It's a click and double click function. One click it expands or collapse, double click redirects to the page. I apologize for the filter problem, It's working now. Thanks for the fast feedback, I'm learning a lot by trying to contribute to this project.
I haven't tested this yet, but is double click going to be intuitive for users?
I don't mean to be a jerk, but there's gotta be some sort of mouse over / mouse away events that you could use along with say a 3-5 sec delay or something? I dunno.
Don't put work into changing again until others provide input.
One problem is that you cant see which nodes are expandable. You have to just click on each of them. This is not very intuative I'm afraid. I think there should be different icons so people know which nodes have children.
Guys, for some reason these four items have the [+] symbol even though they don't have subitems. I've been working on this for a while, but I still haven't figured out why this is happening.
They do have sub-pages, at least the first does:
You are right. Any clue why it's not showing the subitems of just those four items?
I'll have a closer look tomorrow.
I haven't pulled the branch yet and tried it locally. Are there some which are working as expected?
Yes, I only found these four that aren't working as expected. All others seems right
I think I’ve discovered the problem. For some reason, all the sub-items (including the ones that don’t have sub-items) of the first item 'Add-ons' are folders that contain their own _index.md files.
However, all the other items (Releases, Getting Started, and Desktop UI) are folders that have their own _index.md files and also the files of their sub-items, such as checks.md.
I tested it, and replacing the folder 'active-scan-rules' with its respective _index.md file by a file named 'active-scan-rules.md' in the 'addons' folder resolves the problem. However, if preferred, I can adjust my code to identify when a folder contains only one file named _index.md, indicating that it does not have sub-items. Just one more image to show what's going on (Active Scan Rules generating an empty
- ):
Thanks for digging into it @Rafael-gc I hadn't managed to get back to it 😔
I think the second option is best but let's allow others to add their two cents.
The first is not really an option, the files are automatically generated and they have that name/structure because that's how Hugo works https://gohugo.io/content-management/organization/ so updating the code to correctly identify the structure is the proper fix.
I have implemented some mouse over / mouse away events along with 5 secs delay, as suggested by @kingthorin . Please give it a try and send me some feedback when possible. Thanks for the help
Hey @Rafael-gc please know this isn't forgotten.
A number of other things (ex: a broken wrist) have required my attention lately.
I'll try to get back around to testing it sometime later this week.
I finally got to test this. It seems okay to me.
I think if the user has clicked into some part of the menu it should probably stick expanded at that location (as they're likely to want to access related/adjacent pages). But maybe I'm getting picky 🤷♂️
I've tried this out and I'm afraid I find it frustrating to use :/ I definitely like the fact that the menu is contracted, thats good. But the only way I can see if there are submenus is if I hover over each node, and then the expand. They also seem to contract when I dont expect them too. I would much rather that this was a standard tree control where you can see which nodes have children (+) and choose which nodes to expand and contract. But would definitely like to hear other points of view :)