-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Conversation
d3a26a4
to
af9803d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## Test case 1: | ||
|
||
1. Open emoji dropdown. | ||
2. Move focus (blue rectangular border) to `nature and animals` group. |
There was a problem hiding this comment.
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: ???
There was a problem hiding this comment.
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.
There was a problem hiding this 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. |
There was a problem hiding this comment.
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: ...
.
tests/plugins/emoji/dropdown.js
Outdated
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 { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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?
tests/plugins/emoji/dropdown.js
Outdated
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 { |
There was a problem hiding this comment.
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.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
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 |
There was a problem hiding this 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:
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:
Compared to the former:
Although it was improved for OSX. Can we have it looking well on both systems?
I'll ask @dkonopka for help here, and verifying my observations as I might be missing something here. |
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 😄 |
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:
I'll adjust that during the review. |
Based on discussion here: #2670 (comment).
There was a problem hiding this 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
…png file to be coherent with that change.
… not clean up in case of fialure.
Translation were applied to paths usd in SVG so there are no longer reuired to be checked by test.
There was simple issue in SVG, which breaks its render under Edge, and FF. Chrome somehow ignore this issue. |
There was a problem hiding this 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.
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
What changes did you make?
Close #2572