site-kit-wp icon indicating copy to clipboard operation
site-kit-wp copied to clipboard

Implement new Unified Dashboard header design/UI behind feature flag

Open tofumatt opened this issue 5 years ago • 22 comments

Feature Description

The Unified Dashboard has an updated Header design that should be implemented, preferably in the existing Header component, behind a feature flag.

It should start with the header being "sticky", the user avatar being only an icon on all screen sizes, and a "dummy" button that a user can click to open the URL/page title search, eg:

Screenshot 2021-09-15 at 20 27 57

Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • The existing Header component (assets/js/components/Header.js) should continue to be used. All modifications in this issue should only be present when the feature flag unifiedDashboard is enabled.
    • When the feature flag is not enabled, no changes to the header should be made.
  • The entire Header should be "sticky", eg. it should remain on-screen/at the top of the page, even as the page is scrolled.
  • The user menu should never show the user's login/email; it should always show only the user's avatar. (This is already the behaviour on mobile viewports—essentially, all viewports should now match the mobile viewport's behaviour.)
  • A new button should be added for the "URL search" feature.

In its default state the URL Search button should look like this:

Screenshot 2021-09-29 at 15 36 17

When clicked it should expand to show an <input> component:

Screenshot 2021-09-29 at 15 36 44

Note the exact design and functionality will be implemented in #4049, so a simple <input> element when the "URL Search"/magnifying glass icon button is clicked for now is fine.

The desktop Figma file is here: https://www.figma.com/file/VILRieNSLg2DOVyEgFBkXe/%5BMVP%5D-Generic-Dashboard?node-id=0%3A1 (under the "Single Search: Full frames" section). The mobile versions are available here: https://www.figma.com/file/VILRieNSLg2DOVyEgFBkXe/%5BMVP%5D-Generic-Dashboard?node-id=382%3A1699

When the input is blurred it should disappear and the "URL Search" button should appear again. No functionality other than the show/hide functionality should be implemented as part of this issue.

Implementation Brief

Create a new component assets/js/components/EntitySearchInput, it will need a single piece of state isActive, when it is inactive (false === isActive) it renders as a <Button component. The icon needs to have a magnifying glass (per the AC), for which we need a new image and the text "URL Search". In the onClick handler for the button, the isActive state is set to true, and the component renders as an <input /> field, which will be further implemented in #4049. In the onBlur handler for the input field, the isActive state is set back to false.

  • We will be updating two components, assets/js/components/DashboardEntityApp.js and assets/js/components/DashboardMainApp.js. Since they are both already behind the feature flag for unified dashboard, we don't need to further check for the feature flag. The changes will need to occur in both files.

Add three child components to the <Header /> component: <EntitySearchInput /> (created above), <DateRangeSelector />, <HelpMenu />. If you're familiar with DashboardDetailsApp, the order of HelpMenu and DateRangeSelector is intentionally switched to align with the figma files.

<Header>
    <EntitySearchInput />
    <DateRangeSelector />
    <HelpMenu />
</Header>
  • In assets/js/components/UserMenu.js add a check for the feature flag const unifiedDashboardEnabled = useFeature( 'unifiedDashboard' );, and when the feature is enabled, ignore the return when ! userEmail, and don't show the text in the button { userEmail }.

QA Brief

  • Enable unifiedDashboard feature flag.
  • Observe the header bar resembling the picture in the AC, make sure
    • New (unstyled) EntitySearchWidget with the behavior described in the AC.
    • User Menu no longer showing email address in the header.
    • Check in both main main and entity dashboard.
  • UPDATE: Also ensure that,
    • Input field is focused when search button is clicked.
    • Input field closes when clicked outside it.
    • search icon is on the right with enough spacing.
    • User Avatar is centered when hovered.
    • User Menu has a tooltip "Account".
    • New design changes made to User Menu does not affect Old Dashboard.

Changelog entry

  • Implement new Unified Dashboard header design/UI.

tofumatt avatar Sep 15 '21 19:09 tofumatt

@tofumatt Just a note that coverage of some of the events mentioned in https://github.com/google/site-kit-wp/issues/4057 might need including in the ACs for this issue so that the old and new headers are aligned.

johnPhillips avatar Sep 21 '21 10:09 johnPhillips

Following from the above comment, same for events in #4058

ivankruchkoff avatar Sep 24 '21 07:09 ivankruchkoff

The GA events in #4057 only apply once the URL is actually "activated" eg. navigated to. That won't happen as a part of this issue, but rather in #4049.

Everything else in #4058 will already be present here 👍🏻

tofumatt avatar Sep 28 '21 22:09 tofumatt

Check for feature flag being enabled with a new const which will check if the unifiedDashboard feature flag is enabled const unifiedDashboardEnabled = isFeatureEnabled( 'unifiedDashboard' ). We will need to do this in several components

We need to use the useFeature hook instead of isFeatureEnabled.

In assets/js/components/dashboard/DashboardApp.js and assets/js/components/dashboard-details/DashboardDetailsApp.js

We need to make changes in the new DashboardEntityApp and DashboardMainApp components. The current DashboardApp and DashboardDetailsApp should remain the same.

Also, when the feature is enabled, prior to both the '' and add a new <Button component. The icon needs to have a magnifying glass (per the AC), for which we need a new image and the text "URL Search". In the onClick handler it should change to an field.

Let's create a new component for it instead of adding button and input elements directly to the DashboardEntityApp/DashboardMainApp component.

eugene-manuilov avatar Oct 01 '21 09:10 eugene-manuilov

IB :heavy_check_mark:

eugene-manuilov avatar Oct 04 '21 14:10 eugene-manuilov

@kuasha420 i see you are already working on this ticket. Please, add the correct event tracking to the new EntitySearchInput component as described for the existing URLSearchWidget component in the #4057.

eugene-manuilov avatar Oct 05 '21 10:10 eugene-manuilov

@eugene-manuilov Wouldn't it be better to add the tracking event on #4049 as that's where the EntitySearchComponent will be properly implemented? These cross ticket IBs made me a little confused!

kuasha420 avatar Oct 06 '21 13:10 kuasha420

@kuasha420 actually, I think you are right. Sorry for the confusion :laughing:

I have updated IB for #4049 to track the event in the new entity search component.

eugene-manuilov avatar Oct 06 '21 14:10 eugene-manuilov

@kuasha420 could you please add QAB?

eugene-manuilov avatar Oct 07 '21 15:10 eugene-manuilov

@kuasha420 one thing I just noticed here is an inconsistency in the changes to the user-menu, specifically around the shadow/background of the button but also some extra margin which I believe is added for the arrow in the current header.

image image

This should be round and ideally with a tooltip as well (not sure why this wasn't there before). image

I think we should at least handle the size and shape of the button here to be like the other round icon buttons and we can add the tooltip later as I'm not sure what this should be.

aaemnnosttv avatar Oct 11 '21 11:10 aaemnnosttv

Should I create a follow up pr here? I am already working on #4049 and sneak in the fix there as well.

@aaemnnosttv

kuasha420 avatar Oct 11 '21 11:10 kuasha420

QA Update: ❌

@kuasha420 I have a number of observations:

A new button should be added for the "URL search" feature.

  1. The URL search button does not look the same in the AC and Figma files. The background is blue, and the magnifying glass is on the left of the text but shows on the right in Figma. This is what I see:

image

It's possible that some of the observations below are due to the styling of the URL Search button, so when this is fixed these issues might be too, but wanted to highlight them.

  1. The magnifying glass icon looks too close to the URL SEARCH text. Could do with some padding around it?
  2. The space between the URL Search button and Date picker is not the same as other elements on the menu, i.e. date picker and user menu. Needs to have more padding?
  3. On mobile devices the URL Search button causing styling issues with the other elements in the header.
  4. The input box is un-styled like the AC, but seems much smaller than the Figma files.
  5. The behaviour of the input field is confusing. When you click on the URL Search button, the input field appears. It's not obvious how you close it. I clicked around in different areas of the field, sometimes it brought the URL Search button back, but sometimes it didn't.

image

These might be out of scope but still felt I should raise them:

  1. The calendar icon is different on the header, compared with what I see on Figma for desktop and mobile.
  2. This might be being overly picky but the user avatar isn't centred to the background colour when you hover.
  3. The gap between the help menu and user menu seems bigger.

image

Verified:

  • When the feature flag is not enabled, no changes to the header are made.
  • Made sure that all elements of the header function as before.

image

  • The entire Header is "sticky" It remains on-screen/at the top of the page, even as the page is scrolled.
  • The user menu does not show the user's login/email; it only shows the user's avatar.

image

  • When the URL search button is clicked it expands to show an component. Do not see the text, icon within the input field but this is expected according to the AC.

image

wpdarren avatar Oct 11 '21 14:10 wpdarren

@wpdarren the ACs don't require that the search field matches the design, this is more of a scaffolding of the foundation for the feature. The ACs mention that this will be handled in a subsequent issue:

Note the exact design and functionality will be implemented in #4049, so a simple <input> element when the "URL Search"/magnifying glass icon button is clicked for now is fine.

2. This might be being overly picky but the user avatar isn't centred to the background colour when you hover.

I raised this above; I'm not sure it matters too much which issue it's fixed in, so long as we agree on one before this one moves to approval (cc: @kuasha420).

@tofumatt anything else needed here?

aaemnnosttv avatar Oct 12 '21 08:10 aaemnnosttv

@aaemnnosttv it does mention in QAB referencing the AC which says

In its default state the URL Search button should look like this:

image

This is why I have included the observations in my comment.

The reference to the other ticket is related to the input field, I agree can be excluded from my observations.

wpdarren avatar Oct 12 '21 12:10 wpdarren

I meant for this issue to cover that URL Search style, but I think it's fine to fix in #4049 instead, where any other issues here can be fixed. Again: this issue is largely about scaffolding, so I think it's fine as-is—even the arrow spacing Evan mentioned here: https://github.com/google/site-kit-wp/issues/4048#issuecomment-939923306 could be fixed there, I think.

tofumatt avatar Oct 12 '21 18:10 tofumatt

@tofumatt I think I will create a follow up pr on this issue and fix avatar and the button here so CR/QA doesn't get too much out of control on 4049. Thanks for the discussion and clarification!

cc: @wpdarren

kuasha420 avatar Oct 13 '21 02:10 kuasha420

Update:

Made a follow up PR addressing the above issues. Also updated QAB.

Cheers.

kuasha420 avatar Oct 14 '21 02:10 kuasha420

QA Update: ❌

As per chat in Slack, when I connect Site Kit / Search console, I am redirected to the Dashboard, and receive a ‘Additional Permissions required’ Sending back to Execution.

db

wpdarren avatar Oct 19 '21 14:10 wpdarren

Back to you @wpdarren for another pass 👍

aaemnnosttv avatar Oct 20 '21 09:10 aaemnnosttv

QA Update: ⚠️

@tofumatt I have two observations:

User Avatar is centered when hovered.

When you hover over the User Avatar the background does not seem the same as other items in the header, i.e. Search URL button on hover. Not as much padding? I do see that the avatar is centered though. Thoughts? - Screenshot

The search icon is on the right with enough spacing.

Looks fine on desktop but there are spacing/styling issues on smaller screen sizes. - Screenshot

It's possible that these will be picked up in #4049 but wanted to check.

wpdarren avatar Oct 20 '21 13:10 wpdarren