Implement Idea Hub notice in WP dashboard widget
If there are already any saved ideas in the Idea Hub module, the Site Kit WordPress dashboard widget should display a notice that links to the "Saved" tab of the Idea Hub widget, with the notice following the Figma design.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- If the
ideaHubModulefeature flag is enabled and if the Idea Hub module is active and if there are any saved ideas stored, Site Kit's WP dashboard widget should display a notice per this Figma design which links to the Idea Hub widget (more specifically, to its "Saved" tab) in the Site Kit dashboard.
Implementation Brief
- Create new file
/assets/js/components/wp-dashboard/WPDashboardIdeaHub.jswhich exports theWPDashboardIdeaHubfunctional component. - Check if the
ideaHubModulefeature flag is enabled via theuseFeaturehook. - Check if the
idea-hubmodule is active by querying thecore/modulesdata store via theisModuleActiveselector. - Check if there are saved ideas by querying the
idea-hubdata store via thegetSavedIdeasselector. - If all of the above three conditions are met, then
WPDashboardIdeaHubshould render a notice as per the designs in Figma. If not, the component should returnnull. - Create
assets/sass/components/idea-hub/_googlesitekit-idea-hub-wpdashboard-widget.scsswhich will contain all the styles for the notification. BEM methodology should be used for the class names. For e.g.googlesitekit-idea-hub__wpdashboard--title. - The Google logo should be rendered as inline SVG and the existing
assets/svg/logo-g.svgfile can be used. - The text for the notice and the
Viewtexts should link to the Site Kit dashboard.- The URL for the dashboard can be obtained by querying the
core/sitedata store via thegetAdminURLselector. - To automatically scroll the user to the
Savedtab of the Idea Hub widget, append thesaved-ideashash to the dashboard URL.
- The URL for the dashboard can be obtained by querying the
- Create
/assets/js/components/wp-dashboard/WPDashboardIdeaHub.stories.jswhich will contain the story for the component.- Title of the story for the default export should be
Views/WPDashboardApp.
- Title of the story for the default export should be
Test Coverage
- No new tests to be added.
Visual Regression Changes
- N/A
QA Brief
- You will need the
ideaHubModulefeature enabled. - Verify that the notice component is rendered under the conditions described in the ACs above and that it links to the Idea Hub widget correctly.
- Check that the rendered component meets the design criteria in the Figma file above.
- Verify that there is Storybook coverage for the new component.
Changelog entry
- Add Idea Hub notice to the WP dashboard widget.
IB :heavy_check_mark:
@johnPhillips I had a look and this is how the notice looks for me:
Basically everything is stacked within the notice. It kinda makes sense because in the designs, the width is 590px whereas when I tested the widget width is 447px. I do think however that even at 447px, the content should not stack. One suggestion of how the widget can be is like this:

On small screens I think the content can remain stacked. @Pratheep-lab @aaemnnosttv @felixarntz Curious to know your thoughts on that.
QA: Waiting for UX.
@asvinb @Pratheep-lab CC @felixarntz Yes, this was my best guess as to how it might work on a narrower viewport when the content can't simply be inline like the design. I just let it wrap as the container got narrower so that each part (logo, text, 'view') stacked one after the other.
Asvin's suggestion is a good one and occurred to me but I wondered whether keeping the columns like that would still work on mobile with more verbose translations?
Anyway, very happy to adjust as advised, just let me know.
Might I also add a thought: do we really need the 'view', since the whole text is a link anyway?
@asvinb Good catch! The CTA of that notice should always be on the right side. The above-proposed solution to stack just the copy in the middle is good. Another issue here is that the copy and the CTA look almost the same and that is not a good practice. Hence, I have changed the copy to regular font and made CTA uppercase medium font. Use this style unless you want the whole notice to be clickable.