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

[WIP] Service Header component #4950

Draft
wants to merge 18 commits into
base: main
Choose a base branch
from
Draft

Conversation

querkmachine
Copy link
Member

@querkmachine querkmachine commented Apr 22, 2024

Takes the 'Service Header' concept from #4915 and implements it as a standalone component, with the toolbox/dropdown concept removed (at least for now).

For alphagov/govuk-design-system#3748.

Links

Todo

Creating a Service Header component

  • There are a few minor design issues outstanding:
    • The height of the Service Header (on desktop) is different depending on whether there are navigation links present or just a service name.
    • The focus style is positioned differently depending on whether it's a service name link or a navigational link.
    • The mobile layout generally feels a little bit unevenly spaced and could use some tweaking.
  • The injection of <strong> for active links is done a bit haphazardly and needs more consideration as to when it's used and how it's styled.
  • Comprehensive review app examples and associated tests written.
    • Template tests.
    • JS functionality tests.
    • Review app examples added/updated.
  • Readme content written (this can probably be mostly lifted from another component).

Changes to other components

  • Move the <header> tag out of the Header component and into the template.
  • Adapt the Phase banner to be usable between the Header and Service Header components.
  • Add 'slots' to the Header and Service Header components.
  • Deprecate the navigation and service name/URL options on the Header component.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

@Ciandelle
Copy link

Overall I'm not seeing any glaring issues that concern me. I do wonder if the blue text is something to change based on the working group feedback. Additionally, personally I don't like the layout of the service header with large navigation, it feels too unorganised and I would struggle to find what I'm looking for. I am aware that this may be a complete personal thing, so please don't get caught up on it

@querkmachine
Copy link
Member Author

personally I don't like the layout of the service header with large navigation, it feels too unorganised and I would struggle to find what I'm looking for.

That's entirely fair. This is one of those review app examples which is intended to test the extremes of the component. No one should actually be using that many navigation items in practice, I hope! 🤞

@querkmachine
Copy link
Member Author

I've pushed up a fix for all of the links appearing selected in High Contrast Mode.

The other things I haven't actioned yet could affect the overall design of the component and probably needs to do the rounds within the squad first

Update existing full-page examples that have a service name or navigation to use the Service Header component instead.

Also update header and phase banner styles to work with service header:

- Makes header border full-width in all circumstances
- Adds content width container to phase banner
- Change a Notification Banner test that created a second banner role, as this created an accessibility failure with the header always being present in the template
Remove the 'with no options set' example from being tested as part of the standard accessibility tests.

This is because the accessibility test tries to initialise the component's JS, but there is no HTML being rendered to initialise it against, returning an ElementError that Jest considers to be a test failure.
@selfthinker noted that having the entire `<nav>` element toggled means that the navigation landmark is inaccessible when the menu is closed. Not having the toggle within the landmark also means that assistive technology users wouldn't be able to jump to it easily.

This commit moves the toggle button to within the `<nav>` element and tweaks the JS so that the `<ul>` has its visibility toggled instead.
The method by which component JS is loaded and initialised changed in Frontend 5.4.0. This commit updates some of the references that didn't get caught while rebasing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In progress 📝
Development

Successfully merging this pull request may close these issues.

Get something working in Frontend
6 participants