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

Idea Hub: Improve UI for Draft Post button and link #4266

Closed
wpdarren opened this issue Oct 25, 2021 · 10 comments
Closed

Idea Hub: Improve UI for Draft Post button and link #4266

wpdarren opened this issue Oct 25, 2021 · 10 comments
Labels
Good First Issue Good first issue for new engineers Module: Idea Hub Google Idea Hub module related issues P1 Medium priority Type: Enhancement Improvement of an existing feature

Comments

@wpdarren
Copy link
Collaborator

wpdarren commented Oct 25, 2021

Bug Description

On the Idea hub widget, in the 'New ideas' tab, when you click on the start a draft post icon, you will notice that it has low contrast on hover.

Then, go to the Drafts tab, the idea will appear and next to it is a View draft link. It looks like a hybrid hyperlink/button (underlined, title-case, text on button-like background) and the text looks smaller than other links, but is same size as other source links (12px).

These are UI issues addressed in the bug bash.

https://app.asana.com/0/1200491083500938/1200759450014524/f


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

Acceptance criteria

  • The Idea Hub widget should be updated so that, instead of using the "View draft" text for the button/link to view a previously created draft, the button should be an icon button like for the other actions in this widget (still using "View draft" as tooltip/for accessibility).

Implementation Brief

  • Export the icon (the document with an eye on it) from Figma and save it as assets/svg/icons/idea-hub-view.svg.

Within assets/js/modules/idea-hub/components/dashboard/DashboardIdeasWidget/Idea.js:

Within assets/js/modules/idea-hub/components/dashboard/DashboardIdeasWidget/utils.js:

  • Import the new idea-hub-view.svg icon as ViewIcon.
  • Add the property [ IDEA_HUB_BUTTON_VIEW ]: ViewIcon to the activityIconMap object.

Within assets/sass/components/idea-hub/_googlesitekit-idea-hub-dashboard-ideas-widget.scss:

			button,
			.mdc-button,

Test Coverage

  • No new tests needed.

QA Brief

  • Activate Idea Hub and navigate to the "Saved" tab

The tab, with content, should match the Figma mocks:

CleanShot 2022-03-04 at 00 42 59

Changelog entry

  • Update the View draft button on the Idea Hub widget to display an icon instead of the text.
@wpdarren wpdarren added Module: Idea Hub Google Idea Hub module related issues Type: Enhancement Improvement of an existing feature labels Oct 25, 2021
@aaemnnosttv aaemnnosttv added the P1 Medium priority label Nov 2, 2021
@felixarntz
Copy link
Member

@wpdarren @aaemnnosttv @marrrmarrr Correct me if I'm wrong, but I'm not sure we've defined a proper solution for those UI problems. This may need some input from UX for best path to move forward, unless we can use some uncontroversial straightforward fix for all the issues that relies on current Site Kit UI patterns?

@aaemnnosttv
Copy link
Collaborator

@felixarntz probably the simplest fix would be to replace the text button with a circular icon button that we use in the other tabs. An "eye" icon for view would work well I think and the "View draft" could stay as the tooltip. This would make the layout more consistent with others as well.

@felixarntz
Copy link
Member

@marrrmarrr What are your thoughts on this? How do you feel about @aaemnnosttv's suggestion? Should we involve UX in this?

@tofumatt tofumatt added the Good First Issue Good first issue for new engineers label Nov 15, 2021
@marrrmarrr
Copy link
Collaborator

I'll check in with Sam on this one; the eye icon in general sounds good, but I'm conscious that soon we'll be using it for the "view-only" dashboard up top, so we could have a group of users that see it in both places and it would mean two different things.

@tofumatt
Copy link
Collaborator

The IB here mostly looks good, but there's mention of removing the __( 'View draft' ) text, without restoring it anywhere.

The SVG icon can't be used directly in-place of the button text, or the element will be inaccessible to keyboard/screenreader users.

Can you update the IB to include either an aria-label or similar for the button? I'm not sure how it's done in that component currently but it should match what we do for other buttons.

(If none of those icons are labeled for assistive technology, we should implement that as part of this issue.)

@tofumatt tofumatt assigned techanvil and unassigned tofumatt Jan 31, 2022
@techanvil
Copy link
Collaborator

The IB here mostly looks good, but there's mention of removing the __( 'View draft' ) text, without restoring it anywhere.

The SVG icon can't be used directly in-place of the button text, or the element will be inaccessible to keyboard/screenreader users.

Can you update the IB to include either an aria-label or similar for the button? I'm not sure how it's done in that component currently but it should match what we do for other buttons.

(If none of those icons are labeled for assistive technology, we should implement that as part of this issue.)

Hi @tofumatt, thanks for reviewing this. The button already has a title attribute, as do the other Idea Hub buttons. The attribute text is determined by this map:

export const titlesMap = {
[ IDEA_HUB_BUTTON_DELETE ]: __( 'Dismiss', 'google-site-kit' ),
[ IDEA_HUB_BUTTON_PIN ]: __( 'Save for later', 'google-site-kit' ),
[ IDEA_HUB_BUTTON_UNPIN ]: __( 'Remove from saved', 'google-site-kit' ),
[ IDEA_HUB_BUTTON_CREATE ]: __( 'Start a draft post', 'google-site-kit' ),
[ IDEA_HUB_BUTTON_VIEW ]: __( 'View draft', 'google-site-kit' ),
};

And, set here on the Button:

return (
<Button
className={ classNamesMap[ activity ] || undefined }
onClick={ onClick }
disabled={ inProgress }
href={ href || undefined }
icon={
inProgress ? <CircularProgress size={ 24 } /> : <ActivityIcon />
}
title={ titlesMap[ activity ] }
>
{ children }
</Button>

@techanvil techanvil assigned tofumatt and unassigned techanvil Feb 1, 2022
@tofumatt
Copy link
Collaborator

tofumatt commented Feb 1, 2022

Oh, perfect, right on!

In that case this is good-to-go, thanks for the clarification on that one 👍🏻

IB ✅

@tofumatt tofumatt removed their assignment Feb 1, 2022
@tofumatt tofumatt assigned tofumatt and unassigned tofumatt Mar 3, 2022
@hussain-t hussain-t self-assigned this Mar 4, 2022
@hussain-t
Copy link
Collaborator

@tofumatt I don't see a PR associated to this ticket. I checked the pull requests tab filtered by your name, however, I couldn’t see any related PR.
https://github.com/google/site-kit-wp/pulls/tofumatt

@hussain-t hussain-t removed their assignment Mar 4, 2022
@tofumatt
Copy link
Collaborator

tofumatt commented Mar 4, 2022

Argh, VSCode didn't submit the PR, my bad! 😓

I've sent it through now. 😅

@tofumatt tofumatt assigned hussain-t and unassigned tofumatt Mar 4, 2022
@hussain-t hussain-t removed their assignment Mar 6, 2022
@wpdarren wpdarren self-assigned this Mar 8, 2022
@wpdarren
Copy link
Collaborator Author

wpdarren commented Mar 8, 2022

QA Update: ✅

Verified:

  • Confirmed that the icon appears on the draft tab with a tooltip of 'View draft'
  • Confirmed that the icon appears on smaller screen sizes like Android and iOS devices.
  • Confirmed that the user is sent to the post page for the draft

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue Good first issue for new engineers Module: Idea Hub Google Idea Hub module related issues P1 Medium priority Type: Enhancement Improvement of an existing feature
Projects
None yet
Development

No branches or pull requests

8 participants