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
Dashboard sorting #5153
Dashboard sorting #5153
Conversation
Removed the attempt at locale-aware sorting for now - the |
in #5152 @minrk also suggested hiding directories that start with a Personally, I think it's weird to hide directories that start with an underscore - some people rename files/directories to have a leading Hiding |
If special casing |
I believe the existing logic hides folders that begin with a dot. I did add No strong feelings on whether to hide everything with a leading underscore |
@@ -175,13 +178,14 @@ def list_dirs(self, path): | |||
dirs = [] | |||
for name in dir_names: | |||
os_path = self.get_os_path(name, path) | |||
if os.path.isdir(os_path) and not is_hidden(os_path, self.notebook_dir): | |||
if os.path.isdir(os_path) and not is_hidden(os_path, self.notebook_dir)\ | |||
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.
There are other calls to is_hidden
where we probably want to add the _
test as well:
- I think a few other places in filenbmanager.py
- /IPython/html/base/handlers.py L263
- ./IPython/html/tree/handlers.py L65
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 was deliberately leaving other locations so that _
directories were hidden from the list but still accessible (like _private attributes in Python), while we outright ban access to .
directories like .ssh
. I'm happy to reconsider that, though.
What do you feel about hiding all _
prefixed directories vs. special casing __pycache__
?
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 I lean toward special-casing __pycache__
at this point.
After discussion with @minrk , we're back to special casing Our hiding of |
On Python 2, locale.strxfrm() can't handle unicode.
It would be really useful to list notebooks and directories in reverse order of modification, so that one can easily navigate to recently used notebooks. Modifying the sort_key function easily achieves this, but changing the javascript etc to allow switching between alphabetic and modification time views is more complicated than I've time for now and has layout implications for the dashboard. An imperfect halfway house would be to configure the sort key from ipython_notebook_config.py. |
We plan to have more sophisticated sorting in the dashboard in |
Dashboard sorting closes ipython#5151 closes ipython#5152
_
(Hide __pycache__ in dashboard directory list #5152)Possibly ordering should be done by the frontend, but we're already relying on the order from the API to get index.ipynb and directory names before other things.