-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Special characters all / latin categories takes noticable longer time to load than others #6161
Comments
I'm in your group :( The delay is related to the size of the view and for me, it is noticeable. The "all" feels like there's something blocked (guessing its load time is > 500ms or even close to 1s). The "Latin" gives the impression that something might lag but is kinda OK (it is not "instantaneous" like "arrows" or other smaller ones). |
This is very... disturbing. This is the whole timeline: It consists of dozens of: What's even worse: after the recent change to show "All" as the default option, this plugin is now rendering all that on editor init: In other words: most of the editor bootstrap time is now used by special characters button. |
So, the However, if we look closer into where's the time spent in it, there's a room for improvement here: First, it would help a lot for the entire editor if we improved But nevertheless – the very first thing to do is to make sure that rendering this panel does not block rendering the editor: #6175. |
I reported my generic findings in #6178. As for optimizations that can be done here:
|
I checked today and |
And honestly, the best result I came up with was using the following code which utilizes the time the user interaction gives us to perform heavy tasks.
It's now lightning fast. diff --git a/packages/ckeditor5-special-characters/src/specialcharacters.js b/packages/ckeditor5-special-characters/src/specialcharacters.js
index d6ffc606f1..e187a9a6b2 100644
--- a/packages/ckeditor5-special-characters/src/specialcharacters.js
+++ b/packages/ckeditor5-special-characters/src/specialcharacters.js
@@ -94,20 +94,28 @@ export default class SpecialCharacters extends Plugin {
} );
dropdownView.on( 'change:isOpen', () => {
- if ( !dropdownPanelContent ) {
- dropdownPanelContent = this._createDropdownPanelContent( locale, dropdownView );
-
- dropdownView.panelView.children.add( dropdownPanelContent.navigationView );
- dropdownView.panelView.children.add( dropdownPanelContent.gridView );
- dropdownView.panelView.children.add( dropdownPanelContent.infoView );
- }
-
dropdownPanelContent.infoView.set( {
character: null,
name: null
} );
} );
+ dropdownView.buttonView.extendTemplate( {
+ on: {
+ mouseenter: dropdownView.buttonView.bindTemplate.to( () => {
+ if ( !dropdownPanelContent ) {
+ setTimeout( () => {
+ dropdownPanelContent = this._createDropdownPanelContent( locale, dropdownView );
+
+ dropdownView.panelView.children.add( dropdownPanelContent.navigationView );
+ dropdownView.panelView.children.add( dropdownPanelContent.gridView );
+ dropdownView.panelView.children.add( dropdownPanelContent.infoView );
+ } );
+ }
+ } )
+ }
+ } );
+
return dropdownView;
} );
}
@@ -202,12 +210,11 @@ export default class SpecialCharacters extends Plugin {
gridView.tiles.clear();
const characterTitles = this.getCharactersForGroup( currentGroupName );
+ const tileViews = Array.from( characterTitles ).map( title => {
+ return gridView.createTile( this.getCharacter( title ), title );
+ } );
- for ( const title of characterTitles ) {
- const character = this.getCharacter( title );
-
- gridView.tiles.add( gridView.createTile( character, title ) );
- }
+ gridView.tiles.addMany( tileViews );
}
/** |
There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may still be relevant, so if you're interested in the solution, leave a comment or reaction under this issue. |
We've closed your issue due to inactivity over the last year. We understand that the issue may still be relevant. If so, feel free to open a new one (and link this issue to it). |
📝 Provide a description of the improvement
Both categories hangs the browser for a brief (but notable) moment.
Since the special characters plugin is not yet out, it can be checked on nightly docs: https://ckeditor5.github.io/docs/nightly/ckeditor5/latest/features/special-characters.html
Although I'm not convinced it's going to be perceived by most users so I'm just reporting it here.
📃 Other details
master
(iteration 29)If you'd like to see this improvement implemented, add a 👍 reaction to this post.
The text was updated successfully, but these errors were encountered: