I wanted to give my feedback about the navigation bar at fedoraproject.org and start a discussion about its user interaction. I have the feeling that using the mouse-hovering to display section/subsections does not make for a pleasant experience compared to single click as the user has to carefully move his mouse to avoid hovering an unintended section by mistake.
Here is an example workflow based on my experience:
Hover Get Fedora, the detailed navigation panel appears
Move the mouse to Editions
=> Now if you trace a straight line from āGet Fedoraā to āEditionsā you endup on the blue header bar and the entire menu disappears. In order to do it properly, the user has the move his mouse down first and then left.
Same happens when I hover āAtomic Desktopā. I then have to carefull move my mouse to the right to avoid touching āEditionsā or āSpinsā as it would cause the entire section I want to interact with to disappear and be replaced by another one.
This adds an unnecessary level of complexity as most of my interactions have to be redone at least twice.
I checked a previous version of the site that was one year old and it was using single-click for its interaction. Is there a specific reason for this change? Would it be possible to start a discussion about dropping hovering entirely and restoring the single-clicks only mode?
There was an older version of the site that used javascript instead of CSS for the nav menus (I think it was a bit more than a year ago, but Iām not sure). We had several complaints about requiring javascript, so that menu was redone using CSS and that is when the hover navigation was added. You can still click on things to pin your selection.
Edit: I see that it is a bit twitchy if you donāt go straight down from the menu. I think something else was changed somewhere along the line because I donāt believe the menu used to disappear like that if you tried to go straight from Get Fedora to Editions. Iāll see if I can fix that.
I see. Thanks for the explanation.
Yes the menu disappearing is actually the main issue for me as it resets the pins.
Thanks for the quick answer. I really like the fedora website. One of the best there is out there.
Edit: If you want to test this out, this link should work, at least while the build preview exists (I think the preview builds get purged shortly after the MR is merged.)
Edit2: Iām not sure I like the way it causes that large menu to appear when the user moves their mouse down from the browserās bookmarks bar. It might be better if that phantom divās pointer-events were initially disabled (so it wouldnāt do anything) and then it was only activated when the user hovered over āGet Fedoraā. Maybe it could be set to go back to inactive after a short delay. Itād be a bit more code, but I might give something like that a try.
Edit3: Iāve added the pointer-events toggling so the phantom divās effect will only appear when transitioning off the āGet Fedoraā button. New build preview: Fedora Linux | The Fedora Project
Thanks for the preview.
Unfortunately, I think there are still some issues with the hovering:
The phantom div seems to be linked to the āGet Fedoraā section. If I hover on āContributorsā, move down to the menu and then hover by accident on the phantom div, it will activate āGet Fedoraā instead of keeping āContributorsā active.
Clicking on āGet Fedoraā will pin the menu, thus making the phantom div always present. If I move down the mouse (making the menu disappear), hovering anywhere in the phantom div will make it reappear.
Unrelated to your change: Pins do not seem to propagate from sections to subsections. Clicking on āGet Fedoraā will pin it, thus disabling hovering for the other elements as expected, but then clicking on āAtomic Desktopā will disable the āGet Fedoraā pin and thus hovering on āContributorsā will change the menu.
Minor: The entire menu is not changing the cursor to āpointerā for clickable items.
My css is a bit rusty, so I struggle to see what the ideal solution should be. This might be a matter of personal preference, but I still believe a click-only scenario would be far simpler to implement and maintain:
Click on a section to make the menu appear
Click on the subsections to navigate
Click on a close icon, outside of the menu or on the pinned section to make the menu disappear
The entire menu navigation concept (highlights/focus on hover, pointer type, etc.) is suppose to imitate the default behavior of the bookmarks menubar. (Firefox and Chrome exhibit the same behaviors, Iām not sure about Safari, Iām not a Apple user.) But the implementation is admittedly crude and Iām happy to fine tune it.
Turning off hover completely seems like a more drastic change, but we can poll the community about it and see what people think.
There is a variable that holds the state information about what menu item was last clicked. Just creating more variables to hold more button states should be enough to fix the problem of clicks on the secondary menu overwriting the record of what button was last clicked on the primary menu. Iāll look into it.
Yes, turning off the hovering is way more drastic. Despite my personal preference, if there is a solution that works and doesnāt require to do it, we should definitely keep it (and maybe poll the community later).
And I agree that adding extra variables would most likely fix the problems. I am happy to help with the testing.
Thanks for looking into it.
The way to fix this is to position the submenus at the top of the screen, and give them a padding or border that is equal to the height of the main menu bar.
In that scenario when leaving the āGet Fedoraā menu item the cursor will hover over the activated submenu, which will make it stay visible.
Hereās a working example where the padded section is bright blue and the cursor is hovering above it, outside of the Get Fedora menu item:
Interesting. But if the menus are extended higher with a transparent border or padding, can you still click through them and hit the main menu buttons? I guess Iāll have to give it a try and see what happens.
If you give the menu buttons a position:relative and z-index:1 and the submenus a z-index:0, then the menu buttons should be above the submenus which will allow you to hover over them or click them normally.
I canāt get it to work. I think those changes are incompatible with the existing layout which already uses various z-indexes to switch which menu is showing. Also, the divs that make the submenus are nested within the div that makes the top-level menu, so if I increase the z-index of the top menu, that automatically adds to the z-index of the submenus.
Feel free to fork the repo and submit a MR to fix the problem if you feel inclined. Otherwise, the phantom div seems adequate (though it isnāt perfect).
Here is a build preview with the added variables to track the main and submenu states separately. It has been submitted as a separate MR from the one that adds the phantom div to extend the hover effect, so it doesnāt contain those changes.
Yes itās possible that a more extensive overhaul would be needed for that. I donāt know if i want to dig into that at this point, since iām not familiar with the website and the rest of the code, so it would require some time to investigate and test things out.
It looks much better thank you. I have two comments though:
Clicking on a pinned item should unpin it.
Once pinned, hovering outside of the menu should not make it disappear. Instead the user should perform a manual click to make it go away (either click outside of the view or unpin it).
Basically, a pin action should disable any hovering action until an unpin action is performed.
Iāve implemented this. It can be tested using the below link for as long as the build preview exists (it shouldnāt get purged until sometime after it is merged).
I havenāt figured out how to implement this request yet, but if something comes to me, Iāll try.
Thanks. The above MR is a somewhat significant change, so I would appreciate a bit more testing and feedback. @nikodunk and @darknao, I would like your feedback as well. Thanks.
P.S. Navigating to other pages in the build by clicking on the menu entries will not work. It is a known limitation of the current build-preview system. The actual links will work on the production system, however.
Would it not be possible to simply disable hovering entirely if a pin variable is enabled? I would say this is where the value of pin system resides and I wouldnāt merge anything until we have a solution for this specific issue.
I also found some minor glitches:
The phantom div seems to highlight āGet Fedoraā when we hover over it after having pinned any other section
The phantom div does not seem to stretch to the fedora logo
A disappearance of the menu should reset the pin variables, otherwise the phantom div remains active and hovering over it would make everything reappear
The only way I know to disable hovering at runtime is to set pointer-events-none on an element. Unfortunately, that also disables click events and then none of the menu buttons will work at all. I might have an idea for a workaround, but Iāll need to experiment with it a bit.
Edit: Iāve been overlooking something obvious. If I duplicate some of the CSS rules that govern the menu behaviors, the hovering effect doesnāt have to be disabled āat runtimeā. There is still some interaction between the two navigation methods, but I think I have something workable now. Here is the latest build preview: Fedora Linux | The Fedora Project
I think this problem has been superseded by solving your earlier request ā āOnce pinned, hovering outside of the menu should not make it disappear. Instead the user should perform a manual click to make it go awayā.
Edit: Here is an updated build that fixes the shadow effect at the bottom of the nav menu. I had turned it off in the previous build because the shadow would flash as the mouse passed over a checked/selected menu item and that was distracting. Here is the latest build with the menu shadow restored (it doesnāt flash now ): Fedora Linux | The Fedora Project