Skip to content
This repository

write busy in notebook window title... #1084

Merged
merged 1 commit into from over 2 years ago

5 participants

Matthias Bussonnier Fernando Perez Brian E. Granger Moritz Emanuel Beber Min RK
Matthias Bussonnier
Collaborator

and remove it when back to Idle
@Midnighter asked for in in #977

IPython/frontend/html/notebook/static/js/kernelstatus.js
... ...
@@ -42,6 +43,7 @@ var IPython = (function (IPython) {
42 43
         this.element.removeClass("status_busy");
43 44
         this.element.removeClass("status_restarting");
44 45
         this.element.addClass("status_idle");
  46
+        window.document.title=window.document.title.replace(/\(\w+\)\s+/,'');
1
Min RK Owner
minrk added a note December 01, 2011

use IPython.save_widget.set_document_title(); here instead, because it is not guaranteed that this has been called after the 'Busy' was added, so it can replace part of the actual title if you do a sub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Matthias Bussonnier
Collaborator

Sure it's simpler than trying to match the (busy) part...
thanks.

IPython/frontend/html/notebook/static/js/kernelstatus.js
... ...
@@ -42,6 +43,7 @@ var IPython = (function (IPython) {
42 43
         this.element.removeClass("status_busy");
43 44
         this.element.removeClass("status_restarting");
44 45
         this.element.addClass("status_idle");
  46
+        window.document.title=IPython.save_widget.set_document_title();
1
Min RK Owner
minrk added a note December 01, 2011

Don't do an assignment here, that's what set_document_title() is for. The whole line should be IPython.save_widget.set_document_title();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Matthias Bussonnier
Collaborator

I'm sorry... I think I'm tired and I better go home... (rebased -f pushed to avoid 3 one line commits...)
I'll try to do something nicer later like
set_document_title_idle
set_document_title_busy
set_document_title_unsaved ...

Fernando Perez
Owner

OK, this looks good after your fixes. Thanks @minrk for catching those! I'm merging now.

Fernando Perez fperez merged commit 743176c into from December 01, 2011
Fernando Perez fperez closed this December 01, 2011
Brian E. Granger
Owner

Sorry I am late to the party, but I don't think we should use the Window title for status information. It is just not the place for dynamic information and I don't want to get into the habit of doing this.

Moritz Emanuel Beber

I don't understand the reasons for your objection but I can emphasize that it's a big productivity gain for me. Especially when working with multiple notebooks switching back to check whether a computation completed is much more disruptive than having a quick glance at the title bar. Of course, you may chide me for being so impatient but I don't think I'll get rid of that habit easily.

Fernando Perez
Owner

Well, I don't think we should be going overboard, but I'd found myself already a number of times wanting precisely this very feature, and I do find it super useful: it's unobtrusive and lets you know at a quick glance, from a pile of open browser tabs, which one to return to. It's the browser equivalent of terminal bells.

Gmail/gchat use this same idea to mark activity in a browser tab and I always have found it useful, despite me being fairly allergic to anything that blinks/moves in my visual field.

How else would you suggest we approach this? Within javascript we don't have the right to call any local (growl-like) notification mechanism, and those tend to be even more intrusive in general (with popups and stuff). I'm happy to discuss it further, but honestly this one seems to me like a good, valid use of the titlebar as the least-intrusive solution to an actual problem. I don't foresee anything else going into the titlebar in the long run, though, so I don't think you need to worry about this being the first step in a problematic feature creep in that direction.

Matthias Bussonnier
Collaborator

I can try to make it configurable for people who really don't like it, and the only other thing I see that could go in document.title it a small *showing that it's curently not saved.
One other idea would be to change favicon depending on state smth like red=busy, black=idle, blue=read-only (even if i'm even more sceptical on this one)

Brian E. Granger
Owner
Fernando Perez
Owner
Brian E. Granger
Owner
Fernando Perez
Owner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Dec 01, 2011
Matthias Bussonnier write busy in notebook window title 743176c
This page is out of date. Refresh to see the latest.
2  IPython/frontend/html/notebook/static/js/kernelstatus.js
@@ -34,6 +34,7 @@ var IPython = (function (IPython) {
34 34
         this.element.removeClass("status_idle");
35 35
         this.element.removeClass("status_restarting");
36 36
         this.element.addClass("status_busy");
  37
+        window.document.title='(Busy) '+window.document.title;
37 38
         this.element.text("Busy");
38 39
     };
39 40
 
@@ -42,6 +43,7 @@ var IPython = (function (IPython) {
42 43
         this.element.removeClass("status_busy");
43 44
         this.element.removeClass("status_restarting");
44 45
         this.element.addClass("status_idle");
  46
+        IPython.save_widget.set_document_title();
45 47
         this.element.text("Idle");
46 48
     };
47 49
 
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.