Add tooltip keyboard shortcuts #1498

Closed
fawce opened this Issue Mar 15, 2012 · 16 comments

Comments

Projects
None yet
4 participants
Contributor

fawce commented Mar 15, 2012

In v 0.13.dev (as installed about two weeks ago), I've been making heavy use of the tool tip that provides method signature help. There are these three controls (tack to bottom, expand, close). I find myself using the first two a ton, and I was wondering if there could be keyboard shortcuts for those. Since the controls look like characters, maybe ctrl-m ^ to tack, and ctrl-m + to expand?

hadmack commented Mar 15, 2012

This would be very helpful. For a function with many arguments the tool tips disappear as soon as you start typing but I need help to remember later arguments as I type them.

Owner

Carreau commented Mar 16, 2012

Hi, i'm re-writing the tooltip in one of my branches, i'll try to implement something like that when it's refactored. It also need the new completer to be merged.
I was thinking of something like tab twice to pin the tooltip for a certain amount of time.

In the mean time, when inside a function arguments, you can press tab after a space to get the tooltip back :

hist(x,y,<space><tab> 

will show you the tooltip for hist(

Contributor

fawce commented Mar 16, 2012

Yes, that is very useful and I've been doing that much more than using the buttons. maybe double tab just puts the help in that bottom pane or something like that? I happen to be learning a few new libraries right now, so I find myself needing the function help open a lot of the time. Plus, with one function in the bottom pane, you can get the tool tip on another function.

Owner

Carreau commented Mar 19, 2012

Hi, I've done that on the train last night :
https://github.com/Carreau/ipython/tree/tooltiponcompleter

@fawce @hadmack , do you wan't to give it a try ? I don't think it will work 100% of times, but basically :
tab once call tooltip, second time expand it (+) , third time make it sticky for 10 sec (not dismissed by typing) , 4th time, open the pager at the bottom of the screen.

I'm reluctant to use other shortcut because the tooltip does not get the "focus", an it then get difficult to have shortcut working only when tooltip is visible.

If you can give me feedback and/or cases where it does not work/ something goes wrong it will be nice :-)
It also feature a new completer for the notebook (see #1417).

Thanks.
--
Matthias

hadmack commented Mar 19, 2012

This didn't work for me in Chrome on OSX 10.6. Pressing tab more than once had no effect.

Owner

Carreau commented Mar 19, 2012

Do you still have yellow tooltip ? Or grey one ? Try restarting ipython
webserver, and flush browser cache. Does the javascript console Throw somme
errors ?

I'm also using chrome/ 10.6 so it is strange if it does not works...
Le 19 mars 2012 08:43, "Mike Hadmack" <
reply@reply.github.com>
a crit :

This didn't work for me in Chrome on OSX 10.6. Pressing tab more than
once had no effect.


Reply to this email directly or view it on GitHub:
#1498 (comment)

Contributor

fawce commented Mar 19, 2012

Hi,

I cloned your repo just to be sure I was getting the right code, and my tooltip is still yellow and not tabificated.
dying to try it :).

thanks,
fawce

On Mar 19, 2012, at 2:20 AM, Bussonnier Matthias wrote:

Hi, I've done that on the train last night :
https://github.com/Carreau/ipython/tree/tooltiponcompleter

@fawce @hadmack , do you wan't to give it a try ? I don't think it will work 100% of times, but basically :
tab once call tooltip, second time expand it (+) , third time make it sticky for 10 sec (not dismissed by typing) , 4th time, open the pager at the bottom of the screen.

I'm reluctant to use other shortcut because the tooltip does not get the "focus", an it then get difficult to have shortcut working only when tooltip is visible.

If you can give me feedback and/or cases where it does not work/ something goes wrong it will be nice :-)
It also feature a new completer for the notebook (see #1417).

Thanks.
--
Matthias


Reply to this email directly or view it on GitHub:
#1498 (comment)

Owner

Carreau commented Mar 19, 2012

And what is HEAD for you ?
it should be

commit 75d92578ad597d16dce4131b7e70563f83d1c656
Author: Matthias BUSSONNIER <bussonniermatthias@gmail.com>
Date:   Sun Mar 18 21:37:36 2012 +0100

    should fix click on close works when sticky

Dumb question , did you clone the right branch ? ( I didn't pushed on master )

git pull https://github.com/Carreau/ipython.git tooltiponcompleter
Contributor

fawce commented Mar 19, 2012

(blush). so sorry, got the right code and seeing the new behavior now. I'll post feedback via the ticket. thanks for help.
On Mar 19, 2012, at 9:57 AM, Bussonnier Matthias wrote:

And what is HEAD for you ?
it should be

commit 75d92578ad597d16dce4131b7e70563f83d1c656
Author: Matthias BUSSONNIER <bussonniermatthias@gmail.com>
Date:   Sun Mar 18 21:37:36 2012 +0100

   should fix click on close works when sticky

Dumb question , did you clone the right branch ? ( I didn't pushed on master )

git pull https://github.com/Carreau/ipython.git tooltiponcompleter

Reply to this email directly or view it on GitHub:
#1498 (comment)

Owner

Carreau commented Mar 19, 2012

Don't worry it happens to me to do :

git clone [url] [branch]

Just to figure out I just clone master in a directory named [branch] ...

Contributor

fawce commented Mar 19, 2012

Works pretty well for me on OSX Lion and Chrome 17.0.963.79

nits:

  • long function signatures overrun into the window controls. picture: http://screencast.com/t/FpagVR05YW
  • the animated insertion looks very nice, but it runs a bit long, may not wear well with a lot of use.
  • pure opinion: I think I would use tab 1 (show tip) and tab 4 (pin it to footer) exclusively, so I'd prefer to see it implemented with just two tabs (show, pin).
  • if I type func(aaa and then hit tab, the tooltip comes back, but if I add a comma func(aaa, tab is then ignored. visual studio has a really nice feature, where the current arg in the signature is highlighted, and hitting a comma highlights the next one. Probably overkill to try to emulate that, but maybe tab should still work if the calls closing paren hasn't been added.

thanks so much for adding this!

Owner

Carreau commented Mar 19, 2012

- long function signatures overrun into the window controls. picture: http://screencast.com/t/FpagVR05YW

hum ... I thought I had fixed this one

- the animated insertion looks very nice, but it runs a bit long, may not wear well with a lot of use.

Yes, that among all the little things to tweek in css

- pure opinion: I think I would use tab 1 (show tip) and tab 4 (pin it to footer) exclusively, so I'd prefer to see it implemented with just two tabs (show, pin).

Expanding (2 tabs) might be overkill, but I like the sticky for 10 sec for small screen, because pin to footer eat a lot of screen space, then need the mouse to be closed.... If the PR is accepted, I'll let the choice to the core devs.

- if I type func(aaa and then hit tab, the tooltip comes back, but if I add a comma func(aaa, tab is then ignored. visual studio has a really nice feature, where the current arg in the signature is highlighted, and hitting a comma highlights the next one. Probably overkill to try to emulate that, but maybe tab should still work if the calls closing paren hasn't been added.

highlighting would be a nice feature, it should be dooable, be someone with more regexp-fu would be required. recall on comma should also be doable, try

func(arg,[space]<tab>

It should already recall the tooltip, at least for me (plot( range(10),[space]<tab> ) it does.
If you want to give a shot a tweeking the regexps, I can give you a few pointer on where to look.

Contributor

fawce commented Mar 19, 2012

confirmed the arg,[space] works for me.
I am testing all this on the very large monitor, so I'm biased toward the pinning. I agree, the core guys will know what to do.

hadmack commented Mar 20, 2012

I did get it to work. Missed that it was a branch. I'm still not sure about the behavior. I would like the tooltip for the function to stay open until the closing parentheses are entered. And if a nested function is typed it would be nice for it to behave as a stack and pop back out to the original function until all arguments have been entered. The sticky tooltip is a little cumbersome since it does not close on its own after you are done with the function but you have to click on the 'x'.
I forget how tooltips work in most IDE's but I think the behavior is like what I described. Is there code in IDLE to handle this?

Owner

Carreau commented Mar 20, 2012

And if a nested function is typed it would be nice for it to behave as a stack and pop back out to the original function until all arguments have been entered.

That will be a little difficult.

The sticky tooltip is a little cumbersome since it does not close on its own after you are done with the function but you have to click on the 'x'.

It just stays sticky for 10s, if you continue typing with keyboard, it will dismiss. I think I see how to dismiss it on closing bracket... but won't have much time this week.

Thanks for the feedback.

hadmack commented Mar 20, 2012

Thanks for your work on this. Tooltips are a helpful feature.

fperez closed this in 3d3a488 Jun 1, 2012

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