Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Added extension badges #7050

Merged
merged 1 commit into from
Apr 3, 2017
Merged

Added extension badges #7050

merged 1 commit into from
Apr 3, 2017

Conversation

jonathansampson
Copy link
Collaborator

@jonathansampson jonathansampson commented Feb 4, 2017

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).

Fixes #5366
Fixes #5367

Test Plan:

  1. Enable the LastPass extension
  2. From chrome-extension://hdokiejnpimakedhajhdlcegeplioahd/tabDialog.html?dialog=createAccountSimple, open Developer Tools (Ctrl+Shift+I)
  3. From console, run chrome.browserAction.setBadgeText({text:"27"})
  4. From console, run chrome.browserAction.setBadgeBackgroundColor({color:'#FF0000'})

badge

@jonathansampson jonathansampson added design A design change, especially one which needs input from the design team. feature/extensions labels Feb 4, 2017
@jonathansampson jonathansampson added this to the 0.13.2 milestone Feb 4, 2017
@bbondy bbondy modified the milestones: 0.13.3, 0.13.2 Feb 5, 2017
@bbondy
Copy link
Member

bbondy commented Feb 5, 2017

Super pumped you did this great work but I have to bump to 0.13.3 because we're past frozen date, sorry about that.

@jonathansampson
Copy link
Collaborator Author

@bbondy No worries; with that added time, I'll do a bit of polishing.

@bbondy
Copy link
Member

bbondy commented Feb 5, 2017

cool thanks, 0.13.3 freeze is Monday end of day, but historically we're bad about respecting the freeze dates :)

@jonathansampson
Copy link
Collaborator Author

@bbondy I'll have my changes in before then :)

@jonathansampson
Copy link
Collaborator Author

@bradleyrichter I put in some logic to center wider badges. Presently, this means anything wider than 20 pixels. Please feel free to polish up any of the styles.

layouts

@bradleyrichter
Copy link
Contributor

@jonathansampson Ok, I found a tiny size that is still legible at 72dpi.

5pt Arial

padding: 1px/2px

Your centering plan should work fine.

When we apply this to the brave logo, we should use a dark grey BG color:

image

@bsclifton
Copy link
Member

@jonathansampson I don't recall seeing an issue for this (cc: @bradleyrichter) but we have an Asana issue captured for a similar badge on the Lion icon too (so that you know how many items blocked). Would you be able to work on that too?

@bridiver
Copy link
Collaborator

Badges? We don't need no stinkin' badges!

@bridiver
Copy link
Collaborator

++ as long as this meets @bradleyrichter's ui specs on all platforms

@alexwykoff
Copy link
Contributor

screen shot 2017-02-21 at 5 07 33 pm

screen shot 2017-02-21 at 5 07 09 pm

Badges are happening!

Didn't notice any for 1pass even though I had logins for the sites, but may be due to the signing thing for local runs vs builds.

My only critique is that I find the value hard to read, but I do recognize that something is there.

My only negative mark is that the pocket icon seems to have regressed.

Will follow up in a moment with test run results from merging latest master. No merge conflicts detected.

@alexwykoff
Copy link
Contributor

1179 tests passed, 39 pending, 6 failed.
All 6 were timeouts and appeared to be of our intermittent variety.

👍 for merge pending review of pocket icon regression ^^

@bridiver
Copy link
Collaborator

@alexwykoff I don't think 1pw has badges. I've never seen any on Chrome or Safari

@bsclifton
Copy link
Member

@alexwykoff are you sure the icon for Pocket regressed? When I run master on Windows (without this patch), I'm seeing that icon too. My guess is that the extension has a new icon (maybe Windows only?) It should be the same in Chrome on Windows

screen shot 2017-02-23 at 12 23 33 am

cc: @srirambv

@srirambv
Copy link
Collaborator

@bsclifton I see it on preview 2 but only on x64 but not ia32 build.
image
image

@srirambv
Copy link
Collaborator

srirambv commented Feb 23, 2017

It seems to be only in Preview 2. Preview 1 has the same icon on both x64 & ia32. Problem with this icon is there is no visual confirmation if the page is saved or not.

@bsclifton
Copy link
Member

bsclifton commented Feb 23, 2017

@jonathansampson could you squash this up and add some testing steps? @alexwykoff has already reviewed, I can check it out too and if 👍 we can merge 0.13.6

