Skip to content
This repository has been archived by the owner on Feb 29, 2020. It is now read-only.

fix (systemaddon): #3111 use screenshots instead of icons for default sites #3124

Merged
merged 1 commit into from
Aug 16, 2017

Conversation

rlr
Copy link
Contributor

@rlr rlr commented Aug 9, 2017

This only fully covers en-US default top sites. @bryanbell says to ship these and the others will come shortly.

r? @Mardak

Fixes #3111

@rlr
Copy link
Contributor Author

rlr commented Aug 9, 2017

Screenshot:

screen shot 2017-08-09 at 3 53 31 pm

@coveralls
Copy link

Coverage Status

Coverage remained the same at 86.407% when pulling 80545cb on rlr:default-sites-screenshots into 8a0aa23 on mozilla:master.

@Mardak
Copy link
Member

Mardak commented Aug 9, 2017

Sounds like "pantsuit nation" will be removed from the facebook one

@@ -46,10 +46,7 @@ class TopSite extends React.Component {
let imageStyle;
if (tippyTopIcon) {
imageClassName = "tippy-top-icon";
imageStyle = {
backgroundColor: link.backgroundColor,
backgroundImage: `url(${tippyTopIcon})`
Copy link
Member

@Mardak Mardak Aug 9, 2017

Choose a reason for hiding this comment

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

Looks like tests want backgroundColor. Could just put empty string (or leave it as undefined) and it should work?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

doh. yeah will just add a guard

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah, leaving as undefined works fine. react ignores it and doesn't render it out 💃

@rlr
Copy link
Contributor Author

rlr commented Aug 9, 2017

haha, @bryanbell says he has a to fix a screenshot. guessing it's that

@rlr rlr force-pushed the default-sites-screenshots branch from 80545cb to 28310c1 Compare August 9, 2017 20:31
@coveralls
Copy link

Coverage Status

Coverage remained the same at 86.407% when pulling 28310c1 on rlr:default-sites-screenshots into 8a0aa23 on mozilla:master.

@rlr
Copy link
Contributor Author

rlr commented Aug 9, 2017

ok, I'll add a [WIP] to the title and a blocked tag we'll wait for the rest.

@rlr rlr changed the title fix (systemaddon): #3111 use screenshots instead of icons for default sites [WIP][Do Not Merge] fix (systemaddon): #3111 use screenshots instead of icons for default sites Aug 9, 2017
@rlr rlr added the Blocked label Aug 9, 2017
@rlr rlr force-pushed the default-sites-screenshots branch from 28310c1 to e43aa55 Compare August 9, 2017 21:55
@coveralls
Copy link

Coverage Status

Coverage remained the same at 86.407% when pulling e43aa55 on rlr:default-sites-screenshots into 6864331 on mozilla:master.

[
{
"title": "amazon",
"urls": ["https://www.amazon.com/", "https://www.amazon.ca/", "https://www.amazon.de/", "https://www.amazon.co.uk/", "https://www.amazon.fr/"],
Copy link
Member

Choose a reason for hiding this comment

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

This won't work because the screenshots have english text in them.

{
"title": "facebook",
"url": "https://www.facebook.com/",
"image_url": "facebook-com@2x.png"
Copy link
Member

Choose a reason for hiding this comment

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

Not sure what we'll do for other languages that use facebook.com, but the screenshot is english.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oy, this is becoming more work than probably expected. Is the country in the redux state somewhere?

Copy link
Member

@Mardak Mardak Aug 10, 2017

Choose a reason for hiding this comment

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

@k88hudson Not sure how long term this change would be, but one quick hack to get geo/country code into content would be to set it as a getValue pref:

getValue: ({geo}) => DEFAULT_SITES.get(DEFAULT_SITES.has(geo) ? geo : "")

["geo", {
  getValue: ({geo}) => geo
}]

And then content can access it via Prefs from the store.

Although, don't you actually want the geo from TopSitesFeed or TippyTopProvider? Those could just directly access Services.prefs.getStringPref("browser.search.region"). But if we do want geo everywhere, it should probably go in store.App alongside locale ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, I would only need it from TippyTopProvider for this. 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems reasonable to access it directly here, but I wonder if we need to solve this issue more broadly for things down the line? adding it to store.Appmakes sense, although ordering would still be an issue I guess

Copy link
Member

@Mardak Mardak left a comment

Choose a reason for hiding this comment

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

Sounds like the desired behavior is to have each country's top sites show the site's country-specific screenshot. We'll need logic to disambiguate facebook.com for US/CA vs facebook.com DE

Mardak
Mardak previously requested changes Aug 11, 2017
Copy link
Member

@Mardak Mardak left a comment

Choose a reason for hiding this comment

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

The current plan is to allow english screenshots for those who share the same domain, e.g., facebook.com. There will be multiple screenshots for amazon as there's amazon.com and amazon.de, etc. This means we don't need to get the country code and just check the domain string.

@Mardak Mardak assigned rlr and unassigned Mardak Aug 11, 2017
@rlr rlr force-pushed the default-sites-screenshots branch from e43aa55 to db6c67d Compare August 16, 2017 12:15
@rlr rlr changed the title [WIP][Do Not Merge] fix (systemaddon): #3111 use screenshots instead of icons for default sites fix (systemaddon): #3111 use screenshots instead of icons for default sites Aug 16, 2017
@rlr rlr assigned k88hudson and unassigned rlr Aug 16, 2017
@rlr rlr removed the Blocked label Aug 16, 2017
@rlr
Copy link
Contributor Author

rlr commented Aug 16, 2017

@k88hudson this is ready to go now. I manually verified locally that all the regions get a resource:// screenshot. final r?

@k88hudson
Copy link
Contributor

Ok this looks great! Let's just wait until #3186 to land this 👍

@k88hudson k88hudson dismissed Mardak’s stale review August 16, 2017 15:06

Picking up this review since Mardak is on PTO

Copy link
Contributor

@k88hudson k88hudson left a comment

Choose a reason for hiding this comment

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

R+

@k88hudson k88hudson merged commit af97cab into mozilla:master Aug 16, 2017
@rlr rlr deleted the default-sites-screenshots branch August 16, 2017 19:58
@as-pine-proxy
Copy link
Collaborator

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants