Add pagination to icon picker #13677
Replies: 6 comments
-
@MMasey @nielslyngsoe have you noticed issues with icon picker when having e.g. 1000 or 2000 icons? At the moment I think we only have a single method in C# fetching all icons or a specific icon, but not a paged list of icons? |
Beta Was this translation helpful? Give feedback.
-
If grabbing all icons from here https://remixicon.com and placing these inside In this case with these icons + core icons there are 2743 icons, which it seems to fetch once and the filter the results in I think we should have a
Maybe it would also be useful to filter by group if the icons sometimes later supports this: #8884 (comment) Something similar to |
Beta Was this translation helpful? Give feedback.
-
Hey @bjarnef & @nul800sebastiaan, I've been having a think about this and I think we need to solve a number of other performance problems first, before we consider pagination. I do think some categorisation would be cool though. I think the memory issues are primarily affecting the frontend due to the following reasons.
I'm thinking maybe the icon list needs a fair bit of refactoring, maybe even moving away from using the inline ng-repeat. I think a better solution in terms of updated the DOM in a perfomant way would be to do the following.
This would potentially make it a little easier moving forward as we look at detaching from angular too. In terms of the backend performance there are a few area that could be improved. I think in a previous issue I mentioned about the use of Please let me know if any of that sounds wrong as i'm not 100% sure on all of it. Thanks |
Beta Was this translation helpful? Give feedback.
-
@MMasey yes, the search filter should definitely has some timeout/debounce before filtering either in via In my experience It would be great to load more icons as you scroll down, however I think it would require some kind of paged result, but maybe it is possible to append e.g 100 icons at the times although all icons at the moment is loaded. In this PR https://github.com/umbraco/Umbraco-CMS/pull/9359/files is it doing some Linq queries, but in my test the server side request to get 100 icons were much faster than the current request to get all icons, where I recall it took 1.5+ seconds. Most of the time when opening the icon picker, you probably only need to see a few icons and get more as you scroll or filtering the icons. |
Beta Was this translation helpful? Give feedback.
-
Yeah that all makes sense. I think it should be relatively easy to implement a "paged" approach as you scroll down the page for when all of the icons are present. The complicated part would be when a filter is being used, although we could duplicate the way angular filters for the backend code. Then again, we may end up having some odd issues in regards to concatenating the paginated icons to the collection of icons loaded already. I does feel to me like it's more of a frontend issue then a backend, even if the initial loading of all the icons takes a while. That's not to say improvements can't be made on both sides, I think it's just figuring out which part to attack first. Also it looks like This is certainly a fun problem 😜 |
Beta Was this translation helpful? Give feedback.
-
Hey all, sorry for taking some time to return to this issue 🙈 Reading through, I will convert this to a discussion in case the mentioned functionality is still desired. 🙂 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently the icon picker is one long list of icons, but when having many icons in can be slow. I have previous noticed this when installing font packages, which have a lot of icons, e.g. some of these icon packages:
https://our.umbraco.com/packages/backoffice-extensions/material-design-icon-pack/
https://our.umbraco.com/packages/backoffice-extensions/fontawesome-icon-pack/
https://our.umbraco.com/packages/backoffice-extensions/line-awesome-icon-pack/
With the new feature to include SVG icons, I wonder if we should add pagination here, e.g. 100 per page.
I found this with some free SVG icons:
https://cssauthor.com/free-svg-icons/
One of the mentioned is https://iconhub.io
Performance using angular
ngRepeat
directive can be optimized withtrack by
but in my experience when having e.g. 500-1000+ repeated entries in DOM, it is slowing down depending on the browser.Beta Was this translation helpful? Give feedback.
All reactions