Skip to content

fix: make top nav bar right elements within a nav - #63239

Open
kristian-zendato wants to merge 1 commit into
masterfrom
fix/top-navbar-right-elements-nav
Open

fix: make top nav bar right elements within a nav#63239
kristian-zendato wants to merge 1 commit into
masterfrom
fix/top-navbar-right-elements-nav

Conversation

@kristian-zendato

@kristian-zendato kristian-zendato commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Move the top navbar right elements within a nav element.

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@kristian-zendato
kristian-zendato requested review from a team as code owners August 14, 2026 06:42
@kristian-zendato
kristian-zendato requested review from icewind1991, leftybournes, provokateurin, skjnldsv, sorbaugh and susnux and removed request for a team August 14, 2026 06:42
@susnux
susnux requested a review from pringelmann August 14, 2026 13:30
Comment thread core/templates/layout.user.php Outdated
<div id="contactsmenu"></div>
<div id="user-menu"></div>
</div>
<nav class="header-end" aria-label="<?php p($l->t('User menu')); ?>">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thats not the user menu, the user menu is the one on the very end.
This navigation should have a different label

Also the content within must have proper roles.

  • ul needs role = menubar
  • li needs role = none
  • button within need role = menuitem -> this needs to be fixed in NcHeaderButton

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@susnux The user menu is already in nav wrapper.
As far as I checked the comment here(https://github.com/nextcloud-gmbh/customer-feature-requests/issues/1591#issuecomment-5281587123), we need to move the whole top navbar within a nav wrapper which is in div now.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the issue though: wrapping it means nav inside nav. Fine to have the outer one, but then AccountMenu shouldn't set is-nav. And "User menu" is the wrong label for the whole bar either way.

Comment thread core/css/mobile.scss Outdated

@media only screen and (max-width: 480px) {
#header .header-end > div > .menu {
#header .header-end .menu {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropping to a descendant selector means any nested .menu in the header matches now, not just the toggle's own. Can you do the same two-selector thing as below?

inset-inline: 0;
}
// Hide all other entries, especially the user menu as it might leak pixels
:global(.header-end:has(.local-unified-search--open) > :not(.unified-search-menu)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you drop this? The local search bar is Deck-only and Deck already replaced it with its own filter input, so it's getting removed from the header anyway. No point patching selectors on it.

@kristian-zendato
kristian-zendato force-pushed the fix/top-navbar-right-elements-nav branch from 384a1bd to 4551f67 Compare August 20, 2026 17:51

@susnux susnux left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part looks good, likely needs adjustments in the vue library for NcHeadMenu to set role = menuitem

@kristian-zendato

Copy link
Copy Markdown
Contributor Author

@susnux Regarding updating role of NcHeaderMenu to menuitem, I don't think adding role="menuitem" in NcHeaderMenu is a good solution because we have many places using it.
To solve this problem, I am going to add is-menu-item prop to it.
What do you think about my idea?

@susnux

susnux commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

@kristian-zendato which other place is using it? It must only be used within that header bar thats its full purpose.

@kristian-zendato

Copy link
Copy Markdown
Contributor Author

@susnux I checked that again and yes, they are only used in header.
Then it means, we can update role in NcHeaderMenu without any further update?

@susnux

susnux commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Then it means, we can update role in NcHeaderMenu without any further update?

yes

@ShGKme

ShGKme commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

ul needs role = menubar

@susnux Why? menubar has different semantics and requirements.

menubar represents a menu, just with always visible items.

Semantically, this is not about any set of buttons but a complete actions set. Like this one:
image

I can see how it can be used as an application menu, but even in this case, it is usually about the classic application menus (File | Edit | View | Help).

Technically, a menubar must have menu keyboard navigation, for example:

  • Entire menu is a single focusable element, entered by Tab and exited by the next Tab
  • Navigation inside the manu is performed by Arrows

So if we keep it a menubar, we must implement it as a menu bar.

What about toolbar instead?

@susnux

susnux commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

What about toolbar instead?

You are right! The proper role is likely toolbar after reading the role descriptions again.
Thank you!

Signed-off-by: kristian-zendato <kristian.zendato@nextcloud.com>
@kristian-zendato
kristian-zendato force-pushed the fix/top-navbar-right-elements-nav branch from 4551f67 to ff48cf3 Compare August 28, 2026 08:04
@kristian-zendato

Copy link
Copy Markdown
Contributor Author

@susnux , @ShGKme Thank you for your review.
I update the role to toolbar instead of menubar and remove the PR from nextcloud-vue as no update is needed from there.

I'd appreciate it if you review it again.

Comment on lines +78 to +79
<nav class="header-end" aria-label="<?php p($l->t('Header menu')); ?>">
<ul class="header-end__items" role="toolbar">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After looking again at the overall structure of the new waffle menu I think there are more problems:

  1. the dashboard link (the logo) should be within the same <nav> as the waffle menu
  2. I do not think the <nav> here makes sense if we use toolbar because this is not a navigation we do not navigate anywhere but we just open menus or other actions.
  3. toolbar still requires custom TAB handling

1 is unrelated to this PR but we should still at some point fix it
2 I guess just use ´

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about keeping it a general list? What is the problem with keeping it general buttons? Especially if this is about just 3-4 buttons, not a large menu.

@github-actions

Copy link
Copy Markdown
Contributor

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants