Skip to content

[Stats Refresh] StatsViewModels: Replace default search engine icon - #11674

Merged
ScoutHarris merged 2 commits into
developfrom
issue/11080-search-referrers-icon
May 20, 2019
Merged

[Stats Refresh] StatsViewModels: Replace default search engine icon#11674
ScoutHarris merged 2 commits into
developfrom
issue/11080-search-referrers-icon

Conversation

@frosty

@frosty frosty commented May 10, 2019

Copy link
Copy Markdown
Contributor

Refs #11080.

I took an attempt at replacing the search engine icon with a Gridicon as referenced in the issue above.

I figured the view model would be the best place for it, as that's all about transforming the data into the correct format to view. I also opted to switch on the existing icon URL filename instead of the referrer title, as I thought that would change for different locales.

I don't love that it's duplicated in two places, although the rest of the method is already duplicated. If we were to use this in more places, then maybe extracting it somewhere else would make sense. But if you have any suggestions for improvements, or you'd tackle this a different way, let me know!

Before

Screenshot 2019-05-10 at 11 00 43

After

Screenshot 2019-05-10 at 10 37 45

To test:

  • Build and run, navigate to search referrers in Stats, and check it looks as above.

@frosty frosty added this to the 12.5 milestone May 10, 2019
@frosty
frosty requested a review from ScoutHarris May 10, 2019 10:01
@ScoutHarris

Copy link
Copy Markdown
Contributor

Hey @frosty .

The only issue is the image is a bit too big.

StatsTotalRow bases the image size on what type it is. Since you're using the icon parameter, the image size is 24x24. The Referrer icons are meant to be 20x20, which is intrinsic to the socialIconURL param.

The complication is that, before this, all Referrer icons were downloaded, and thus the size is tied to this bit of logic, in StatsTotalRow.configureIcon:

        if let iconURL = rowData.socialIconURL {
            imageWidthConstraint.constant = Constants.socialImageSize
            downloadImageFrom(iconURL)
        }

@ScoutHarris ScoutHarris mentioned this pull request May 10, 2019
45 tasks
@ScoutHarris ScoutHarris modified the milestones: 12.5, 12.6 May 18, 2019
@ScoutHarris ScoutHarris changed the title StatsViewModels: Replace default search engine icon [Stats Refresh] StatsViewModels: Replace default search engine icon May 18, 2019

@ScoutHarris ScoutHarris left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'll go ahead and approve this. I'll address the image size issue separately.

@ScoutHarris
ScoutHarris merged commit d05cb73 into develop May 20, 2019
@ScoutHarris
ScoutHarris deleted the issue/11080-search-referrers-icon branch May 20, 2019 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants