• 8 posts
  • Page 1 of 1
dough_boy wrote:
When I am connected to d12 I can leave a tab open and come back later and see my turns that I have to take and any messages that appeared. Would it be possible when updating those to update the title of the page to be like X-Turns, Y Messages? Or at least turns? Would save me needing to come back if I can glance at the title in the tab and see if there is anything for me.
Matty wrote:
Oh, I want that for a long time already, but for some reason it wasn't on my list - I added it.

Not sure if we can get it anytime soon though, as things stop updating if you're inactive for too long. Not sure if that holds for the top bar as well, but if so, I'm reluctant to enable that untill we get websockets working...
"Strength doesn't lie in numbers, strength doesn't lie in wealth. Strength lies in nights of peaceful slumbers." ~Maria
Cireon wrote:
Yes, I'd really like to put a little (1) in the title when something happens on the website. This will also mark the tab on some browser as activity, which could be really helpful. It is also the first step towards making browser notifications work (which is actually really simple).

Matty is right though: we are very strained by our infrastructure. We don't get enough premium subscriptions to afford better servers, which means we're really careful with calling the server to update whether you have new messages or turns. In fact, once you leave the tab, we try to detect that as much as possible, and stop updating the site. This is shown by a little hourglass in the top bar. Once you move your mouse or type on the keyboard, we'll immediately start updating. We do this because if you're not looking at the tab, it's not very important to update the tab in the background, and it means we can save server resources to make the site faster for people currently using it.

As you can imagine, if we don't update the tab, we also can't update the tab title while you're away from it. Web sockets, which Matty is talking about, allow us to "push" changes to the client instead of having the client ask the server for updates every five seconds. This would be a lot better, but we need to make sure we have sufficient browser support for web sockets, and it also means rewriting basically all code that interacts between frontend and backend.

I am really excited about this idea and many related ideas, but I am afraid this work depends on us doing some big rework of our technical infrastructure before we can support it. :)
“This is how humans are: We question all our beliefs, except for the ones that we really believe in, and those we never think to question.”
- Speaker for the Dead, O.S. Card
dough_boy wrote:
I guess the only reason I noticed it is because unfortunately (for you), fortunately (for me) it is updating in the background.

I will see if I can find a work around for me.
Cireon wrote:
Or maybe it doesn't update on the background and we're just really good at updating the app just before you get back? :ninja:
“This is how humans are: We question all our beliefs, except for the ones that we really believe in, and those we never think to question.”
- Speaker for the Dead, O.S. Card
dough_boy wrote:
Maybe it is that since I am in so many of these tourney games that I haven't timed out?

Regardless, this code works for me. So you can put my request on the back burner.

$(function() {
$('body' ).on('DOMSubtreeModified', '#num-turns', function() {
   var turns = parseInt($(this).html());
if(turns > 0) {
$('title' ).html(turns+' turns' );
}
else {
$('title' ).html(' ' );
}
});
});
Matty wrote:
For live games we do keep the tab active for quite some time even if you don't do anything (aka, mouse movement or keypresses). So for live games this should work yes.
We can already implement this for live games, and then just not have it working very well for all other things. That'd be better then nothing B|.
"Strength doesn't lie in numbers, strength doesn't lie in wealth. Strength lies in nights of peaceful slumbers." ~Maria
Cireon wrote:
I don't think it's a good idea. We create the expectation it updates the title when something changes, and then we don't.
“This is how humans are: We question all our beliefs, except for the ones that we really believe in, and those we never think to question.”
- Speaker for the Dead, O.S. Card