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
More beautiful (and vectorised?) icons for browsers, operating systems, device types, device plugins #10587
Comments
This is bugging me more than ist should. I have collected all current browser logos in the best possible resolution and written a script to convert them to transparent 16x16 png images:
I only have updated the images from I am always open to ideas and better images. |
Awesome, do you know how to issue a pull request? |
Im glad you like it. That about the image size? Some were 14x14px others were 16x16px before. |
Yes we are very interested @Findus23 - this will make a huge difference in the Piwik design & experience! 🎉 |
Probably 16px is better (bigger is better, right?) |
I can only agree, but the question is if there are side effects. The mobile Apps don't seem to have any problems with larger icons: |
Good point. feel free to add the vertical alignment there in the visitor profile and where it's missing. if you don't know how we can add it later as well. |
Now that the browser and OS icons (#11063) and the referrers icons (#11093) are updated, I looked at the other icons in Piwik:
|
I guess there is no good reason for using ico, nur sure why that was done in the first place. |
BTW: Mobile app assumes and renders all icons at 14x14 in Visitor screen. In the Visitor Overview (screenshot above) it uses "width: 18 & height: 12," for country flag, width: 14 & height: 14 for browser icon and width: 14 & height: 14 for browser icon. A dimension needs to be specified in the mobile app otherwise it can end up messy. Is there a chance you guys can upload the images in twice or triple the size? eg 48x48 or 32x32 instead of 16x16? This way it will look good on retina screens and much better in mobile app (we had few complaints) |
That was the original reason why I collected the source images in the best possible resolution and converted them afterwards. See https://github.com/Findus23/device-icons) Creating additional sizes is just modifying a few lines in a bash script. The question is just how to implement this in Piwik. Maybe a srcset with fallback to the highest resolution (for IE)? |
@Findus23 well done, will prove to be very useful!
|
There would be no srcset needed. As @mattab says one size eg 48x48 would be good and then let browser resize it. We would only need to make sure to specify a size in Piwik everywhere when we show icons (which we maybe already do) |
You are right. One size is the simplest solution and the images are only about three times larger. |
One additional thought: Should I upscale smaller images to 48x48 (which makes it more predictable) or keep them at the source size (which keeps the quality) |
I would probably keep the smaller size but might be also good to have all the images in same size. I'd go with leaving it small so we know which ones have low res etc |
Awesome 👍 |
I have now updated all pull requests, hoping that I didn't miss a place where the icons are used without a defined size. I also tested the Mobile Apps and it seems like they don't have an issue with larger icons. But it seems like they are cached for quite a long time. I am often seeing old icons next to new ones. |
After some testing it seems like changing the datatables via CSS is a bad idea as it also influences the other icons (example) So the better solution would be to replace e.g. <img title='Windows Vista' alt='Windows Vista' src='plugins/DevicesDetection/images/os/WIN.png' /> with <img width='16px' height='16px' title='Windows Vista' alt='Windows Vista' src='plugins/DevicesDetection/images/os/WIN.png' /> in http://localhost/piwik/index.php?module=DevicesDetection&action=getOsVersions&idSite=1&period=month&date=2017-01-03 (and similar reports. But after searching for some time I wasn't able to find the template for these reports. Could you help me? |
See https://github.com/piwik/piwik/blob/3.x-dev/plugins/CoreHome/templates/_dataTableCell.twig#L46 and https://github.com/piwik/piwik/blob/3.x-dev/plugins/Morpheus/templates/macros.twig#L1-L17 |
As I am missing the context I can only suggest the following "hack", which seems to work (I haven't run the tests): Replace https://github.com/piwik/piwik/blob/3.x-dev/plugins/Morpheus/templates/macros.twig#L3-L11 with {% set width %}width="{{ metadata['logoWidth']|default("16px") }}"{% endset %}
{% set height %}height="{{ metadata['logoHeight']|default("16px") }}"{% endset %} |
fyi the HTML scheduled reports icons are loaded here: https://github.com/piwik/piwik/blob/master/plugins/CoreHome/templates/ReportRenderer/_htmlReportBody.twig#L50-L53 So maybe we can simply add the width/height to this |
as @sgiehl said I think the only code to change is this macro linked above. @Findus23 do you want to try to change this code to set the width/height according to the metadata width/height? if you can't or don't know how to, let us know and we'll help, so this awesome PR can be finalised 👍 |
@mattab I have now fixed the HTML reports (b06679a) As for the macros (datatable) I'd rather have you make the changes as I am missing the context (where does the logoWidth come from?), so I could only change it locally. Other then this all pull requests are ready to be merged. |
@Findus23 I'm not sure if setting the height and width in the metadata would be a proper solution. |
@sgiehl You are right. I didn't think about max-*. |
@sgiehl, the UI test showed that it isn't perfect, as it also affect the dataTableRowActions (http://builds-artifacts.piwik.org/piwik/piwik/3.x-dev/21907/ActionsDataTable_pageview_percentages.png) I have now added a max-size for them: d2976b0 |
@Findus23 Ok. Would you also check if |
@sgiehl done |
Is this because of my change? |
@Findus23 awesome. No that started failing before |
Now we could try to get the other tests fixed if you don't mind. Fixing the System tests should be easy, they are failing because the expected files are outdated. As some of them include the path to the icons they need to be adjusted. Maybe we could use a regex to replace them all in one. If you have Git LFS running, you could also update the UI tests - where the changes are expected. Simply download the processed file from the build-artifacts and overwrite the one in |
I guess I'll need your help as I am not familiar with unit tests (except for reading error messages and trying to solve them) btw: You can directly edit the pull request by pushing to the browser-icons branch on Findus23/piwik. |
No need to set up the tests locally... test output on travis should already indicate which files to change. |
@sgiehl unfortunately that are a few thousand lines and I can't just replace "gif" with "png" as there are still some icons left as gif. |
Shall we leave this one open for further improvements? |
Either that or open a new issue. There are still many images missing, of which I'll may update some (#10587 (comment)) But there are lots of single icons (e.g. for buttons) that should be recreated in better quality. (which I can't do) |
Well done @Findus23 for your great work 👍 it really makes a difference in user experience and happiness. Users will notice! Would be great to create a new separate issue to consolidate the follow up work you've identified (missing icons etc). Closing this now as it was merged. We are so looking forward to your next contributions 💯 |
Thanks, I'm curious what the feedback will be. Ping me if somebody has better images. I'll create a followup about the other icons. |
Our goal is to make Piwik look awesome and beautiful. A big part of this is to use beautiful icons in the application. So far we have many nice icons, but we ideally need to complete the work and make all icons look great.
(PiwikPro company offered long time ago to contribute but haven't heard anything since.)
Is someone keen to work on this project?
The text was updated successfully, but these errors were encountered: