0

So this is a long standing bug that never bothered me before (So a different tab invokes the ping message, boohoo), but now with the return of Desktop Notifications to chat (yey!), this has become an actual problem.

When someone pings you, you get the well-known ping sound. Google Chrome lets you know which tab is playing sound by adding a small icon on it, and it's more often than not shows the wrong tab (I imagine, the tab that's connected to the WebSocket).

Now with desktop notifications back on, when you click on it, it should send you to the tab where the ping occurred, instead it sends you back to the tab where sound originated from (Which is, in n-1/n where n is the number of open tabs of the cases, wrong).

Ping sound and desktop notifications should originate from the same tab that generated the ping.

12
  • I believe that there are serious difficulties with getting the sound notification to originate from the correct tab. It was raised somewhere (may well have been chat) and I think you're right about the tab that shows the alert.
    – ChrisF Mod
    Commented Sep 9, 2014 at 8:35
  • I don't think it's that much of a difficulty. Chat isn't currently built to be very multitabbed, it's semi-assumed that you have only one tab, and you switch between the rooms using the "Other rooms you're in" links to the right. Which is hardly the case nowdays. Commented Sep 9, 2014 at 8:37
  • meta.stackoverflow.com/questions/269241/…
    – Oded
    Commented Sep 9, 2014 at 8:55
  • To expand on @Oded's link - the tricky things are scenarios like: you have 5 tabs open; 3 of them are for the same room "A"; the "control" tab is one of the other two. Something noteworthy happens in "A". Which tab speaks? It is solvable, but: will take some thinking and implementing Commented Sep 9, 2014 at 8:59
  • @SecondRikudo on the contrary: there is a lot of code explicitly to support multi-tab usage Commented Sep 9, 2014 at 9:00
  • If you have 3 tabs with the same room, just pick the first one. I don't care because they're all the right room. Also, if you open the same room in multiple tabs you deserve whatever crapstorm the code makes :P Commented Sep 9, 2014 at 9:00
  • @SecondRikudo there is no "first": you're just broadcasting messages Commented Sep 9, 2014 at 9:01
  • Let's continue this discussion in chat Commented Sep 9, 2014 at 9:02
  • @SecondRikudo I'd rather keep it here on this occasion... dropping stuff into the sandbox is a recipe for losing track of the conversation Commented Sep 9, 2014 at 9:04
  • @MarcGravell Okay, well, in that case, I don't see a reason why not just display the notification/ping on all three rooms. I can't think of a deliberate use-case by a user to open the same room multiple times. I sometimes do it by mistake. Commented Sep 9, 2014 at 9:05
  • @SecondRikudo "bleep bleep bleep"..... "bleep bleep bleep" ;p Commented Sep 9, 2014 at 9:06
  • @MarcGravell Yeah, that would let you know that you have multiple tabs open, and that you probably need to close some of the duplicates. If you could have accessed chat with different users on different tabs, I would have said that there's a usecase here that needs attention. But you can't! All 3 tabs would be open on the same user, so yeah, I don't mind all of the getting pings. It sounds reasonable to me. Commented Sep 9, 2014 at 9:08

1 Answer 1

5

This is now implemented. The sound and the desktop notification will originate from a browser tab that shows the corresponding room, if there is such a one. If there's not, then it falls back to the chat browser tab that most recently had focus. I'm still not sure whether that should also switch to the correct room, or what other behavior there should be. But if you have a tab with the room open, that's where clicking the desktop notification will take you.


Previous answer:

I've considered this (and haven't discarded the idea), but it's a fairly involved change. Currently, the notifications (and the sound) originate from the browser tab that has been designated the "master", which to the user is a rather arbitrary one (in fact, it'll be the one that's been open the longest).

Since we can only cause a click on the notification to surface the tab that created the notification, not a different one (that's a browser security feature that we can't do anything about), we would have to make some infrastructure changes to support this. It's not impossible and I agree it would be nice, it's just not simple.

One other question that would have to be answered is: What if the notification is from a room that's not the active room in any currently active tab?

  • In that case, open an "arbitrary" tab again?
  • Or open a new tab that shows the corresponding rooms? (This may cause issues with popup blockers)
  • Or open an "arbitrary" tab, but switch it to the room that caused the notification?

  • And what if the notification came from a room that you're not currently in? In that case, we don't currently show a desktop notification at all (only a "You have been mentioned in a room you're not currently in" notification bar in the chat browser tab).

1
  • I'd open an "arbitrary" tab, but somehow highlight (the (1) next to the room name isn't enough) that a ping occurred in a room that isn't currently open. Leave the user to decide whether to switch or open a new tab. Commented Sep 9, 2014 at 9:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .