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

Header and navbar refactoring #2656

Closed
davide-negretti opened this issue Nov 22, 2023 · 4 comments · Fixed by #2676
Closed

Header and navbar refactoring #2656

davide-negretti opened this issue Nov 22, 2023 · 4 comments · Fixed by #2676

Comments

@davide-negretti
Copy link
Contributor

The current code of the header and navbar have some issues:

  • it could make customisation very difficult
  • it caused some issues related to z-index which required some workarounds to be fixed
  • it could be improved from a "semantic" point of view ( and tags are not used properly)
  • it does not take full advantages of Bootstrap responsivity features

This is the current structure of the header (for the DSpace theme):

  • HEADER-NAVBAR-WRAPPER component
    • HEADER component – <header>
      • <nav> – Mobile header (hidden on desktop mode)
        • DSpace logo
        • Buttons (search bar, language switch, user menu…)
      • NAVBAR component
        • <nav>
          • DSpace logo
          • Collapsing navigation menu
          • Buttons (search bar, language switch, user menu…)

This could be simplified as follows: all duplicate code should be removed and Bootstrap features should be used in order to handle desktop and mobile modes:

  • HEADER-NAVBAR-WRAPPER component
    • HEADER component - <header>
      • DSpace logo
      • NAVBAR component (hidden on mobile mode)
      • Buttons (search bar, language switch, user menu…)
      • Navbar toggler (hidden on desktop mobile)
    • NAVBAR component (on mobile mode only, when expanded)

These changes should also make easier to handle dspace and base themes.

@davide-negretti davide-negretti added new feature needs triage New issue needs triage and/or scheduling labels Nov 22, 2023
@github-project-automation github-project-automation bot moved this to 🆕 Triage in DSpace Backlog Nov 22, 2023
@davide-negretti
Copy link
Contributor Author

I'd like to work on this refactoring, as I've already done this for some customised themes. the estimated effort is 8 hours.

@tdonohue
Copy link
Member

This is directly related to #2368 . We currently have accessibility issues with the header because of the repeated <nav> section. So, if this refactor can fix those accessibility issues while also not introducing new accessibility issues, it'd be a welcome change.

@davide-negretti : I'll assign this to you. Thanks for volunteering! Just keep in mind that any changes here need to pass accessibility tests (in our e2e tests, and using a browser accessibility scanner like axe DevTools)

@tdonohue tdonohue added accessibility and removed needs triage New issue needs triage and/or scheduling labels Nov 22, 2023
@tdonohue tdonohue moved this to 🏗 In Progress in DSpace 8.0 Release Nov 22, 2023
@davide-negretti
Copy link
Contributor Author

@tdonohue The refactoring of header and navbar is almost complete. It took longer than expected as there were a few issues with Bootstrap classes that were used incorrectly, and the navbar section components had a lot of complex CSS code that caused any small change to break something somewhere else (I removed most of the CSS styles and achieved the same result through Bootstrap classes).
I still have to fix the admin sidebar, which shares the same navbar section components.
I managed to preserve all accessibility features and to make dropdown menus accessible as well. I also found some accessibility issues in the admin sidebar, which I am going to fix as well.

@tdonohue
Copy link
Member

Ported to 7.6.x in #2858

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants