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

Menus: add icons for move / cancel buttons in menu edit #729

Closed
wants to merge 2 commits into from

Conversation

sendilkumarn
Copy link
Contributor

Added icons for move / cancel in menu edit also added a new class to Ok button in that page.

fix #25

@lancewillett
Copy link
Contributor

Hi sendilkumarn — thank you for this contribution. Could you please add a before / after screenshot for visual reference? That's really helpful.

Note: we'd also like to use Gridicons instead of Noticons for the icons.

@lancewillett lancewillett changed the title added icons for move / cancel buttons in menu edit Menus: add icons for move / cancel buttons in menu edit Nov 25, 2015
@sendilkumarn
Copy link
Contributor Author

image

This is the screenshot with noticons, Let me share a screenshot with gridicons if you are okay with this model.

@sendilkumarn
Copy link
Contributor Author

@lancewillett Please find the gridicons sample attached, I also committed the changes

image

Also, have added tooltip as label for these buttons.

#25

@lancewillett
Copy link
Contributor

CC @folletto for a review.

@lancewillett lancewillett added the [Status] Needs Design Review Add this when you'd like to get a review / feedback from the Design team on your PR label Nov 30, 2015
@folletto
Copy link
Contributor

Hi! Thanks for your help there!

About issue #25, could you limit this PR to just the switch to Gridicons and the button alignment? The reason is that icon only makes the buttons obscure on meaning, which impacts the usability and effectiveness of the UI. This means that, with a few exceptions (like the trash can icon) due to clarity or reduced usage, we try to always use text labels, or text labels and icon together.

If you want to read more about it, check the article on NNG "Icons Usability" as a starting point.

So, we can proceed to merge this issue if:

  1. The trash gets a Gridicon
  2. The alignment bug from Menus: update icons to Gridicons #25 is fixed
  3. The buttons with labels will stay as labels

Thank you!

@sendilkumarn
Copy link
Contributor Author

@folletto

Taken that into consideration, i added tooltip for those buttons.

If not okay lemme change that and recommit them again

@folletto
Copy link
Contributor

Tooltips are not enough unfortunately. Many user don't even know they exist (they are mostly for experts, ironically) and on touch devices they are overall invisible.

@sendilkumarn
Copy link
Contributor Author

Okay let me recommit with those changes

@sendilkumarn
Copy link
Contributor Author

screen shot 2015-12-01 at 1 36 57 am

updated

@folletto
Copy link
Contributor

Ok, tested on Chrome, Safari, Firefox, Edge, IE11. 👍
Design wise it's ok. :)

If you want to add a nice extra, mark the trash icon with the is-scary class, which makes it red. ;)

@folletto folletto added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. and removed [Status] In Progress [Status] Needs Design Review Add this when you'd like to get a review / feedback from the Design team on your PR labels Nov 30, 2015
@sendilkumarn
Copy link
Contributor Author

Thought of adding that, but somehow decided against it.
Will add that, it does give a nice ui.

@sendilkumarn
Copy link
Contributor Author

screen shot 2015-12-01 at 2 19 21 am

@folletto
Copy link
Contributor

Just is-scary, no primary. There's already a primary button there. :)

This:

screen shot 2015-11-30 at 18 23 41

@sendilkumarn
Copy link
Contributor Author

I thought design wise that will be odd. Are you sure that you need something like that?

@folletto
Copy link
Contributor

That's our current design pattern for the whole of Calypso.
Regardless, full red would be ovewhelming. :)

@sendilkumarn
Copy link
Contributor Author

screen shot 2015-12-01 at 2 31 25 am

@folletto
Copy link
Contributor

Design: 👍

@sendilkumarn
Copy link
Contributor Author

@folletto I have also merged the code.

var className = ( this.props.className || '' ) + ' button',
icon =this.props.icon, gridiconButton = "";

if(icon) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The whitespace is not quite right here. Take a look at the spacing guidelines.

@seear
Copy link
Contributor

seear commented Dec 1, 2015

The code looks great—just a few minor style issues to fix. In particular, make sure tabs are used to indent lines.

