Show Upload File button when unauthenticated and prompt login (#3079) #3753
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR improves the user experience in the p5.js Web Editor by making it clear that login is required to upload files. Previously, users could not see the “Upload File” button unless they were logged in, which caused confusion when trying to use the
image()function or upload assets.With this update:
Fixes #3079
I have verified that this pull request:
npm run lint)npm run test)npm run typecheck)developbranch.Fixes #3079Before:
image()with local files had no indication that login was required.After:
Implementation Details:
Added conditional rendering for the Upload File button to show it to all users.
Integrated a login prompt for unauthenticated users attempting to upload.
Updated the
image()and file upload UI with:Ensured design consistency with existing UI and accessibility standards.
Modified relevant documentation and contributor guides to reflect this change.
Files Modified:
client/modules/IDE/components/CollectionList,client/components/Menubar,client/styles/components/_editor.scss, etc.client/utils/p5-instance-methods-and-creators.json,client/utils/p5-javascript.js.server/controllers/user.controller,server/utils/fileUtils.js.Benefits:
image()and uploading assets.