p5.js-web-editor
p5.js-web-editor copied to clipboard
Download fails silently when logged out
p5.js version
n/a
What is your operating system?
Windows
Web browser and version
firefox 139 / edge 136
Actual Behavior
nothing happens
Expected Behavior
if downloading is not allowed the option should be greyed out or better there should be a modal popup indicating what is the issue
Steps to reproduce
file->download a user's sketch when logged out
@raclim Can I work on this issue?
@yugalkaushik yes please feel free to go ahead! :)
@eyaler @raclim I added a tooltip, since a popup can't be linked to the unauthenticated download button because nav buttons are disabled by default when the user isn't logged in.
Thanks for the update @yugalkaushik!
As we discussed in the linked PR, if we want to use a tooltip, we may need to first come up with a way to implement one that's WCAG 2.2 compliant. I'm wondering since the Download button is already disabled when the user isn't logged in, maybe another potential solution could be updating the design to make it's disabled state a bit more evident?
Yes, that makes sense. We can update the design of the disabled button to make it more visually distinct something like a greyed-out button should help indicate it's inactive.
Hey folks,
A few fixes i think we could do to make disabled options more evident:
- use
cursor: not-allowedinstead ofpointer - don't highlight on hover or keyboard navigation
- use muted text colors for disabled options
- keep focus outline visible for accessibility
- (optional) a WCAG compliant tooltip for more info on why it's disabled
Perhaps, instead of a tooltip, we could also directly have "Login to download" as the text which:
- lets the user know exactly what to do without hovering
- wouldn't need to worry about accessibility as it always in the front
- will save us from an extra tooltip component (though it would be a small component)
But then, for every disabled option we'd also need to update the text like, "Login to save", "Login to duplicate", etc..
Let me know what you folks think on this. I can join @yugalkaushik if any help is needed :D
I found this issue when I was having a similar but not exactly the same problem, which is that download doesn't work for me when I am logged in but trying to download another user's sketch.
My use case is that I am a teacher and trying to save a copy of a student's work (mostly because sometimes they forget to duplicate it before creating a revision, and sometimes I need to grade them based on whether they revised an assignment in the way I asked them to).
I don't know if the thinking is that not allowing downloading of another user's work is a security feature, but for any sketch that can viewed publicly, it's essentially downloaded by the browser, and can be viewed and copied. It's just that you don't have the convenience of downloading one zip file. And, since you can duplicate another user's project in the editor and then do what you want with it (including download it), it really doesn't do much to prevent downloading.
So, my question is why are downloads disabled at all? I'm curious if a simpler (and inherently accessible!) solution would be to just allow downloads in cases where it's currently disabled?
I will admit that I haven't actually found the code that prevents downloading for either the not-logged-in or logged-in-but-different-user cases, so maybe they aren't even related issues and/or there are some obvious technical considerations I'm not thinking of. (If someone knows where that code is in this repo, can you drop a link here?)