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
Add directory navigation to dashboard #5001
Conversation
Hey @ellisonbg, I see Travis is reporting a build failure, you might want to have a look. I'll play with the code now. Thanks!! I think this will add a ton of usability to 2.0 out the door. |
From first testing: this is AWESOME. Seriously, thanks!! Minor suggestion: perhaps tightening vertical spacing somewhat? Even on a large monitor, I have to scroll a fair bit up and down in large directories, and on laptops it's bound to be worse. Shaving a few pixels in each row will help a lot. I'd use as a baseline the 'compact' choice for display density in gmail (we could make that configurable like gmail later on, but since that's not in the cards for now, I'd err on the side of efficiency and pack more info on the screen). I'll keep playing with it, but I'm already loving it :) |
Each item in the notebook list has a top and bottom padding of 5px. This is On Sun, Feb 2, 2014 at 7:13 PM, Fernando Perez notifications@github.comwrote:
Brian E. Granger |
Yes, I'd play with 3px, see how it looks. Perhaps instead of px it should be in fractions of a letter height? I'm thinking of retina displays, where 2 or 3px is nearly nothing... I think @minrk has a retina screen, he can let us know how it looks there... |
But I think that screen px are not the same as css px - otherwise the On Sun, Feb 2, 2014 at 7:24 PM, Fernando Perez notifications@github.comwrote:
Brian E. Granger |
Also, all of our styling on the dashboard is already in px. On Sun, Feb 2, 2014 at 7:33 PM, Brian Granger ellisonbg@gmail.com wrote:
Brian E. Granger |
Ah, OK, I didn't realize that (and I'm glad that's the case). Then I'd play with very tight numbers (3px or even 2) and see how it feels on your box with directories that have lots of stuff in them... |
Oops, updated comment with correct screenshot above. |
@fperez I just pushed some commits that give proper breadcrumbs and take On Sun, Feb 2, 2014 at 7:42 PM, Fernando Perez notifications@github.comwrote:
Brian E. Granger |
OK, I pushed a commit to take it to 3px. Looks like it works OK. Also added On Sun, Feb 2, 2014 at 7:47 PM, Fernando Perez notifications@github.comwrote:
Brian E. Granger |
Already looks better! I would indeed try to go even tighter, if possible. Note that the spacing below the delete buttons seems a bit larger than above (this is a screenshot taken with a magnifier): Keeping those two the same would be good, perhaps 1px less than what's currently the top spacing and matching the bottom one. Otherwise, usability feels great, I'm using it right now and it's awesome. And with stable URLs, I just started a server on a tmux session (so it survives even accidental terminal closures), and can use my browser bookmarks for persistent navigation if I want. Absolutely fantastic improvement. We knew we wanted this, but I'm amazed at how much it feels like this was just something we can't live without :) |
On Sun, Feb 2, 2014 at 7:56 PM, Brian E. Granger
Could not agree more. That's precisely what I was typing as well :) Fernando Perez (@fperez_org; http://fperez.org) |
I'm wondering if we should change the Dashboard page title to reflect the path. That will make it much easier to find the tab you want once we start having a bunch of them open at different filesystem locations (I'm already seeing that in use). |
This is fabulous! Now, how about we go extend this further, and let people upload files - text files, images, CSVs, that sort of thing - through this interface? I tried hacking on it last night - but I was using Anaconda, and I don't think playing with the IPython source in the Anaconda distribution's a great idea. Anyway, I was trying to modify the existing notebook upload feature, to accept all kinds of extensions, and not just .ipynb. That's a security risk, yeah, so we could always include a list of commonly-used files, and let the javascript upload function check if the file being uploaded matches any of those extensions or not. |
We have plans to do a full refactor/rewrite of the dashboard that will This current PR is just to get the basics of directory navigation in for Glad you like it! On Sun, Feb 2, 2014 at 10:10 PM, Rudi MK notifications@github.com wrote:
Brian E. Granger |
Wow! This looks good. |
+n. Would love to get me hands dirty. |
Very nice! Don't forget to add tests before merging. |
Great improvements, awesome. Do you know what's causing the Travis issues (I haven't had the time to look)? |
Yeah, looks great! |
dirs = [] | ||
for name in dir_names: | ||
os_path = self.get_os_path(name, path) | ||
if os.path.isdir(os_path) and not name.startswith('.'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure about not including the hidden folders in the list?
Taking into account that:
- the notebook will open other sort of files than ipynb,
- some config files are behind hidden folders,
Just thinking loud 😉 because I am not sure to including now too...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The /files
handler already prevents access to hidden files. This was a rather quick and dirty fix so that if you start the server in your home directory, you're not serving your SSH keys.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, thanks for the info @takluyver... I have checked the handlers... thanks for pointing out 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the files handler specifically hides 'hidden' directories as well. Maybe use the same logic (move it, if it's not in a reusable location)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will consolidate this hidden dir logic.
Looks good, and works, I tried it on both Firefox and Chrome w/ Linux Mint 👍 |
OK I have added test - still waiting for Travis to finish, but it passed the new tests I wrote and the html tests that were failing before. But I have a few more minor things to finish before this gets merged. Will ping when it is ready. |
Right - one CSS px is actually one point, not one physical pixel. In 2x mode, this is a 2x2 square of physical pixels, but it can also be all kinds of other crazy things (on my screen right now, 1 CSS px is actually 1.3125 pixels²). |
That's a good idea. Then there would only be one save. It could also be implicit on the 'type' key, since it will presumably only ever be notebooks that use JSON. If we ever add other special JSON formats, presumably they will also get a 'type' entry. |
The only place the extension is not wanted is editing a name during upload. Everywhere else, it's actually wanted.
I've just added some unicode and space-having paths, and these are definitely failing. I'm going to try to fix those, and send you a PR. |
don't strip '.ipynb' from notebook names in nblist
OK @minrk I think I have done everything but the In order to put up the 404 when the user tries to visit hidden dirs in the dashboard, I had to also made |
Thought/question on this one: navigating back to the very top from the breadcrumbs requires clicking on a single '/', which is both narrow (requiring fine motor control) and also not very obvious. I wonder if we could find a way to represent that root dir in a bit more obvious/intuitive way that's also easier t click on. I was thinking something like 'notebooks://' or 'ipynb://' or similar, but I don't really have a good idea I like. Just thinking out loud... |
Yes, it is not ideal by any means. Maybe "Home"? |
+1 to "Home" |
Make it a Home Font awesome Icon, it does not need to be translated :-) |
+1 to using an icon instead of a word for the root location. |
""" | ||
inside_root = absolute_path[len(absolute_root):] | ||
if any(part.startswith('.') for part in inside_root.split(os.sep)): | ||
if is_hidden(abs_root, abs_path): | ||
raise web.HTTPError(403) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you were going to make this 404
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, good catch.
Love the home icon! |
Ok I think this is ready to go unless there are more comments. Thanks for the review @minrk ! |
Add directory navigation to dashboard
Wohoo, awesome!! I'm truly thrilled, thanks for this. |
I know this has been merged, but @ellisonbg asked me about the decision on window/page title (which appears in the tab name and window title for browsers that show that like Ffox/Safari). Do we want to push that to a new issue? I honestly don't have hugely strong feelings on the matter, but I'm happy to help out finish up the discussion in a new issue if we want to feel like we've covered the main bases for the navigable dashboard. |
Why don't we just live with it for a week and see how we feel about it. I don't think we need to open a new issue until we know we want to make a change. |
+1 |
Add directory navigation to dashboard
OK, this is what happens when the Super Bowl turns out like this...
I talked to @fperez today and we both feel that it is important to have some sort of minimal directory navigation in the dashboard for 2.0. This is an attempt to do that with a minimal amount of technical debt. Here is the rough outline:
FileNotebookManager
s list of notebooks. This is localized into two methods that can be easily removed once we have the full contents web service...
.ipynb
to notebook items, like we do for nbviewer.Here is a screenshot: