-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Millisecond glitch on image upload #7548
Comments
@fredck, could you test whether this issue occurs when WidgetTypeAround is disabled (you'd need to remove it from the Widget plugin deps) |
I've just tried it with a local build of GitHub Writer as it suffers with this issue (ckeditor/github-writer#203). Removing that plugin didn't change anything and the glitch is still there. I confirmed that the plugin is disabled because there was no fancy arrows and horizontal carets anymore around the image. I wasn't able to test it with the base64 example, as described in this issue, but I believe you guys should be able to easily do so. Thanks! |
Seems to be related to #7633. |
#7633 makes it quite severe. |
FYI: #7633 is a different issue and there's a PR addressing it. |
Thanks for debugging this, @oleq What worries me, though, is that two similar issues appeared shortly one after another. It's either Chrome's issue or we changed something and it'd be good to know what was that. Also, besides image upload I can see that normal image paste (image copied from the editor) is affected too. The resize handles are repositioned with a long delay, even 300ms-500ms. This definitely didn't happen before. And as Fred checked, this is not related to WidgetTypeAround. You can even observe the glitch on this gif: It'd be good to know WTH is happening there. Bisecting it might actually help a lot. |
@fredck Can you post some GIFs? I'm having trouble reproducing your issue. It's either too subtle or there are some external factors involved. Thanks! |
I also can't reproduce the issue anymore. I saw it previously. |
There's a 200ms throttle on redrawing the handles after you click on the image - https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-widget/src/widgetresize.js#L90 I had a pretty straightforward fix for this 6c2a01c but after Olek's changes I decided to remove it (also because it was related to the |
There should be no delay when the user focuses the image. Throttling makes sense when something happens very frequently. I remember that we added it for performance reasons but that was related to the performance during resizing. Changing how it behaves on image focus must've been coincidental. Anyway, I'm for changing this β on focus the redraw should be immediate. |
@oleq pointed out that we can also think about reconfiguring throttle to execute on the leading edge. That'd shorten the initial reaction. |
So, we have two possible solutions:
|
This glitch is also happening on the linked images - when the user is removing a link from the image. |
Unfortunately, I couldnβt reproduce exactly the same glitch on Chrome / Firefox. But I tried to follow the whole process step by step with devtools and debugger and I presume that the issue may be related to the This means that the placeholder will expand to the whole width of the editor, no matter how wide / big the uploading image is. When we upload a smaller (and "lighter") image β like 200px or so β the placeholder flashes for a moment (with that blue outline and height equals 0 β BUT the placeholder contains Then the uploaded image appears instead. Both, placeholder and actual image have different widths and heights and both have outlines, so it looks like the image stretches and shrinks within a few milliseconds. EDIT: Splitting the gifs above, we can see that it's not a progress bar, but the outline itself (don't know why the placeholder has no height here): Chrome (I don't understand what happened here): cc @oleq |
Thanks, @panr.Β My two cents:BlameI searched git blame and I found out this CodeI also briefly checked the code and it looks like the part responsible for the "glitch" in FF is somewhere in here ckeditor5/packages/ckeditor5-image/src/imageupload/imageuploadprogress.js Lines 85 to 104 in bcf3af6
I started commenting out some of the helpers RecordingsFinally, I decided to capture The Glitch myself. First, I recorded the GIF below in the easy-image manual test on Firefox in 50fps and slowed down to 25%: And here's the same scenario in the Github Writer Firefox addon (also in slow-mo): Note there's a difference between vanilla CKEditor 5 and GHWriter. In the former, the image never stretches to 100% at any point. In the latter, there's a clear moment when the outline takes 100% width of the editing root (it has height, though, unlike the screenshot from the @panr comment above). Which brings a couple of questions:
|
Hmm... are you sure? I caught this yesterday in And today I made these frames to show how I see the process in my editor (Chrome):
I bet that the glitch is somewhere in Maybe we should wait a little bit longer and get the image data (width and height) and then show a placeholder that mimics the actual (fixed) image size? |
@oleq , please double check the width aspect. @panr is right in saying that it also occurs in vanilla CKE5. Disclaimer, poor screenshot resolution because⦠chrome devtools work on such potato screens (make sense from perf perspective). tl;dr;
Based on imageuploadviaurl manual testImage upload (chrome)4 frames are produced (2 reflows + 2 repaints) Image insert by URLFollowing frames are produced:
Fredck caseHere are key frames from fredck screencast:
Notes regarding previous comments
ckeditor5/packages/ckeditor5-image/src/imageupload/imageuploadprogress.js Lines 85 to 104 in bcf3af6
I wonder if that was really the case, as the only thing that I was able to comment out without breaking the feature was |
There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may still be relevant, so if you're interested in the solution, leave a comment or reaction under this issue. |
We've closed your issue due to inactivity over the last year. We understand that the issue may still be relevant. If so, feel free to open a new one (and link this issue to it). |
π Provide detailed reproduction steps (if any)
βοΈ Expected result
Image "uploaded" with no glitches.
β Actual result
A perceivable glitch happens.
π Other details
I wasn't able to reproduce the problem in Chrome, but it has been reported in GitHub Writer that a similar issue happens in Chrome as well: ckeditor/github-writer#203.
If you'd like to see this fixed sooner, add a π reaction to this post.
The text was updated successfully, but these errors were encountered: