-
Notifications
You must be signed in to change notification settings - Fork 970
Conversation
less/notificationBar.less
Outdated
@@ -7,7 +7,19 @@ | |||
|
|||
.notificationBar { | |||
display: inline-block; | |||
position: relative; | |||
z-index: 1000; |
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'd replace this with @zindexNavigationBar
according to
browser-laptop/less/variables.less
Line 129 in ce25254
@zindexNavigationBar: 2000; |
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.
@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.
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.
How about changing @zindexNavigationBar on variables.less into 1000
then??
@jonathansampson is this one ready for review? If not, can we move it to 0.13.3? thanks 😄 |
@bsclifton I'm not positive; @bradleyrichter, thoughts? |
I thought we were stuck at the lame-triangle problem? Did you find a solution @jonathansampson ? |
@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. |
I have a fix for triangle issue and going to self-assign this and make a follow-up of @jonathansampson changes. |
4def2bd
to
75152fb
Compare
@jonathansampson I edited PR with caret feel free to edit anything. Didn't test all use cases for app-wise notifications, tried only fullscreen |
@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. 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. |
@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. |
This should never happen anyway because we have switched the alerts to be tab specific.
… On Mar 15, 2017, at 11:41 AM, yan ***@***.***> wrote:
@jonathansampson <https://github.com/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.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#6939 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AM4jqlU1PqrjUfEqyCZK3_qZt5UvEWLKks5rmDDUgaJpZM4LyTqb>.
|
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. |
@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 |
@cezaraugusto if the notifications are per-tab, you'll also be able to close this issue out 😄 #7737 |
@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? |
@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) |
75152fb
to
64d6c15
Compare
edited, now caret only appears if tab is active and has a notificationBar. Also moved caret to the center. |
js/components/main.js
Outdated
hasTabInFullScreen={ | ||
sortedFrames | ||
.map((frame) => frame.get('isFullScreen')) | ||
.some(fullScreenMode => fullScreenMode === true) | ||
} | ||
/> | ||
{ | ||
this.props.appState.get('notifications') && this.props.appState.get('notifications').size && activeFrame |
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.
We call out to this.props.appState.get('notifications')
3-4 times. Can we do this once, and then store the result?
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.
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
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.
@cezaraugusto Yes. This way we only have to go searching for the object once.
And I confused a pair of tab alerts for separate tab alerts. Sorry!
So, I confirmed we are good with tab specific alerts. Next we need to stack them in z order and not y order.
And hide the non-active nub as Yan mentioned.
… On Mar 15, 2017, at 2:47 PM, yan ***@***.***> wrote:
@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)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
64d6c15
to
017429f
Compare
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. |
The caret is needed because otherwise a notification bar can be spoofed by a malicious page. |
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. |
I'm ok either way change it to be nested to urlbar should be minimal |
@bradleyrichter ok to use it the same way as Chrome/FF? |
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? |
Let's try adding a border and making the nub more defined and obvious. |
c2a5005
to
ae2805e
Compare
How's this one looking? @jonathansampson, @cezaraugusto, @luixxiul |
@bsclifton I'm assuming it's ready to go since @cezaraugusto added |
@@ -115,6 +116,14 @@ class NotificationBar extends ImmutableComponent { | |||
} | |||
} | |||
|
|||
class NotificationBarCaret extends ImmutableComponent { |
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.
Why do we need this component? I don't see real benefit of having it.
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.
@NejcZdovc What do you suggest as an alternative?
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 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
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 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.
I'm happy now. Let's merge and refine the styles separately as @NejcZdovc suggested. |
fe72678
to
e5ecc26
Compare
Auditors: @bradleyrichter, @jonathansampson Close #6935
e5ecc26
to
ffc2d9b
Compare
@cezaraugusto Holy smokes, that's gorgeous! :) |
it should also work the same for pinned tabs.
|
git rebase -i
to squash commits (if needed).Auditors: @bradleyrichter
Resolves #6935