Skip to content
This repository has been archived by the owner. It is now read-only.

Notification Bar Changes #6939

Merged
merged 1 commit into from Apr 20, 2017
Merged

Notification Bar Changes #6939

merged 1 commit into from Apr 20, 2017

Conversation

@jonathansampson
Copy link
Collaborator

jonathansampson commented Jan 31, 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).

Auditors: @bradleyrichter

Resolves #6935

@jonathansampson jonathansampson added this to the 0.13.2 milestone Jan 31, 2017
@@ -7,7 +7,19 @@

.notificationBar {
display: inline-block;
position: relative;
z-index: 1000;

This comment has been minimized.

Copy link
@luixxiul

luixxiul Jan 31, 2017

Contributor

I'd replace this with @zindexNavigationBar according to

@zindexNavigationBar: 2000;

This comment has been minimized.

Copy link
@jonathansampson

jonathansampson Jan 31, 2017

Author Collaborator

@luixxiul That appears to cause the type of problems we faced in the design discussion last night. Namely, interacting with some of the document elements will cause the shadow to vanish; often only regions of it will vanish.

odd-shadow

This comment has been minimized.

Copy link
@luixxiul

luixxiul Feb 1, 2017

Contributor

How about changing @zindexNavigationBar on variables.less into 1000 then??

@bsclifton
Copy link
Member

bsclifton commented Jan 31, 2017

@jonathansampson is this one ready for review? If not, can we move it to 0.13.3? thanks 😄

@jonathansampson
Copy link
Collaborator Author

jonathansampson commented Jan 31, 2017

@bsclifton I'm not positive; @bradleyrichter, thoughts?

@bradleyrichter
Copy link
Contributor

bradleyrichter commented Jan 31, 2017

I thought we were stuck at the lame-triangle problem? Did you find a solution @jonathansampson ?

@jonathansampson
Copy link
Collaborator Author

jonathansampson commented Jan 31, 2017

@bradleyrichter I'm looking into some of the tab-change, window-resize events now to see if we can just subscribe to those and pick up the needed information to position the triangle. Positioning it will require us to use a true element, rather than a pseudo element.

@bbondy bbondy modified the milestones: 0.13.3, 0.13.2 Feb 1, 2017
@bbondy bbondy removed this from the 0.13.5 milestone Feb 16, 2017
@cezaraugusto cezaraugusto self-assigned this Feb 23, 2017
@cezaraugusto
Copy link
Contributor

cezaraugusto commented Feb 23, 2017

I have a fix for triangle issue and going to self-assign this and make a follow-up of @jonathansampson changes.

@cezaraugusto
Copy link
Contributor

cezaraugusto commented Mar 14, 2017

@jonathansampson I edited PR with caret feel free to edit anything. Didn't test all use cases for app-wise notifications, tried only fullscreen

@jonathansampson
Copy link
Collaborator Author

jonathansampson commented Mar 15, 2017

@cezaraugusto Wonder if we should be concerned with the following scenario: A user has multiple tabs opened, and may confuse the notification on one for being a notification on another. Note below how the notification bars for github.io appear to be coming from google.com.

image

Another question is can a user change the favicon to appear as though it has a triangle in it, thus making the spoofing more persuasive to many users. We may want to get @diracdeltas' input here as well.

imageimage

@diracdeltas
Copy link
Member

diracdeltas commented Mar 15, 2017

@jonathansampson the problem with having the notification bars fully in the webview area is that a page can spoof them; this is why initially i implemented them to be above the tab bar. this is solved by having the triangle poke into the "trusted UI" area, but yeah i agree it's confusing to have it point to a different tab. IMO it should always point to either the URL bar or the tab where the notification is coming from.

@bradleyrichter
Copy link
Contributor

bradleyrichter commented Mar 15, 2017

@cezaraugusto
Copy link
Contributor

cezaraugusto commented Mar 15, 2017

yes that's my fault, didn't test for more than one alert. I'll do an update.

To avoid spoofing we can move the caret to the close button instead of favicon, so we can back to safe UI area. When tab is small enough to remove close icon we could also remove the caret.

/cc @jonathansampson @bradleyrichter @diracdeltas

@diracdeltas
Copy link
Member

diracdeltas commented Mar 15, 2017

@bradleyrichter i don't know what you mean. the notifications right now appear in the ("global") trusted UI area, but they only appear when the tab they are for is active.

@cezaraugusto as long as the caret isn't going to an unrelated tab, sgtm

@bsclifton
Copy link
Member

bsclifton commented Mar 15, 2017

@cezaraugusto if the notifications are per-tab, you'll also be able to close this issue out 😄 #7737

@jonathansampson
Copy link
Collaborator Author

jonathansampson commented Mar 15, 2017

image

@bradleyrichter @diracdeltas In the above screenshot, Google.com has a notification bar. I left it untouched, and moved over to webrtc.github.io, where two additional notification bars were opened. Each bar points only to its related tab. But triangles are visible even when associated notification bars are not.

@cezaraugusto I would suggest placing the triangle in the center of the tab rather than on the left or right. Should we also hide the triangle if the tab isn't focused? Or, perhaps mark tabs in such a manner so as to show that they have a pending notification? Something other than the triangle for blurred tabs?

@diracdeltas
Copy link
Member

diracdeltas commented Mar 15, 2017

@jonathansampson i see, i didn't realize there was a notification for the goog tab. in that case seems like the triangle for google should just disappear (or turn grey)

@cezaraugusto cezaraugusto force-pushed the notification-bar branch from 75152fb to 64d6c15 Mar 15, 2017
@cezaraugusto
Copy link
Contributor

cezaraugusto commented Mar 15, 2017

edited, now caret only appears if tab is active and has a notificationBar. Also moved caret to the center.

hasTabInFullScreen={
sortedFrames
.map((frame) => frame.get('isFullScreen'))
.some(fullScreenMode => fullScreenMode === true)
}
/>
{
this.props.appState.get('notifications') && this.props.appState.get('notifications').size && activeFrame

This comment has been minimized.

Copy link
@jonathansampson

jonathansampson Mar 15, 2017

Author Collaborator

We call out to this.props.appState.get('notifications') 3-4 times. Can we do this once, and then store the result?

This comment has been minimized.

Copy link
@cezaraugusto

cezaraugusto Mar 16, 2017

Contributor

you mean adding to a variable? If so, we can:

const notifications = this.props.appState.get('notifications')
const hasNotifications = notifications && notifications.size
...
hasNotifications && activeFrame
  ? <NotificationBar notifications={notifications} activeFrame={activeFrame} />
  : null

This comment has been minimized.

Copy link
@jonathansampson

jonathansampson Mar 16, 2017

Author Collaborator

@cezaraugusto Yes. This way we only have to go searching for the object once.

@bradleyrichter
Copy link
Contributor

bradleyrichter commented Mar 16, 2017

@cezaraugusto cezaraugusto force-pushed the notification-bar branch from 64d6c15 to 017429f Mar 17, 2017
@luixxiul
Copy link
Contributor

luixxiul commented Mar 23, 2017

I'm just wondering, if we really need the caret over the tab title. I can easily imagine a bunch of users would say, "please add an option to hide it or just remove it because I want to read the full title".

For me the aim of the caret is unclear, because, if I select a tab and there appears a notification bar under the tab, it is obvious that the notification bar appears there exactly for the tab which I selected just now.

Also, in this case, if the tab preview is enabled, the notification bar should be hidden if another tab is previewed which do not have notification.

@diracdeltas
Copy link
Member

diracdeltas commented Mar 23, 2017

The caret is needed because otherwise a notification bar can be spoofed by a malicious page.

@diracdeltas
Copy link
Member

diracdeltas commented Mar 23, 2017

The way chrome/ff handle this is by having a notification box pop up from the URL bar when the tab it is for is in focus. That would be better.

@cezaraugusto
Copy link
Contributor

cezaraugusto commented Mar 23, 2017

I'm ok either way change it to be nested to urlbar should be minimal

@cezaraugusto
Copy link
Contributor

cezaraugusto commented Apr 5, 2017

@bradleyrichter ok to use it the same way as Chrome/FF?

@bradleyrichter
Copy link
Contributor

bradleyrichter commented Apr 5, 2017

I am not sure this would work because it would cover all of the other tabs, forcing the user to interact with the message before using other tabs?

@bradleyrichter
Copy link
Contributor

bradleyrichter commented Apr 5, 2017

Let's try adding a border and making the nub more defined and obvious.

@cezaraugusto cezaraugusto force-pushed the notification-bar branch 2 times, most recently from c2a5005 to ae2805e Apr 17, 2017
@bsclifton
Copy link
Member

bsclifton commented Apr 19, 2017

How's this one looking? @jonathansampson, @cezaraugusto, @luixxiul

@jonathansampson
Copy link
Collaborator Author

jonathansampson commented Apr 19, 2017

@bsclifton I'm assuming it's ready to go since @cezaraugusto added PR/ready-for-review a day ago. @bradleyrichter, how do you feel about the present presentation?

@@ -115,6 +116,14 @@ class NotificationBar extends ImmutableComponent {
}
}

class NotificationBarCaret extends ImmutableComponent {

This comment has been minimized.

Copy link
@NejcZdovc

NejcZdovc Apr 19, 2017

Member

Why do we need this component? I don't see real benefit of having it.

This comment has been minimized.

Copy link
@jonathansampson

jonathansampson Apr 19, 2017

Author Collaborator

@NejcZdovc What do you suggest as an alternative?

This comment has been minimized.

Copy link
@NejcZdovc

NejcZdovc Apr 19, 2017

Member

I am not sure if we need component for two divs. What I would suggest is to create divs where we now use this component and move styles into notificationStyle file and use it from there.
cc @cezaraugusto

This comment has been minimized.

Copy link
@cezaraugusto

cezaraugusto Apr 19, 2017

Contributor

I prefer this way because then I can leave styles on the component itself. Otherwise, I'll have to create a new style for that and put it on the tab itself or inside a third file, and if I do it then I'm not taking advantage of Aphrodite.

Style and component should live together so I don't have to run several files to find a simple thing. Things we do such as commonStyles.js is just a hack we found to keep refactoring important stuff while common components aren't ready yet/too nested. Having both together makes regressions less likely.

It also simplifies the code, so if for some reason Brad or other less code-experienced member/collaborator wants to change something for a given component, they'll need to go to into just one file.

@bradleyrichter
Copy link
Contributor

bradleyrichter commented Apr 19, 2017

I'm happy now. Let's merge and refine the styles separately as @NejcZdovc suggested.

@cezaraugusto
Copy link
Contributor

cezaraugusto commented Apr 20, 2017

Based on latest Brad's spec:

screen shot 2017-04-20 at 1 04 20 am

@cezaraugusto cezaraugusto force-pushed the notification-bar branch 3 times, most recently from fe72678 to e5ecc26 Apr 20, 2017
@cezaraugusto cezaraugusto force-pushed the notification-bar branch from e5ecc26 to ffc2d9b Apr 20, 2017
@cezaraugusto cezaraugusto merged commit 1d8588d into master Apr 20, 2017
0 of 2 checks passed
0 of 2 checks passed
continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
@cezaraugusto cezaraugusto deleted the notification-bar branch Apr 20, 2017
@jonathansampson
Copy link
Collaborator Author

jonathansampson commented Apr 20, 2017

@cezaraugusto Holy smokes, that's gorgeous! :)

@NejcZdovc NejcZdovc added this to the 0.15.1 milestone Apr 20, 2017
@srirambv
Copy link
Collaborator

srirambv commented May 2, 2017

Nub not shown for pinned tabs
image

Also notification for pinned tabs is retained accross normal tabs as well. This is on packaged 0.15.2 packaged preview 1 build

@bradleyrichter
Copy link
Contributor

bradleyrichter commented May 2, 2017

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

Successfully merging this pull request may close these issues.

None yet

9 participants
You can’t perform that action at this time.