Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New tooltip for notebook #1509

Closed
wants to merge 36 commits into from
Closed

Conversation

Carreau
Copy link
Member

@Carreau 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
Copy link
Member Author

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
Copy link
Member Author

Carreau commented Mar 23, 2012

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

@Carreau
Copy link
Member Author

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.

@fperez
Copy link
Member

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
Copy link
Member Author

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 (Notebook Completer Class #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
Copy link
Member Author

Carreau commented Apr 28, 2012

rebased and forced push to avoid conflict.

Carreau and others added 23 commits April 30, 2012 17:37
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
    adding 'use strict' in some place to be more agressive on the
    delaration of the variables.

    clean name and details here and there
    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.
    this structure (IPython.utils.keycodes)
    add some common keycodes like tab...etc

    and start modifying codecell.js to use it for better readability
    if having problem with Tab Completion try to revese this commit
and modifies some file to use it
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.
    temporarly (or maybe not) use less css to produce the css for the
    tooltip.
don't forget to reenqble keyframe with a more
recent less compiler
@Carreau
Copy link
Member Author

Carreau commented Apr 30, 2012

rebased and forced push to avoid conflict.

@ellisonbg
Copy link
Member

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
Copy link
Member Author

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
Copy link
Member

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
Copy link
Member Author

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
Copy link
Member

@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
Copy link
Member Author

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
Copy link
Member Author

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add tooltip keyboard shortcuts
3 participants