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

Correct styles for emoji dropdown #2670

Merged
merged 16 commits into from
Feb 13, 2019
Merged

Correct styles for emoji dropdown #2670

merged 16 commits into from
Feb 13, 2019

Conversation

msamsel
Copy link
Contributor

@msamsel msamsel commented Dec 11, 2018

What is the purpose of this pull request?

bug fix

Does your PR contain necessary tests?

All patches which change the editor code must include tests. You can always read more
on PR testing,
how to set the testing environment and
how to create tests
in the official CKEditor documentation.

This PR contains

  • Unit tests
  • Manual tests

What changes did you make?

  • improve style for emoji dropdown:
    • group svg icons, are now centred
    • Statusbar icon is moved a little bit to bottom, which visually looks much better

Close #2572

@msamsel msamsel force-pushed the t/2572 branch 2 times, most recently from d3a26a4 to af9803d Compare December 12, 2018 08:48
@mlewand mlewand added the review:easy Pull requests that can be reviewed by a Junior Developer before being reviewed by the Reviewer. label Dec 28, 2018
@engineering-this engineering-this self-assigned this Dec 28, 2018
Copy link
Contributor

@engineering-this engineering-this left a comment

Choose a reason for hiding this comment

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

Test fails on Edge and IE:

screenshot 2018-12-28 at 15 06 13

## Test case 1:

1. Open emoji dropdown.
2. Move focus (blue rectangular border) to `nature and animals` group.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd add information on how to focus, eg:
Desktop: Press Shift+Tab, then use arrow keys to navigate to group.
Android: Long touch on group.
iOS: ???

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've ignored this test on mobiles.

Copy link
Contributor

@engineering-this engineering-this left a comment

Choose a reason for hiding this comment

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

Looks good, just two small things.

CHANGES.md Outdated

Fixed Issues:

