Conversation
This comment has been minimized.
This comment has been minimized.
|
I'm generally not in favor of tweaking Kibana away from the default settings to run tests. It opens the opportunity for our tests to pass but the un-tweaked behavior to fail for customers. Animation of EUI components have caused us some pain in automated tests. But I'd prefer we add data-test-subjs to those components that the automation could use to know when the element was ready to use vs changing 30 files to allow disabling them. Could the EUI components access some global style sheet to enable/disable animations? This seems like the kind of reason we're switching over to using EUI components. |
003c1c4 to
7f12510
Compare
We could, but EUI isn't the only think animating, and the most problematic animation for me are the tooltips in the global nav, which are powered by bootstrap... Turning animations off is globally is so easy I don't feel like it makes sense to limit this to EUI. |
bac1c66 to
aef0b6a
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Should the setting be |
|
It could be, I just prefer |
💔 Build Failed |
5f59a47 to
9a26908
Compare
cjcenizal
left a comment
There was a problem hiding this comment.
Tested locally, works great! I had some comments and questions.
There was a problem hiding this comment.
I'm thinking that we might not need the description as to why users might want to turn off animations. Can we simplify to:
Turn off all unnecessary animations in the Kibana UI. Refresh the page to apply the changes.
test/common/services/es_archiver.js
Outdated
There was a problem hiding this comment.
More of an observation than a comment... this code really requires an understanding of what stats is, what its created property represents, what kibanaServer is, what its uiSettings property is, and what calling update with an empty object will do wrt overrides and the Kibana index. I don't think any of this would be apparent without this comment, so the comment is great but ideally the code would be a little more transparent, too.
test/common/services/es_archiver.js
Outdated
There was a problem hiding this comment.
Why do we need to do this? Is it not enough to set it in ui_settings.js?
There was a problem hiding this comment.
Well, the esArchiver wipes out the .kibana index on a regular basis, which is why I added the ability for test configs that use the esArchiver to automatically update the uiSettings without needing to call uiSettings.update() after each esArchiver.load(). I'm going to fix the config name though to not explicitly mention disabling animations, as what it's really doing is enforcing the overrides in the kibanaServer.uiSettings service.
There was a problem hiding this comment.
Since we're not injecting any JS variables here, would it make more sense to use a system similar to how we apply EUI themes?
There was a problem hiding this comment.
There was a problem hiding this comment.
Yeah, I considered something like that, but none of the existing style-inclusion features really seemed to fit in my eyes, but this one felt the most similar because it's dynamically defining the css in a style block based on config.
Maybe I could add a theme.extendTheme(css) method that will include additional css in the theme style element every time, regardless what the theme is, or maybe I could use the the "usable" feature of the webpack style-loader to dynamically add and remove just a single style sheet, or maybe we just want a module in ui/styles somewhere that watches the config and adds/removes an element from the <head> based on the config... Which would you choose?
There was a problem hiding this comment.
a module in ui/styles somewhere that watches the config and adds/removes an element from the based on the config
This sounds the simplest to me, though I think adding a specific node to ui_render/views/chrome.pug for mounting the styles would be a good idea, to make the CSS load-order transparent.
💔 Build Failed |
|
Weird selenium failure: |
|
Retest |
cjcenizal
left a comment
There was a problem hiding this comment.
Thanks for making that change to esArchiver! It's much easier for me to follow the code now.
There was a problem hiding this comment.
Would it make sense to just pass defaults and uiSettings as arguments into extendEsArchiver? Seems like a bit of a code smell to pass someone a tool-fetching assistant when you could just hand them the tool they want.
There was a problem hiding this comment.
Yeah, that was my original implementation, but the kibanaServer service might not be available, so I'm relying on the fact that the uiSettings.defaults setting is used to determine that I should load the kibanaServer service. This meant that I had to encode into the esArchiver when the kibanaServer would be interested in extending it. Rather than basing it on the existence of the uiSettings.defaults config I had added a hasService() method to the service loader that esArchiver was using to check for the kibanaServer service before calling it's extendEsArchiver() function... But that felt like a lot of changes just to avoid passing the getService() function to extendEsArchiver(). Happy to go back to it if you think that's a better approach.
There was a problem hiding this comment.
Welp, thought about it again and it really wasn't that much trouble, implemented in c149e11
There was a problem hiding this comment.
Oh I see. I think it's OK as-is. Could you leave a comment on line 31 to explain this relationship?
// The kibanaServer service won't be available unless uiSettings.defaults has been set.
const { uiSettings } = getService('kibanaServer');f800f35 to
b961991
Compare
This comment has been minimized.
This comment has been minimized.
a4cd844 to
f3abe1d
Compare
💚 Build Succeeded |
This comment has been minimized.
This comment has been minimized.
dc1fc1c to
e06fdb1
Compare
💚 Build Succeeded |
|
retest |
💚 Build Succeeded |
|
retest |
💚 Build Succeeded |
💚 Build Succeeded |
|
retest |
💚 Build Succeeded |
7cb23e9 to
4fdbadc
Compare
💔 Build Failed |
4fdbadc to
eedef9e
Compare
💚 Build Succeeded |
|
6.x/6.5: 138f456 |
Based on #21747
Introduces a new uiSetting
accessibility:disableAnimations, which disabled all non-essential animations in Kibana.From the WCAG guidelines:
To implement this mode the
accessibility:disableAnimationsadvanced config is watched, and when set to true the following styles are injected into the head of the document:These styles set the duration of animations/transitions to
0sinstead of disabling animations completely withanimations: noneor something similar to ensure that animation callbacks, required by some components to function, are still called as before.These styles also allow animations that are essential to the functionality or the information being conveyed to prevent being selected by using the
essentialAnimationclass on the element that is being styled.