Problem/Motivation
After playing more and more with edit in-line I wonder if we can remove some of the timing on the animations. It doesn't feel as "snappy" as it could be, because of resizing and moving of the bar.
Screencast to showcase the behaviour: http://screencast.com/t/svCXp4hbod3f
Opening
When the quick edit mode opens the following two things happen
1) It starts some 10/20px below the top of the "area" you are editing.
2) It grows to the right (I assume to accommodate all the WYSIWYG buttons).
3) Simultaneous with the growing it moves 10/20px to the top.
From my point of view are all of these steps/animations unnecairy. It should where possible just open at the right spot, with the right width. If this requires a small millisecond delay, to calculate this before showing - that should be fine if that makes the UX more smooth.
Moving between fields
There is some easing when you move between fields. I wonder if we can make this more snappy, and/or use acceleration when its in the middle. Because right now, it moves somewhat "slowly" - which makes it feel like its not very fast. Even though it is.
Proposed resolution
This probably needs a whole bunch of feedback, as I am unsure if these are intentional or because its hard to fix, etc.
Remaining tasks
User interface changes
API changes
Comment | File | Size | Author |
---|---|---|---|
#63 | 2270269-63.patch | 1.16 KB | Abhijith S |
#54 | 2270269-54.patch | 1.23 KB | mherchel |
#50 | core-quicker_quickedit-2270269-50.patch | 2.15 KB | jenlampton |
#40 | 2270269-40-patched.mp4 | 7.66 MB | mherchel |
#40 | 2270269-40-unpatched.mp4 | 6.55 MB | mherchel |
Comments
Comment #1
Wim LeersI'd generalize this to saying "fix all of Quick Edit's animations" — we already had an issue for this: #2080205: [META] Fix/finalize CSS transitions or get rid of them, with #2080201: Padding/unpadding of textual fields is no longer animated, feels jerky as a child issue.
I'm open to your suggestions; I'm willing to show/explain you where/how to change all of Quick Edit's transitions/animations and help you get this done.
Comment #2
LewisNymanComment #3
tkoleary CreditAttribution: tkoleary commentedTotally agree with all of this.
Additionally there is a "jump" When the toolbar moves to a new field because it re-adjusts it's position after the padding has been added. Simple solution would be add the padding first then move the toolbar down.
Adding the padding is enough visual affordance that you have re-focused to that field.
Comment #4
tkoleary CreditAttribution: tkoleary commentedI'm also ok with calculating the width first and displaying the toolbar at the correct width so we don't see it "growing". That is unnecessary and distracting to users.
Comment #5
esod CreditAttribution: esod commentedI'll try to help out on this issue. @Wim Leers will you show/explain where/how to disable the transitions/animations? I've disabled all the rules in the Animations section in quickedit.theme.css, switched to the Stark theme, unaggregated css/js and did cache-rebuild, but the animations remain unaffected.
I agree the animations will become tedious and should be removed or accelerated greatly.
Thanks
Comment #6
nod_Should probably toggle animations based on
jQuery.fx.off === true
if possible. See #2312805: Tour does not support turning off animation.Comment #7
tkoleary CreditAttribution: tkoleary commentedLinking to a related issue on the style of the bar: [#2315915}
Comment #8
nod_Comment #9
yoroy CreditAttribution: yoroy commentedAnother +1 for simpler animation here. My observations:
Opening
Both the scaling to the right and the small move upwards seem unnecessary indeed.
Moving between fields
- Overall feel could be snappier indeed, a bit more aggressive ease & ease out.
- Contrary to this, it might be good to wait a bit longer before actually starting the animation to another editable item, because what I see is that the toolbar wants to reset, move back to the title at the top.
- Actually, why does it do this at all (move back to the title)?
Attaching a short video to illustrate those last two points: if I move a bit slowly between author name and date you see the toolbar move back to the title for the time when the mouse is not over an editable part (this is with latest Firefox on OS X).
Comment #10
Bojhan CreditAttribution: Bojhan as a volunteer commented- Can we just completely ease out and ease in, not do any of the moving?
- Can we remove the "move back to title" moving? Again another animation that distracts.
@WimLeers I am happy to help resolve this, but I have no idea where to look.
Comment #11
swim CreditAttribution: swim commentedHi @Bojhan,
The toolbar animations for the Quickedit module resides in the quickedit.theme.css file (core/modules/quickedit/css/quickedit.theme.css). Checkout line 101 for the toolbar container - where the transition is defined. Currently this is set for 1s duration. You're certainly right about tightening this up, setting this property to even half makes sense.
Slightly related why do we only define the -webkit- prefix? Firefox and Opera also provide browser compatibility transition prefixes.
Comment #12
Wim LeersThanks, @swim!
@Bojhan, does that give you enough info to roll a patch?
Comment #14
yoroy CreditAttribution: yoroy at Roy Scholten commentedSomething to have a go at during devdays maybe? :)
Comment #17
mherchelWorking on this with @shaal at #FLDC17
Comment #18
mherchel@shaal and I reduced the animation to 0.2s. Note that we also changed the width of the quickedit toolbar when the admin toolbar is open in vertical mode. This is because the admin toolbar would push over the quickedit toolbar, making the user unable to X out of it at small viewport widths. We also removed unnecessary JavaScript and moved the logic to CSS. The JS was calculating the width of the window, as opposed to the dimensions of the field (as indicated by the comments).
Comment #19
shaalWorking on this with @mherchel #FLDC17
Comment #20
Wim LeersWoah, #18 introduces big changes. That will definitely need manual testing :)
Thanks for taking this on!
Comment #21
GrandmaGlassesRopeManA minor issue I noticed was that the overlay was not being repositioned when the orientation of the toolbar was changed.
The overlay should now automatically adjust whenever the orientation is changed. Additionally,
0.2
felt very fast, moving to0.3
seconds keeps the massive speedup, but makes a bit smoother.Comment #22
mherchel@wim-leers: Thanks! What else needs to happen to move this on. The only changes from the user's point of view should be a faster animation speed. The removal of the JS is code that should be in CSS anyway, since it's not dynamic.
@drpal: Good catch, but that issue isn't introduced by this patch - it's present in the current 8.4.x. Attaching a gif after a git pull (and without the patch)
Should we open another issue?
Comment #23
GrandmaGlassesRopeMan@mherchel
Sure, I can open another issue and add the patch.#2856364: Reposition Quickedit overlay on toolbar orientation changeComment #24
Manjit.Singh@mherchel Animation delays is looks good now ;) Thanks for working out on this.
One thing i have noticed that when we were on description field and if we move pointer directly to top field, over to the quick edit, it is not moving to its default position.
Please look into screencast for better understanding.
Comment #25
mherchel@Manjit.Singh that's a good point, but that behavior also happens in the latest Drupal 8.4.x HEAD and isn't introduced in this patch. I threw up a quick screencast on non-patched drupal 8.4.x at https://youtu.be/fA2Yxqj1hP0 to show the same behavior of Drupal 8.4.x HEAD
In my opinion, I think the current behavior is correct (because the intent of the user may be to interact with the toolbar). But, feel free to create additional issue for more discussion. Thanks for the review though :)
Comment #26
GrandmaGlassesRopeMan@Manjit.Singh Looks like this issue is present prior to this patch. Would you mind opening another issue so we can discuss further? Thanks.Yep. It's a hover/event firing on the correct element issue. However I do think it's the correct behavior.
Comment #27
Wim Leers#21 still includes the changes now moved to #2856364: Reposition Quickedit overlay on toolbar orientation change. Will need a reroll for that.
Well, jesse.beach originally wrote the code that you now deleted. She added it at #1678002-134: Edit should provide a usable entity-level toolbar for saving fields. (Yes, that required me to manually open a bunch of those patch files to find the first one that contained it.) Sadly, no extra background information or rationale there.
This should have some documentation. You wrote
— can you summarize that so that future maintainers won't be cursing that this is incomprehensible? :)Great catch! The comment indeed didn't match the code. I'm no CSS expert, so please bear with me… but as far as I can tell, the CSS and JS are not actually equivalent? How is the CSS still ensuring that on clients with narrow viewports, the min and max width are adjusted appropriately?
Comment #28
GrandmaGlassesRopeManI've rerolled this to not include the changes from #2856364: Reposition Quickedit overlay on toolbar orientation change, this does however still include the increase on the animation length to
0.3s
.Comment #29
mherchelThanks @drpal! You beat me to it :)
@wim-leers: here's the explanation of the removal of the JS and addition of the CSS:
This block of JS sets the the toolbar max-width to 100% if the window width is less than 450px, and sets it to to 450px otherwise.
The same thing can be accomplished by setting max-width to 450px in CSS, since the toolbar will never approach that when the window width is less than that.
This block of JS sets the toolbar's min-width to either the window width, or 240px.
The same thing can be accomplished by setting the min-width to 240px in CSS, since it should never go below that in any circumstance.
This just sets the toolbar width to be 100%, which tells the toolbar to fill up all of the space up until either 1) max-width is reached, or 2) 100% of the containing element is reached (which will be the same as the window width).
With all of that in mind, you can replicate the functionality in standard CSS using
After doing that, we noticed an issue where the toolbar could be pushed off the screen when the toolbar was in vertical mode and was a small viewport. We used the CSS calc() function to accommodate the toolbar (which is a static width).
Let me know if there are any follow up questions, or if something isn't quite clear.
Comment #30
Wim LeersThanks for #29!
Can we move as much of #29 as possible into comments for the CSS? So that the next person doesn't have to do
git blame
, find this issue, find #29, and then go "Ahaaaaaaa"? :)After that, I'm happy to RTBC!
Comment #31
mherchelAttached. Thanks Wim!
Comment #32
Wim LeersVery sorry… but I think we're still losing documentation here. I'm afraid I have to insist on this, otherwise we make future maintenance harder, not easier
We don't have docs for this 240px and 450 px stuff.
But we used to ahve that here.
Let's move this comment from the deleted JS to the newly added CSS (and adapt where necessary).
Supernit: 80 cols…
Comment #33
gaurav.kapoor CreditAttribution: gaurav.kapoor at OpenSense Labs commentedComment #35
starshapedComment #36
starshapedRerolled patch from #33.
Comment #37
starshapedUpdated comments for the min-width, max-width, and general width on the quickedit toolbar container to better explain the reasoning behind why the widths are being implemented this way.
Comment #38
starshapedComment #39
phenaproximaThe patch looks good to me, but I think we might need screen shot(s) or an animated GIF to demonstrate the change, if we can't add automated tests. For now, marking as needing screen shots.
Comment #40
mherchelAttaching two MP4 movies (better to show the animation). One unpatched and the other patched.
Comment #41
phenaproximaHonestly, I think that looks pretty good. The difference is quite clear, and IMHO it makes Quick Edit feel slicker and more usable. Godspeed!
Comment #42
yoroy CreditAttribution: yoroy at Roy Scholten commentedThanks for those movies @mherchel. This looks like a good improvement!
Comment #43
Wim Leers#40 thanks for those screencasts — so much better! :)
Thanks everyone! 👏
Comment #44
lauriiiThe fix itself looks like a great improvement. I'm only concerned that the current patch introduces changes that are not required to fix the bug described in the issue summary/title.
How are these changes related to the scope of this issue? These change probably could be allowed since the change reduces the weight of these CSS properties instead of increasing them. Anyway, this change should probably be done in its own issue.
This is a BC breaking change since it affects stable theme. I also don't quite understand how does this relate to the bug described here which is to do with the animations. If this indeed is needed as part of this change, we should add something about the minor BC break to the issue summary.
Comment #46
yoroy CreditAttribution: yoroy at Roy Scholten commentedBump, lets do this for 8.5 :)
Comment #47
GrandmaGlassesRopeManComment #48
valthebaldComment #49
jenlamptonHere's a reroll of #37 that also addresses feedback from #44.
edit: oops, forgot the patch. Plz see next comment :)
Comment #50
jenlamptonHere's a reroll of #37 that also addresses feedback from #44.
Comment #51
narnua CreditAttribution: narnua as a volunteer commentedtested @jenlamptons patch #50
* patch apply clean
* quick edit is quicker and does not seem nearly as annoying
* concerns from #44 seem to have been addressed properly
* only other changes were about the animation speed 1->0.3, so this patch should only affect what it needs to
Comment #52
lauriiiThe patch currently only modifies the ES5 version of the JavaScript. The JavaScript changes should be made to the ES6 file and then compiled into this ES5 file.
@narnua thank you for your review and explaining well what you took into account in your review. I updated the commit credit so that you will get credited once the issue lands.
@yoroy thanks for the UX reviews, I also added credit for you.
Comment #53
mherchelAccording to #44, we shouldn't be modifying the JS at all.
The previous patches moved functionality from JS to CSS (which is best practice), but this would necessitate a change to Stable, which is out of scope and breaks BC. We should just be modifying the transition property in the CSS.
Comment #54
mherchelPatched attached that changes the timing of the CSS transition and nothing else. This is as basic as it gets :)
Comment #57
andrewmacpherson CreditAttribution: andrewmacpherson as a volunteer commentedQuickedit's animations fall under the new WCAG 2.1 Animation from interactions success criterion.
The related issue to figure out how to support turning animation off moved. We settled on the new
prefers-reduced-motion
as the simplest approach (currently supported by Safari, and coming soon in Firefox). The WCAG "Animations form interactions" SC is level-AAA, and hence not required by our core accessibility gate. However it looks fairly easy to implement with the media query, and it has a high impact for affected users, so we'd like to address it.For Quickedit, can we check the media query in JS, before enabling animations? I don't know if that's something we want to do in this issue, or a separate one.
Comment #62
Abhijith S CreditAttribution: Abhijith S as a volunteer and at Zyxware Technologies commentedCan't apply patch #54 on 9.2.x .Needs reroll
Comment #63
Abhijith S CreditAttribution: Abhijith S as a volunteer and at Zyxware Technologies commentedAdded reroll for patch #54.Please check
Comment #66
SpokjeDue to Quickedit being moved out of Drupal Core and into a Contrib Module, moving this issue to the Contrib Module queue.