Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add accordions to docs menu #2707

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Add accordions to docs menu #2707

wants to merge 6 commits into from

Conversation

Rafael-gc
Copy link

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!

@kingthorin
Copy link
Member

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.

@Rafael-gc
Copy link
Author

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.

@kingthorin
Copy link
Member

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.

@thc202 thc202 changed the title Add accordions to docs menu #2445 Add accordions to docs menu Jul 4, 2024
@thc202 thc202 linked an issue Jul 4, 2024 that may be closed by this pull request
@psiinon
Copy link
Member

psiinon commented Jul 8, 2024

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.

@Rafael-gc
Copy link
Author

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.
image

@kingthorin
Copy link
Member

They do have sub-pages, at least the first does:
image

@Rafael-gc
Copy link
Author

You are right. Any clue why it's not showing the subitems of just those four items?

@kingthorin
Copy link
Member

I'll have a closer look tomorrow.

@kingthorin
Copy link
Member

I haven't pulled the branch yet and tried it locally. Are there some which are working as expected?

@Rafael-gc
Copy link
Author

Yes, I only found these four that aren't working as expected. All others seems right

@Rafael-gc
Copy link
Author

Rafael-gc commented Aug 19, 2024

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.

image

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.

image

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

    ):

    image

@kingthorin
Copy link
Member

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.

@thc202
Copy link
Member

thc202 commented Aug 20, 2024

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.

@Rafael-gc
Copy link
Author

Rafael-gc commented Sep 2, 2024

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

@kingthorin
Copy link
Member

kingthorin commented Sep 24, 2024

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.

@kingthorin
Copy link
Member

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 🤷‍♂️

@psiinon
Copy link
Member

psiinon commented Oct 16, 2024

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Add accordions to docs menu
4 participants