@bsclifton bsclifton modified the milestones: 0.13.6, 0.13.5 Feb 23, 2017
@bsclifton bsclifton requested a review from NejcZdovc March 13, 2017 22:41
@bsclifton
Copy link
Member

bsclifton commented Mar 13, 2017

Rebased and squashed; @NejcZdovc, I added you as a review for when you have time 😄

@jonathansampson would you be able to edit the original post here to provide a test plan? Looks like we'll want to manually install Honey and then do something which causes updates to happen. More info is appreciated 😄

@jonathansampson
Copy link
Collaborator Author

@bsclifton I can edit, and add a test plan. What relevance is the update action? To test this, we'd want to install an extension, and confirm that the browser action icon is one from the manifest.browser_action.icons property (whether it be a string, or object).

@bsclifton
Copy link
Member

@jonathansampson sorry- I just meant update as in something that causes the numbers to show inside the icon (like in your screenshot at the top, LastPass has the number 27 in it).

I guess that is a good test- just pick LastPass as the default password manager and add some passwords 😄

Copy link
Contributor

@NejcZdovc NejcZdovc left a comment

Choose a reason for hiding this comment

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

Please use aphrodite and not less

className={cx({
extensionButton: true
})}
inlineStyles={{
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's switch to aphrodite

render () {
return <div
ref='badge'
className='browserActionBadge'
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's use aphrodite

@@ -511,11 +511,37 @@
flex-direction: row;
margin-left: 3px;

.browserActionButton {
Copy link
Contributor

Choose a reason for hiding this comment

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

No more less 😃

@bsclifton
Copy link
Member

@jonathansampson we can help you with the Aphrodite refactor (in fact, @cezaraugusto had put together a really sweet guide which you might find helpful 😄 )

In the meantime, I'll move this to 0.13.7 😄

@bsclifton bsclifton modified the milestones: 0.13.7, 0.13.6 Mar 14, 2017
@NejcZdovc
Copy link
Contributor

@bsclifton @jonathansampson yeah I can help you with it, not a problem

@jonathansampson
Copy link
Collaborator Author

jonathansampson commented Mar 14, 2017

@bsclifton Sorry for the Testing Plan confusion. Half-way through this thread became about a Pocket icon regression. That threw me off.

Test Plan is now added. Essentially, call the two primary APIs from a LastPass extension resource. When enabled, LastPass opens up a chrome-extension: resource for the purposes of creating an account, or logging in. This page will suffice (as far as access/privileges go) to update the LastPass badge with color and text.

Working on Aphrodite changes now.

@bsclifton bsclifton force-pushed the badge-text branch 2 times, most recently from d11a1ee to cc8d9ef Compare March 16, 2017 18:07
@jonathansampson
Copy link
Collaborator Author

@NejcZdovc Moved to Aphrodite (as much as I could). There are a couple of places where we don't know the value of the style property until runtime. Let me know if there's anything that could be further improved.

@jonathansampson
Copy link
Collaborator Author

@NejcZdovc @bridiver @bradleyrichter Can I get a fresh review? :)

Copy link
Contributor

@NejcZdovc NejcZdovc left a comment

Choose a reason for hiding this comment

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

LGTM

const styles = StyleSheet.create({
browserActionBadge: {
color: 'white',
bordeRadius: '2px',
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo: bordeRadius -> borderRadius

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.


const styles = StyleSheet.create({
browserActionBadge: {
color: 'white',
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use hex #FFF

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

@bridiver
Copy link
Collaborator

can we get some tests for this? Preferably with a mock extension that is only enabled for testing

- Centers wide badges
- Migrate to Aphrodite
- Use Hex Colors
@jonathansampson
Copy link
Collaborator Author

@bridiver I believe that's doable.

@bsclifton bsclifton self-requested a review April 3, 2017 06:13
Copy link
Member

@bsclifton bsclifton left a comment

Choose a reason for hiding this comment

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

Great job on this! 😄 It hasn't been re-reviewed since @NejcZdovc had given the feedback (which you then implemented). I followed the test steps and verified this works / looks good. ++++!

@bsclifton bsclifton merged commit bd8eb8b into master Apr 3, 2017
@bsclifton bsclifton deleted the badge-text branch April 3, 2017 06:39
@alexwykoff alexwykoff changed the title Adds support for badges Added extension badges Apr 13, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
design A design change, especially one which needs input from the design team. feature/extensions QA/test-plan-specified release-notes/include
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants