New tooltip for notebook #1509

Closed
wants to merge 36 commits into
from

Conversation

Projects
None yet
3 participants
@Carreau
Owner

Carreau commented Mar 19, 2012

This is an answer to fix #1498 (tooltip keyboard shortcuts (feature request)), that also contain all the code from #1417 (new completer) because it rely on some change made in it.

It introduces tooltip in it's own class, and allows differrent behaviour when you press several time. (see discusion in #1498). Plus some aesthetic change when trying to get a tooltip from the far right of the windows.

If you can test and give feedback on usability/ cross browser css compatibility, i'll focus on tidying/commenting the code later.

Invoking @fawce , to be sure he get the notification.

@Carreau

This comment has been minimized.

Show comment Hide comment
@Carreau

Carreau Mar 20, 2012

Owner

@hadmack , I open a PR if you find some bugs.

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

Thanks, I'm writing this because I feel the need for this often, but I also lack JS background... And all the credit have to go to the dev team which made a great api and easy to modifie code.

Owner

Carreau commented Mar 20, 2012

@hadmack , I open a PR if you find some bugs.

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

Thanks, I'm writing this because I feel the need for this often, but I also lack JS background... And all the credit have to go to the dev team which made a great api and easy to modifie code.

@Carreau

This comment has been minimized.

Show comment Hide comment
@Carreau

Carreau Mar 23, 2012

Owner

rebased on master and forced pushed.
didn't had time to make more changes.

Owner

Carreau commented Mar 23, 2012

rebased on master and forced pushed.
didn't had time to make more changes.

@Carreau

This comment has been minimized.

Show comment Hide comment
@Carreau

Carreau Mar 30, 2012

Owner

some cleaning and example on how to configure. rebased on master.

@hadmack, you can execute this as a markdown cell of your nb :

## tooltip configuration
<script>
    IPython.tooltip.tabs_functions[1] = function(){IPython.tooltip.showInPager() }
</script>

And you'll have the pager on second keypress.

Owner

Carreau commented Mar 30, 2012

some cleaning and example on how to configure. rebased on master.

@hadmack, you can execute this as a markdown cell of your nb :

## tooltip configuration
<script>
    IPython.tooltip.tabs_functions[1] = function(){IPython.tooltip.showInPager() }
</script>

And you'll have the pager on second keypress.

@Carreau Carreau referenced this pull request Mar 30, 2012

Closed

Notebook Completer Class #1417

@fperez

This comment has been minimized.

Show comment Hide comment
@fperez

fperez Apr 15, 2012

Owner

@Carreau, sorry but this one has a conflict right now, no idea what caused it. Could you rebase it so we can start reviewing it and testing it? Hopefully now that we have the PR queue a bit more controlled, we can move more quickly on yours.

Owner

fperez commented Apr 15, 2012

@Carreau, sorry but this one has a conflict right now, no idea what caused it. Could you rebase it so we can start reviewing it and testing it? Hopefully now that we have the PR queue a bit more controlled, we can move more quickly on yours.

@Carreau

This comment has been minimized.

Show comment Hide comment
@Carreau

Carreau Apr 15, 2012

Owner

