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 search button to header #3483

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

Conversation

precious-onyenaucheya-ons
Copy link
Contributor

@precious-onyenaucheya-ons precious-onyenaucheya-ons commented Jan 30, 2025

What is the context of this PR?

ONSDESYS-162
Added a search button to the header component. Clicking the button opens a panel containing a search input and a list of popular searches.

I have also increased the size of the ons logo as part of this ticket to fit the figma design

How to review this PR

Check that example-header-with-search-button has the new search button and has the design as specified in figma

Checklist

This needs to be completed by the person raising the PR.

  • I have selected the correct Assignee
  • I have linked the correct Issue

Copy link

netlify bot commented Jan 30, 2025

Deploy Preview for ons-design-system-preview ready!

Name Link
🔨 Latest commit 809dbdc
🔍 Latest deploy log https://app.netlify.com/sites/ons-design-system-preview/deploys/67cb0cb84515a100082283bf
😎 Deploy Preview https://deploy-preview-3483--ons-design-system-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@precious-onyenaucheya-ons precious-onyenaucheya-ons force-pushed the feature/162-header-search-button branch from 5a42c21 to 7bf2beb Compare January 30, 2025 15:18
@precious-onyenaucheya-ons precious-onyenaucheya-ons added the Enhancement Change of existing feature label Jan 30, 2025
@precious-onyenaucheya-ons precious-onyenaucheya-ons marked this pull request as ready for review January 31, 2025 08:45
@precious-onyenaucheya-ons precious-onyenaucheya-ons requested a review from a team as a code owner January 31, 2025 08:45
Copy link
Contributor

@admilne admilne left a comment

Choose a reason for hiding this comment

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

I've got some alignment issues when I view this on my browser

Website:
image

Design:
image

  1. It looks like the icon in the button is too small and isn't centred.
  2. The input looks like perhaps it's not tall enough which makes the button next to the input look squashed.
  3. The button next to the input also looks like it has some sort of black border at the bottom which doesn't appear in the designs.
  4. The design also seems to show a blue border around the input whereas it looks like it currently has a black border. We might need some clarification about how this button should look when clicked as that doesn't seem to be included in the design. At the moment this looks very odd to me.
    image

@rmccar
Copy link
Contributor

rmccar commented Feb 13, 2025

The search button doesn't seem to have any focus state at the moment, which doesn't match new menu button. It also doesn't have an underline like that button when it is open, which I know is not in the figma but I think was suggested after. We need this to be consistent with the way the menu button works. Also has this been tested alongside the menu button? I think we should add this to that example because they are likely to be used together

@rmccar
Copy link
Contributor

rmccar commented Feb 17, 2025

This will also need to be changed so that it is only able to be used on "basic" headers

@rmccar
Copy link
Contributor

rmccar commented Feb 20, 2025

Can you split the logo size change out into its own PR. It makes this PR harder to review because it affects so many pages

&--header-search.active:focus & {
&__inner {
padding: 0.875rem !important;
border: 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this needed? This line seems to make no difference

Copy link
Contributor

Choose a reason for hiding this comment

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

@precious-onyenaucheya-ons I don't think this comment has been addressed yet?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed

Copy link
Contributor

Choose a reason for hiding this comment

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

@precious-onyenaucheya-ons I think this is still in the code?

Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't look like its been removed to me either

@rmccar
Copy link
Contributor

rmccar commented Feb 21, 2025

Screenshot 2025-02-21 at 13 54 06

The underlines are currently misaligned

@rmccar
Copy link
Contributor

rmccar commented Feb 21, 2025

Screenshot 2025-02-21 at 14 08 18

Should this have an inner blue boarder? Not a black one like the search on the Service manual header?
If it is meant to be blue I'm not sure there should be a black border between the yellow and blue

Copy link
Contributor

Choose a reason for hiding this comment

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

Im not sure why this has changed. It looks like the radios at the bottom with the dropdown have changed slightly

Copy link
Contributor

Choose a reason for hiding this comment

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

@precious-onyenaucheya-ons have you looked in to this one? Doesn't look major but curious to see if there is a reason for the change

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@admilne @rmccar I am not sure why this changed, I have not made any change in this ticket that will affect this pattern.

Copy link
Contributor

Choose a reason for hiding this comment

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

This one needs investigating

Copy link
Contributor

@admilne admilne left a comment

Choose a reason for hiding this comment

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

I've noticed there are a couple of potential issues here.

  1. There is a gap between the right hand edge of the button and the edge of the header. This is different to the design. Might be ok as it fits with the way the header has been constructed but perhaps worth checking if this is a deal breaker.
  2. There is no hover state on the button to close the search. It's there to open it, but not there to close it.
  3. I think the links under Popular Searches are meant to stack into a single column when on mobile, rather than wrap as it seems to do currently.
    image
    image

@precious-onyenaucheya-ons
Copy link
Contributor Author

precious-onyenaucheya-ons commented Mar 4, 2025

Screenshot 2025-02-21 at 14 08 18 Should this have an inner blue boarder? Not a black one like the search on the Service manual header? If it is meant to be blue I'm not sure there should be a black border between the yellow and blue

@rmccar, I have updated this to have a black border

@rmccar
Copy link
Contributor

rmccar commented Mar 6, 2025

Screenshot 2025-03-06 at 13 49 32

The close search icon isn't black when focused. Should this have a focus state like this because the menu button doesn't?

@rmccar
Copy link
Contributor

rmccar commented Mar 6, 2025

Screenshot 2025-03-06 at 13 52 41

Around about 370px width the buttons wrap

@rmccar
Copy link
Contributor

rmccar commented Mar 6, 2025

When the search is open and you tab through the buttons there is an element that is focused on between the buttons, might be something that we need to remove the focus state on

@rmccar
Copy link
Contributor

rmccar commented Mar 6, 2025

When you:

  • Have the search open
  • Tab back to the close button
  • Then hit enter to close it

The screen looks like nothing is focused but if you can hit enter again to open the search. This should work the same as the menu button where the search button has the focus state when it is closed in this way

@precious-onyenaucheya-ons precious-onyenaucheya-ons force-pushed the feature/162-header-search-button branch from 4413e72 to 7b2e368 Compare March 6, 2025 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Change of existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants