I am doing UI/UX testing for issue #2142. The Edit/View button are either not working or working in a way that is really confusing. Here is what I observe:

Is this a bug?
My recommendations:
@gnestor
We added these because previously you couldn't do either of these things from the UI:
The error viewing an HTML page is a bug; I'll look into that.
I think we can close this one as it is html view is fixed by #2208. And I agree with @takluyver that we should not be too smart. Edit/View everywhere seem fine to me.
Not thrilled with all the buttons, but ok ๐
I don't understand why we would introduced new buttons that don't do anything useful.
Sent from my iPhone
On Feb 22, 2017, at 10:47 AM, Matthias Bussonnier notifications@github.com wrote:
I think we can close this one as it is html view is fixed by #2208. And I agree with @takluyver that we should not be too smart. Edit/View everywhere seem fine to me.
โ
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
They both do something useful under certain conditions; see my earlier comment.
Got it! I missed the issue of editable files that report the an unexpected MIME type. But allowing users to click on files that we know they won't be able to edit is very confusing (images in particular). Given this new information, my preference would be:
There is another minor use for 'view', which I forgot - it gives you a way to get the raw text of a file which would otherwise open in the text editor. Possibly niche, but could be useful if you have e.g. a very long file.
I'd broadly agree with hiding edit when only images are selected, but we need to be a bit careful, because image/svg+xml, for instance, is text. The media part of mimetypes turns out not to be that helpful for us.
Only offer "View" for HTML files.
Why ? Html are perfectly valid text files. Can't you edit a template.html file that you use from Python in Jupyter.
Show "Edit" always, except for image MIME types.
Why ? Isn't SVG a valid image format you might want to edit with a text editor?
Well, just ๐ด with @takluyver and I think we agreed, we don't want to be in the businesss of deciding what can and/or cannot be viewed/editted.
@Carreau sorry I think there were two possible meanings in my sentence "Only offer "View" for HTML files":
I was meaning (2), so that yes, you would see the "Edit" button for HTML files. But you wouldn't see the "View" button for other things.
And by image types, I was only referring to jpg/png, not svg, which is definitely text and can be edited just fine. Right now if you "edit" a jpg or png, it opens the text editor, but it fails with an encoding error. If a user says "Edit this jpg file" that is a disappointing and confusing outcome...
@takluyver I agree that getting the raw text of a text file using "View" would be useful, but that doesn't work right now. The View button only shows (as far as I can tell) for HTML files. So actually, the current behavior actually matches my preference (View only shows for HTML files).
So I think the only change I would like is to not show the "Edit" button for the image/png and image/jpeg file types.
For HTML files only offer the View option (not the Edit one)
Only show the View button for HTML files and no other files.
I was meaning (2), so that yes, you would see the "Edit" button for HTML files. But you wouldn't see the "View" button for other things.
Ah ! Sorry for the confusion.
but you wouldn't see the "View" button for other things.
Wait do you mean "Edit" ? Like you don't want the "View" button for images ?
And by image types, I was only referring to jpg/png, not svg, which is definitely text and can be edited just fine. Right now if you "edit" a jpg or png, it opens the text editor, but it fails with an encoding error. If a user says "Edit this jpg file" that is a disappointing and confusing outcome...
I got what you were thinking. The problem is that OS are known to not give the right mimetype. We had many issues with windows reporting css as application/css instead of test/css. Starting to black/whitelist is a rats nest. jpeg ? or jpg? or JPEG ? What if photoshop is installed ? Then it will appear as a photoshop file.
Keep in mind that the button at the top are advanced action, by default clicking on the links will do the right thing (hopefully). And removing either edit (or view) has IMHO more chance of annoying advanced users than to really be annoying for newcomers, and I think that Jupyter have mostly been about allowing users to do arbitrary things, and that would go the opposite way.
I totally agree we should give advanced users the tools they need. The issue in this case is that the "advanced" usage-case buttons are put right in the middle of very basic buttons such as Move, Download and Delete:

That makes the lives of the many non advanced users difficult, just to appease the advanced ones. The right UI for this type of thing would be to put the more advanced action behind a context menu, but I think that is outside the scope of 5.0.
Trying to think about an in between path...
We already have a reg-exp in these code paths for file extensions:
https://github.com/jupyter/notebook/blob/master/notebook/static/tree/js/notebooklist.js#L604
Editing those lists for the Edit/View button is trivial. Also, looking at file extensions is exactly how we map files onto models/views that can view/edit those files in JupyterLab. I can submit a PR to address this...but what to do exactly.
To me, the most important question is this "what precise things do the Edit/View buttons enable a user to do that they could not do otherwise". Based on what Thomas said that is:
Let me see if I can put together a PR that shows the Edit/View buttons for these cases alone.
OK, I think the PR I just submitted addresses everything. Thanks!
I'm still confused. Is this issue resolved? I just upgraded to 5.1.0, and I can not edit what I guess are considered "unknown" files now (but all purely text).
My opinion is to err on side of more flexible. Let anything be editable (with the understandable exception of notebook files, as already done). Maybe use an alert when you click edit to say "Hey, I think this is a binary file, are you sure?", but removing the edit button seem a little drastic to me.
MIME types, accepted extensions, unaccepted extensions (or even other suggestions like binaryornot) all seem to be making the decision for me, when I'd rather decide if I want to be able to click edit or not. Choosing the default behavior is fantastic, but preventing me from editing feels like a little much. Even if I'm only 1% of 1%.
I can work around this by adding a bookmark with javascript:$('.edit-button').css('display', 'inline-block') and clicking it every time I want to edit a file that was determined to not be editable.
Can you give some examples of files that you expect to be able to edit but can't?
@takluyver The GNU Coding standards require all projects to have a set of text files called README, NEWS, ChangeLog, LICENSE, etc. Those are text files without extension. Python's mimetype.guess_type returns (None, None). Jupyter 5.1.0 does not allows those files to be viewed or edited, at least on my system.
As a Unix user, I'm used to think that everything is a text file unless proven otherwise, so this feels backward.
If that is the case (I am not doubting you) then we definitely have a bug.
The edit/view semantics are a bit subtle, sounds like we missed some things.
On Fri, Sep 29, 2017 at 12:00 PM, Alexandre Duret-Lutz <
[email protected]> wrote:
@takluyver https://github.com/takluyver The GNU Coding standards
require all projects to have a set of text files called README, NEWS,
ChangeLog, LICENSE, etc. Those are text files without extension. Python's
mimetype.guess_type returns (None, None). Jupyter 5.1.0 does not allows
those files to be viewed or edited, at least on my system.As a Unix user, I'm used to think that everything is a text file unless
proven otherwise, so this feels backward.โ
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/jupyter/notebook/issues/2203#issuecomment-333210893,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABr0LWbZjb8oDByq3qLTF6JDT6FkCjYks5snT5UgaJpZM4MFi32
.
--
Brian E. Granger
Associate Professor of Physics and Data Science
Cal Poly State University, San Luis Obispo
@ellisonbg on Twitter and GitHub
[email protected] and [email protected]
I'm also on 5.1.0 and the Edit button doesn't show up for .r and .R files either.
@gnestor - can we fix this for 5.1.1? - this is a pretty significant
regression
On Wed, Oct 4, 2017 at 8:16 AM, Dang Trung Kien notifications@github.com
wrote:
I'm also on 5.1.0 and the Edit button doesn't show up for .r and .R files
either.โ
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/jupyter/notebook/issues/2203#issuecomment-334190000,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABr0K8pczPvWiAEAh0wDi7Jyfou33vrks5so6E9gaJpZM4MFi32
.
--
Brian E. Granger
Associate Professor of Physics and Data Science
Cal Poly State University, San Luis Obispo
@ellisonbg on Twitter and GitHub
[email protected] and [email protected]
@ellisonbg Yes, I will push for a 5.2 release tomorrow or Monday with a fix for this.
Thanks!
On Thu, Oct 5, 2017 at 3:16 PM, Grant Nestor notifications@github.com
wrote:
@ellisonbg https://github.com/ellisonbg Yes, I will push for a 5.2
release tomorrow or Monday with a fix for this.โ
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/jupyter/notebook/issues/2203#issuecomment-334607372,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABr0BQSyg74RalkJexH7QWBOCJkNXp7ks5spVUlgaJpZM4MFi32
.
--
Brian E. Granger
Associate Professor of Physics and Data Science
Cal Poly State University, San Luis Obispo
@ellisonbg on Twitter and GitHub
[email protected] and [email protected]
Could we get the current #2871 in as part of 5.2?
@rgbkrk Yes! Shall I merge?
Notebook 5.2.0rc1 is available on PyPI so please give it a try and confirm that this is resolved ๐:
pip install notebook --pre --upgrade
@gnestor, did you mean 5.2.0rc1?
I did ๐คฆโโ๏ธ
Just tested. Works for both .r files and files without extension. Thanks a lot @gnestor ๐
Most helpful comment
Just tested. Works for both .r files and files without extension. Thanks a lot @gnestor ๐