@fperez rebased and forced push.
It contains a .less file that compile to .css (for the tooltip, it's easier to have variable for the css when tweeking it), when you'll be OK with the PR, I can remove the less file if you want.

recap of the changes :

  • Everything from the new-completer (#1417)
  • tooltip in it's own separated class
  • new css
  • small arrow on top of the tooltip more or less on right or left depending on wether the cursor is on the left or right of codemirror instance when invoking.
  • different behaviour depending on how many time you press tab. [*]
    • one time : classical tooltip
    • two : expand the tooltip (equivalent than clicking +button)
    • three: make the tooltip 'sticky' for 10 sec (won't be discarded by keyboard input)
    • four : exec function? on behalf of the current cell (equivalent than clicking ^ button)[**]

[*] If you are ok with that behaviour, I can write that somewhere in the docs/ notebook example.
[**] When the widget API is in place I would like to change this thing, because it increments the prompt number of the cell.

[edit] for the record, conflicting commit was 0960f3b ~L23 , add of this.clear_out_timeout = null;[/edit]

Owner

Carreau commented Apr 15, 2012

@fperez rebased and forced push.
It contains a .less file that compile to .css (for the tooltip, it's easier to have variable for the css when tweeking it), when you'll be OK with the PR, I can remove the less file if you want.

recap of the changes :

  • Everything from the new-completer (#1417)
  • tooltip in it's own separated class
  • new css
  • small arrow on top of the tooltip more or less on right or left depending on wether the cursor is on the left or right of codemirror instance when invoking.
  • different behaviour depending on how many time you press tab. [*]
    • one time : classical tooltip
    • two : expand the tooltip (equivalent than clicking +button)
    • three: make the tooltip 'sticky' for 10 sec (won't be discarded by keyboard input)
    • four : exec function? on behalf of the current cell (equivalent than clicking ^ button)[**]

[*] If you are ok with that behaviour, I can write that somewhere in the docs/ notebook example.
[**] When the widget API is in place I would like to change this thing, because it increments the prompt number of the cell.

[edit] for the record, conflicting commit was 0960f3b ~L23 , add of this.clear_out_timeout = null;[/edit]

@Carreau

This comment has been minimized.

Show comment Hide comment
@Carreau

Carreau Apr 28, 2012

Owner

rebased and forced push to avoid conflict.

Owner

Carreau commented Apr 28, 2012

rebased and forced push to avoid conflict.

Carreau and others added some commits Feb 1, 2012

implement the completer in a separate class
more feature like
-completion based on 2 sources :
    * introspection in kernel
    * context of current cell (complete with matching words)
    * each source has its color in the completer
use strict and clean a little.
    adding 'use strict' in some place to be more agressive on the
    delaration of the variables.

    clean name and details here and there
fix replace range bug
    pylab.l<tab><tab> would be replace by .l because of a bug in common
    start finding .l on the fifth position of pylab.start.
add a keycodes structure to utils
    this structure (IPython.utils.keycodes)
    add some common keycodes like tab...etc

    and start modifying codecell.js to use it for better readability
Removing some code that seem not to be usefull anymore
    if having problem with Tab Completion try to revese this commit
add ctrlKey.which to utils
and modifies some file to use it
be smarter for context completion
Completion source based on context is smarter and use codemirror token
mecanisme to propose completions, instead of just plitting text at
whitespace and before dots.
change new tooltip appearence
    temporarly (or maybe not) use less css to produce the css for the
    tooltip.
play with tooltip growing css
don't forget to reenqble keyframe with a more
recent less compiler
multiple tooltip action
consecutives tab pressing with tooltip does :
    - fisrt : show it
    - second :  expand it
    - third : make it sticky for 10s (typing wont dismiss it)
    - forth : send the content into the Pager

Carreau added some commits Mar 30, 2012

fix print view
construct a completer only if the class exist
otherwise print view won't load.
@Carreau

This comment has been minimized.

Show comment Hide comment
@Carreau

Carreau Apr 30, 2012

Owner

rebased and forced push to avoid conflict.

Owner

Carreau commented Apr 30, 2012

rebased and forced push to avoid conflict.

@ellisonbg

This comment has been minimized.

Show comment Hide comment
@ellisonbg

ellisonbg May 3, 2012

Owner

I have refactored now the Kernel, Notebook and CodeCell work in this PR: #1697. That PR will conflict with this one. I think the best way of handling it is to merge that first, then rebase this on top of it.

Owner

ellisonbg commented May 3, 2012

I have refactored now the Kernel, Notebook and CodeCell work in this PR: #1697. That PR will conflict with this one. I think the best way of handling it is to merge that first, then rebase this on top of it.

@Carreau

This comment has been minimized.

Show comment Hide comment
@Carreau

Carreau May 4, 2012

Owner

As you wish, I'll might be a little busy in the next few days, but I will try to take a look.
We can also try to merge #1509 and #1697 together then make a PR of the 2 into master.
I keep you informed.

Owner

Carreau commented May 4, 2012

As you wish, I'll might be a little busy in the next few days, but I will try to take a look.
We can also try to merge #1509 and #1697 together then make a PR of the 2 into master.
I keep you informed.

@ellisonbg

This comment has been minimized.

Show comment Hide comment
@ellisonbg

ellisonbg May 4, 2012

Owner

Let's try to merge #1697 first and then rebase/merge 1509 on top of
that. I think it will be cleaner to finish the reviews that way.

On Fri, May 4, 2012 at 12:28 AM, Bussonnier Matthias
reply@reply.github.com
wrote:

As you wish, I'll might be a little busy in the next few days, but I will try to take a look.
We can also try to merge #1509 and #1697 together then make a PR of the 2 into master.
I keep you informed.


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

Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger@calpoly.edu and ellisonbg@gmail.com

Owner

ellisonbg commented May 4, 2012

Let's try to merge #1697 first and then rebase/merge 1509 on top of
that. I think it will be cleaner to finish the reviews that way.

On Fri, May 4, 2012 at 12:28 AM, Bussonnier Matthias
reply@reply.github.com
wrote:

As you wish, I'll might be a little busy in the next few days, but I will try to take a look.
We can also try to merge #1509 and #1697 together then make a PR of the 2 into master.
I keep you informed.


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

Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger@calpoly.edu and ellisonbg@gmail.com

@Carreau

This comment has been minimized.

Show comment Hide comment
@Carreau

Carreau May 4, 2012

Owner

This PR has more than 30 commits , it will be hard and long to rebase all on top once more ...
Wherease #1697 is 'only' 1 commit which would be easier to rebase... unless you know another method

May I suggest to merge #1509 and #1697 in one branch and merge it into master all at once ?

Owner

Carreau commented May 4, 2012

This PR has more than 30 commits , it will be hard and long to rebase all on top once more ...
Wherease #1697 is 'only' 1 commit which would be easier to rebase... unless you know another method

May I suggest to merge #1509 and #1697 in one branch and merge it into master all at once ?

@ellisonbg

This comment has been minimized.

Show comment Hide comment
@ellisonbg

ellisonbg May 7, 2012

Owner

@Carreau I like this idea. Can you create that combined branch and push it as a branch in the ipython org so both of us can push to it. Once that happens I will pick up the work on it.

Owner

ellisonbg commented May 7, 2012

@Carreau I like this idea. Can you create that combined branch and push it as a branch in the ipython org so both of us can push to it. Once that happens I will pick up the work on it.

@Carreau

This comment has been minimized.

Show comment Hide comment
@Carreau

Carreau May 7, 2012

Owner

@ellisonbg
ok, done here

  • I rebased both branches on master,
  • cherry pick yours on top of mine
  • fix the conflicts, and start tweek the code so that is worked (and retab)
  • start cleaning the code

I'll open a new PR...

Owner

Carreau commented May 7, 2012

@ellisonbg
ok, done here

  • I rebased both branches on master,
  • cherry pick yours on top of mine
  • fix the conflicts, and start tweek the code so that is worked (and retab)
  • start cleaning the code

I'll open a new PR...

@Carreau

This comment has been minimized.

Show comment Hide comment
@Carreau

Carreau May 8, 2012

Owner

Closing as it is superseeded by #1711

Owner

Carreau commented May 8, 2012

Closing as it is superseeded by #1711

@Carreau Carreau closed this May 8, 2012

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