Improve file upload experience in content editor
What does this MR do and why?
Improve file upload experience in content editor:
- Allow multiple files (of mixed types: PDF, images, videos, audio etc) to be uploaded at the same time, using the attachment icon in toolbar, using drag/drop or using paste.
- Prevent uploads from failing if user makes a change while the file is being uploaded.
- Show progress of each upload in a bubble menu when the uploaded file link/image/video/audio is selected.
- Allow audio/video to play even before it is uploaded.
- Prevent files larger than max upload size from being uploaded and show appropriate warning.
- Uploaded images and videos have a
max-width
set. - Show a selection ring around video and audio files.
- If comment is submitted before upload finishes, a broken image/video element isn't added to the page.
- Content editor no longer inserts broken images
- When adding to a link, the link styling disappears until I press the spacebar
- It should be possible to advance the cursor after pressing the spacebar after a link
TODO: (Issues exist on master
as well.)
- Prevent comment/form from being submitted if the upload has not finished yet.
Screenshots or screen recordings
Scenario | Current | This MR |
---|---|---|
Uploading multiple videos |
|
Screen_Recording_2023-05-01_at_12.20.47
|
Uploading very large files |
|
Screen_Recording_2023-05-01_at_12.27.18 Error message is clear, and it shows even before the file has begun uploading. |
Uploading progress | Only a progress indicator is visible, no percentage included. |
Note: Throttle to slow 3G first to simulate a slow upload |
Uploading multiple files | Not possible |
How to set up and validate locally
- Disable live reload and restart GDK.
diff --git a/config/webpack.config.js b/config/webpack.config.js
index 4a3c970427c0..03410a600f5d 100644
--- a/config/webpack.config.js
+++ b/config/webpack.config.js
@@ -60,7 +60,7 @@ const { DEV_SERVER_HOST, DEV_SERVER_PUBLIC_ADDR } = process.env;
const DEV_SERVER_PORT = parseInt(process.env.DEV_SERVER_PORT, 10);
const DEV_SERVER_ALLOWED_HOSTS =
process.env.DEV_SERVER_ALLOWED_HOSTS && process.env.DEV_SERVER_ALLOWED_HOSTS.split(',');
-const DEV_SERVER_LIVERELOAD = IS_DEV_SERVER && process.env.DEV_SERVER_LIVERELOAD !== 'false';
+const DEV_SERVER_LIVERELOAD = false;
const INCREMENTAL_COMPILER_ENABLED =
IS_DEV_SERVER &&
process.env.DEV_SERVER_INCREMENTAL &&
- Enable feature flag:
echo "Feature.enable(:content_editor_on_issues)" | rails c
- Navigate to an issue and try to write a comment. Switch to content editor using the bottom right switcher.
- Use the to attach one or more files, images, videos, audio etc.
- Try to edit the page while the file is being uploaded.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Himanshu Kapoor