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

Remove the extra Idea Hub widget state for no ideas without the tabs

Open felixarntz opened this issue 5 years ago • 4 comments

While the original Figma design had the specific state where, if there are no ideas in any of the tabs, the tabs don't even show, this is actually undesirable. It is unnecessary to have this as an extra state, it creates a weird jump because the loader UI has the tabs show up, and it also doesn't create a visual expectation of what the populated widget will look like.


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

Acceptance criteria

  • The extra state for not displaying the tabs when there are no ideas in the Idea Hub widget at all should be removed.
  • In other words, in that situation, the widget should still show up as usual, with all three tabs in their respective zero data state.
  • Since there are specific tracking events being fired for the state that there are no ideas at all (widget_gathering_data_view vs default_tab_view), the logic still needs to be kept somehow - just visually, there should be no difference from the state where you have no new ideas, but ideas in other tabs.
    • There is actually one part in this logic that is currently incorrect: The two events should be alternative, i.e. default_tab_view should fire if there are any ideas. The current extra check for hasManyIdeas is incorrect and should be removed, it should just be an else.

Implementation Brief

Inside assets/js/modules/idea-hub/components/dashboard/DashboardIdeasWidget/index.js

  • Remove the block of code at line 235, because we want to render the widget even if hasNoIdeas is true.
  • Replace the else if ( hasManyIdeas ) on line 158 with a simple else - if there is even one idea we want to fire default_tab_view; if there are none at all we want to fire widget_gathering_data_view.

Test Coverage

  • No new tests required

Visual Regression Changes

  • Images related to the Idea Hub dashboard widget may need updating.

QA Brief

  • For the tracking, you'll need to add the Google Analytics Debugger browser extension

  • Install the extension following the instructions, and then make sure you opt in to tracking via the Site Kit settings.

  • When there are no ideas of any sort, the Idea Hub dashboard widget should still display the tabbed state (rather than the previous, un-tabbed 'empty' state from the designs).

  • The widget_gathering_data_view should be fired in this scenario.

  • When there is at least one idea of any sort (be it a saved idea, new idea etc), the default_tab_view event should be fired.

Changelog entry

  • Show Idea Hub tabs even when no ideas are available.

felixarntz avatar Sep 09 '21 18:09 felixarntz

IB :heavy_check_mark:

eugene-manuilov avatar Sep 10 '21 12:09 eugene-manuilov

QA Update: ⚠️

@johnPhillips could we jump on a call about this ticket, will ping you in Slack to arrange. I am not seeing widget_gathering_data_view in the event data. Unless it's my eyes, its difficult looking through all of the data without coffee.

Update: discussing this with John in Slack it would seem this is difficult test due to the API and the Idea Hub tester plugin does not help us in this scenario. At the moment widget_gathering_data_view is not getting triggered. Leaving this in the QA queue until we have a solution to test this.

image

wpdarren avatar Sep 16 '21 16:09 wpdarren

Just a note as to how we managed to QA this. The event actually fires:

  • only once
  • only when the widget is in view

https://github.com/google/site-kit-wp/blob/60f800a936f5920d843fbe08c2e8aa14c5c4805c/assets/js/modules/idea-hub/components/dashboard/DashboardIdeasWidget/index.js#L145

So if you load the page but don’t scroll down, the event won’t fire. You then empty the ideas using the testing plugin, let the page load, and then scroll down.

johnPhillips avatar Sep 17 '21 13:09 johnPhillips

QA Update: ✅

Verified:

  • The widget_gathering_data_view is fired when there are no ideas within the widget. - Screenshot

  • When there is at least one idea the default_tab_view event is fired. - Screenshot

wpdarren avatar Sep 17 '21 13:09 wpdarren