onClick: this.remove
},
{
key: 'move',
label: this.translate( 'Move', { textOnly: true } ),
label: this.translate( 'Move' ),
Copy link
Member

Choose a reason for hiding this comment

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

We need to keep the { textOnly: true } option, otherwise the translator code will wrap the label in an element.

@sendilkumarn
Copy link
Contributor Author

@seear updated the code please advise if something else needs to be changed.

@sendilkumarn
Copy link
Contributor Author

@ehg Thanks, Will update the same.

@@ -24,9 +25,17 @@ var siteMenus = require( 'lib/menu-data' ),
var Button = React.createClass({
render: function() {
var className = ( this.props.className || '' ) + ' button';
var icon = this.props.icon;
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this var is necessary, we can just use this.props.icon, since it's only used in two places.

@seear
Copy link
Contributor

seear commented Dec 1, 2015

@sendilkumarn we still have spaces here instead of tabs for line indentation, so the lines aren't aligned correctly:
screen shot 2015-12-01 at 12 01 21

You may need to adjust some settings in your editor?

@sendilkumarn
Copy link
Contributor Author

@seear can you please let me know in which editor you check? I have used Atom / sublime text both shows correctly in editor but not when uploaded

@sendilkumarn
Copy link
Contributor Author

@seear / @ehg Sorry for any inconvenience caused. I just updated with github editor. I think it is coming correctly. Please let me know still any discrepancy.

Again apologies.

@@ -24,9 +25,16 @@ var siteMenus = require( 'lib/menu-data' ),
var Button = React.createClass({
render: function() {
var className = ( this.props.className || '' ) + ' button';
var gridiconButton = '';

if( icon ) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm getting an error here, we likely need to use this.props.icon.

@ehg
Copy link
Member

ehg commented Dec 2, 2015

This is looking good :) There are still some mixed tabs and spaces, though.

If you're using Atom, it will help a lot to install an .editorconfig plugin and an eslint plugin — which will automatically configure your editor to use tabs, and warn you about coding style violations, respectively.

Sublime also has similar plugins.

@sendilkumarn
Copy link
Contributor Author

@ehg thanks, you want me to change this merge after installing those plugin. In github page the code is neatly aligned.

@ehg
Copy link
Member

ehg commented Dec 3, 2015

you want me to change this merge after installing those plugin

Yes please! In the GitHub diff it looks fine, but in my editor the alignment is off. I've highlighted the tab characters to illustrate. The warning symbols on the left are from eslint.

screen shot 2015-12-03 at 09 58 50

@sendilkumarn
Copy link
Contributor Author

For me it is showing no errors now :(

screen shot 2015-12-03 at 6 30 21 pm

these are the things that I have used.

@ehg
Copy link
Member

ehg commented Dec 3, 2015

I just installed atom for the first time. These are my packages:

screen shot 2015-12-03 at 11 02 08

This is what I see after I restart atom:
screen shot 2015-12-03 at 10 59 59

@sendilkumarn
Copy link
Contributor Author

Thanks a lot @ehg

Really appreciate your patience. Have updated and there was no errors in my atom now.

return (
<button className={ className } onClick={ this.props.onClick }>
<button className={ className } onClick={ this.props.onClick } title={ this.props.title }>
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we're using title here? :)

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

@ehg
Copy link
Member

ehg commented Dec 3, 2015

This looks great! Thanks for fixing some of the other eslint errors :)

Before we merge this, it's good practice to squash the commits, so our history looks clean. You can also edit the commit message to something more accurate/descriptive.

changed icons into text

added is-scary to delete button

removed is-primary from delete button

aligning to style guide

added textonly true

identation problems

identation updates

formatting

formatted

title removed
@ehg ehg added [Status] Needs Author Reply and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Dec 4, 2015
@sendilkumarn
Copy link
Contributor Author

@ehg Squashed the commits

@lancewillett lancewillett added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. and removed [Status] Needs Author Reply labels Dec 17, 2015
@ehg
Copy link
Member

ehg commented Dec 17, 2015

Moving this to #1739

@ehg ehg closed this Dec 17, 2015
@ehg ehg removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Dec 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Menus: update icons to Gridicons
5 participants