* [#2572](https://github.com/ckeditor/ckeditor-dev/issues/2572): Fixed: [Emoji](https://ckeditor.com/cke4/addon/emoji) dropdown styles improvement: icons in navigation groups are centred and preview in statusbar has better top margin.
Copy link
Contributor

Choose a reason for hiding this comment

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

Fixed: Emoji dropdown styles improvement: icons in navigation groups are centred and preview in statusbar has better top margin.

This sounds odd. Improvement is not something that is being fixed.

IMO it should be either: Fixed: dropdown styles: ...
or moved to Other changes section, and changed to: Improved: dropdown styles: ....

assert.areSame( translations[ li.data( 'cke-emoji-group' ) ].y || 0, parseFloat( values[ 2 ] || 0 ),
'Translation in Y axis for group: "' + li.data( 'cke-emoji-group' ) + '" is incorrect.' );
}
} finally {
Copy link
Contributor

@engineering-this engineering-this Jan 10, 2019

Choose a reason for hiding this comment

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

Do we need try/finally blocks? Panel could be hidden before for loop, and it still should work, as element is still living in DOM tree, it is hidden with CSS style.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

try/finally is used in those test to clean up after test case run
Panels are not available in any variable, that's why cleanup in teardown method is not possible. I consider as a good practice to clean up after a test case.
In case that test breaks, error will stop running given test case, so panel windows might remain open. This potentially could influence on further test cases. That's why I use try/finally to have sure that panel window will be closed even though test case fail.

Copy link
Contributor

Choose a reason for hiding this comment

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

What I meant is to move code from finally block panel.hide(); to be executed right before for loop. This shouldn't break assertions, as elements are still in DOM. And as panel is hidden before asserting then fails wouldn't interfere with any following tests.

See:
https://github.com/ckeditor/ckeditor-dev/blob/b4f20e13fee07ca069db112435c4a9f7868cd79a/tests/plugins/emoji/dropdown.js#L355-L370

Additionally there are three test suites that doesn't cleanup when fail.
https://github.com/ckeditor/ckeditor-dev/blob/t/2572/tests/plugins/emoji/dropdown.js#L74
https://github.com/ckeditor/ckeditor-dev/blob/t/2572/tests/plugins/emoji/dropdown.js#L142
https://github.com/ckeditor/ckeditor-dev/blob/t/2572/tests/plugins/emoji/dropdown.js#L164

Could we correct them?

assert.areSame( translations[ li.data( 'cke-emoji-group' ) ].y || 0, parseFloat( values[ 2 ] || 0 ),
'Translation in Y axis for group: "' + li.data( 'cke-emoji-group' ) + '" is incorrect.' );
}
} finally {
Copy link
Contributor

Choose a reason for hiding this comment

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

What I meant is to move code from finally block panel.hide(); to be executed right before for loop. This shouldn't break assertions, as elements are still in DOM. And as panel is hidden before asserting then fails wouldn't interfere with any following tests.

See:
https://github.com/ckeditor/ckeditor-dev/blob/b4f20e13fee07ca069db112435c4a9f7868cd79a/tests/plugins/emoji/dropdown.js#L355-L370

Additionally there are three test suites that doesn't cleanup when fail.
https://github.com/ckeditor/ckeditor-dev/blob/t/2572/tests/plugins/emoji/dropdown.js#L74
https://github.com/ckeditor/ckeditor-dev/blob/t/2572/tests/plugins/emoji/dropdown.js#L142
https://github.com/ckeditor/ckeditor-dev/blob/t/2572/tests/plugins/emoji/dropdown.js#L164

Could we correct them?

@engineering-this engineering-this removed their assignment Jan 21, 2019
@msamsel msamsel assigned msamsel and unassigned msamsel Jan 21, 2019
@engineering-this engineering-this self-assigned this Jan 22, 2019
Copy link
Contributor

@engineering-this engineering-this left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@mlewand
Copy link
Contributor

mlewand commented Jan 23, 2019

I created a preview link for this branch: https://ckeditor4-preview.ckeditor.com/t/2572/plugins/emoji/samples/emoji.html

As a reference of the "old" implementation, here's the major branch: https://ckeditor4-preview.ckeditor.com/major/plugins/emoji/samples/emoji.html

@mlewand mlewand self-requested a review January 23, 2019 12:54
Copy link
Contributor

@mlewand mlewand left a comment

Choose a reason for hiding this comment

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

I have a strong impression that several top bar icons remain still misaligned:

image

Buttons I see issue with are:

  • just minimal misalignment: flags, travels and places
  • major misalignment: credit card, symbols

I will also note that bottom part alignment got worse on Win 10:

image

Compared to the former:

image

Although it was improved for OSX. Can we have it looking well on both systems?

@mlewand
Copy link
Contributor

mlewand commented Jan 23, 2019

I'll ask @dkonopka for help here, and verifying my observations as I might be missing something here.

@msamsel msamsel self-assigned this Jan 28, 2019
@dkonopka
Copy link

dkonopka commented Feb 12, 2019

It's a quite long story (I've been there about a week in ck5), but it's almost impossible to centre svg (especially svg sprites), because every browser, every os, every DPI is an impact in rendering process.

... and we can add another factor which is absolutely positioned dropdown, so if its position is top/bottom/left/right 302.459px each browser is rounding it differently, that's why we have ~1px of difference in svg position 😄

@mlewand
Copy link
Contributor

mlewand commented Feb 12, 2019

All right, thanks @dkonopka for the clarifications. In that case I'll get back to review.

However the tests should say:

Icon has equalish margin between left and right border.

Rather than:

Icon has equal margin between left and right border.

I'll adjust that during the review.

@mlewand mlewand self-requested a review February 12, 2019 14:31
mlewand added a commit that referenced this pull request Feb 12, 2019
Copy link
Contributor

@mlewand mlewand left a comment

Choose a reason for hiding this comment

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

FF@win10, Edge@win10 fails:

  • no svg icons are not displayed in emoji dropdown

This doesn't happen with the latest release: https://ckeditor.com/docs/ckeditor4/latest/examples/mentions.html

@msamsel msamsel self-assigned this Feb 13, 2019
@msamsel
Copy link
Contributor Author

msamsel commented Feb 13, 2019

There was simple issue in SVG, which breaks its render under Edge, and FF. Chrome somehow ignore this issue.

@msamsel msamsel removed their assignment Feb 13, 2019
@msamsel msamsel requested a review from mlewand February 13, 2019 10:49
Copy link
Contributor

@mlewand mlewand left a comment

Choose a reason for hiding this comment

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

LGTM

I had to adjust the changelog.

@mlewand mlewand merged commit 296110e into master Feb 13, 2019
@CKEditorBot CKEditorBot deleted the t/2572 branch February 13, 2019 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review:easy Pull requests that can be reviewed by a Junior Developer before being reviewed by the Reviewer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants