-
Notifications
You must be signed in to change notification settings - Fork 322
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
Add share feature #921
Add share feature #921
Conversation
b25b7aa
to
c59e1af
Compare
browser.storage.local.set({[key]: countOfContainerTabsOpened}); | ||
|
||
// When the user opens their _ tab, give them the achievement | ||
if (countOfContainerTabsOpened === 5) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NEED TO BUMP THIS TO 500 BEFORE MERGE!
webextension/js/popup.js
Outdated
} | ||
}, | ||
|
||
async setAchievementDone(achievementName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to figure out better logic here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the logic. This is ready to review and spot-check now, @jonathanKingston
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So done means "read" essentially? It's a little confusing in name between getting the achievement and marking it done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Essentially ... I put "Done" on the button because the user has to actually click it to clear the achievement. (Hopefully after they rate/tweet/share) So "Done" means whatever the user chooses to do: just read it, or read + rate, or read + share, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll probably keep the name; setAchievementRead
would imply that the user only has to see the achievement for it to go away.
2662f9c
to
6287bb1
Compare
Lets make it 100 container tabs when this hits release users. |
Also, how are we counting? Any tab with a usercontextId!=0? There are many entrypoints for opening container tabs, so better to count the tabs than the entrypoints. |
It's counting any container tab opened by any of the entry points when the user context is not |
6287bb1
to
2d6bccc
Compare
@@ -120,6 +128,29 @@ const messageHandler = { | |||
}); | |||
}, | |||
|
|||
async incrementCountOfContainerTabsOpened() { | |||
const key = "containerTabsOpened"; | |||
const count = await browser.storage.local.get(key); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can use get({[key]: 1})
right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of the presence checking below etc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated.
// Don't count firefox-default, firefox-private, nor our own confirm page loads | ||
if (tab.cookieStoreId !== "firefox-default" && | ||
tab.cookieStoreId !== "firefox-private" && | ||
tab.url.indexOf("confirm-page.html") === -1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we check instead for moz-extension protocol instead perhaps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
e8f38ab
to
6c59ac1
Compare
I left two comments which would be cool if we could fix those to be a little simpler. If you could add a comment explaining when achievements are gathered and "done" too just for future when we forget. Other than that everything looks fine, I haven't tested at the moment though. |
6c59ac1
to
659277f
Compare
Updated. @SoftVision-EmilPasca - it's a tedious task, but could you test this branch that the achievement panel shows in the pop-up after opening 100 container tabs? (Easiest way is probably to assign a site to automatically open in a container, "Remember my decision", and then just open tabs to that site very quickly.) |
@groovecoder I have made a build from add-share-feature branch and tested on Windows 10 x64, Mac 10.12 and Ubuntu 14.04 with the latest Firefox release (56.0.2), the latest Nightly (58.0a1-20171030103605) and latest Beta(57.0b13-20171030163911). I have tried different scenarios in which I've created 100 container tabs or more using combinations of custom and default containers, hidden container tabs, non-container tabs, using multiple windows, private windows, different sessions or disabling/enabling the add-on and restarting the browser. During testing I've observed that the "achievement panel" is successfully shown regardless of the scenarios above if a number of 100 container tabs have been reached by the user. If you think there are any more scenarios which I haven't covered, please let me know. |
That's great, thanks @SoftVision-EmilPasca ! |
@jonathanKingston can I get an r+ here now? |
Out of interest why are we using shortened urls for the sharing links? Also these have a mac utm in their source?
... more to come end of train ride. |
Yeah, I'm not super-happy with it. But the |
1.
Hmm that is odd, anyway can we change the "mac" part, unless there is an explanation for it? The code is in the assignManager, feel free to take the output and hard code it into the HTML
2. 3. 4.
5. 6. I would use:
Other than that we are all good, feel free to merge after these 6. |
659277f
to
15bf301
Compare
|
15bf301
to
1e33637
Compare
What happens if a user clicks "Tweet". Is the tweet content pre-populated for them to share or manually edit? |
It's pre-populated but the user can change/update the text if they want. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM :) if you could file those follow ups that would be great. Should be possible to mark them as good first bug too.
To spot-check ...