Skip to content

[Canvas] Add simple variables to workpads#66139

Merged
poffdeluxe merged 19 commits intoelastic:masterfrom
poffdeluxe:canvas-workpad-vars
Jul 13, 2020
Merged

[Canvas] Add simple variables to workpads#66139
poffdeluxe merged 19 commits intoelastic:masterfrom
poffdeluxe:canvas-workpad-vars

Conversation

@poffdeluxe
Copy link
Contributor

@poffdeluxe poffdeluxe commented May 11, 2020

Summary

Adds variables to Canvas workpads by consuming var function added to the expressions plugin.

At the moment, three variable types are supported: boolean, number, and string.


STILL TODO:

  1. a11y work
  2. UI cleanup
  3. Double check workpad migration

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@botelastic botelastic bot added the Feature:ExpressionLanguage Interpreter expression language (aka canvas pipeline) label May 11, 2020
@thomasneirynck thomasneirynck added the Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// label May 12, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-canvas (Team:Canvas)

@poffdeluxe poffdeluxe force-pushed the canvas-workpad-vars branch from 0c40496 to 1d66696 Compare May 28, 2020 21:00
@poffdeluxe poffdeluxe force-pushed the canvas-workpad-vars branch from 1d66696 to c7e8c3f Compare June 9, 2020 16:56
@poffdeluxe poffdeluxe force-pushed the canvas-workpad-vars branch from baaf27d to 19de317 Compare June 29, 2020 20:21
@poffdeluxe poffdeluxe changed the title Add simple variables to Canvas workpads [Canvas] Add simple variables to Canvas workpads Jul 2, 2020
@poffdeluxe poffdeluxe force-pushed the canvas-workpad-vars branch from 2382b7c to db09ca4 Compare July 2, 2020 21:00
@poffdeluxe poffdeluxe force-pushed the canvas-workpad-vars branch from db09ca4 to 62e2e9d Compare July 2, 2020 21:04
@poffdeluxe poffdeluxe added enhancement New value added to drive a business result impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. loe:medium Medium Level of Effort release_note:enhancement review v7.9.0 v8.0.0 labels Jul 2, 2020
@poffdeluxe poffdeluxe marked this pull request as ready for review July 2, 2020 21:10
@poffdeluxe poffdeluxe requested review from a team as code owners July 2, 2020 21:10
Copy link
Contributor

@andreadelrio andreadelrio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments about using Eui variables. Avoid targeting Eui classes directly whenever possible (not sure you can do that for the table's header and footer but at least try to pass a custom class to the table so you don't target .euiTable).

Also left you a suggestion for the variables' accordion.

position: relative;
left: 0;

transition-property: left;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This transition seems a bit overkill for the space. I'd also keep the accordion's header visible at all times. I don't think you need the back arrow. The Cancel button should be enough. This will result in something like this

agif
agif

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the comment, @andreadelrio! For my part, the panel animation and back button inclusion were both intentional design decisions. Our thinking for recommending them was to give the user the impression that they are traversing one level deeper into the variables panel experience (almost like a modal-within-a-modal experience). The hope was that the animation and back button both help convey this feeling to the user. The back button also affords the user one additional way in which they can remove themselves from the experience, which I don't consider a bad thing.

Regarding keeping the accordion header visible at all times, our thinking was that it is unnecessary to continue to allow the user the ability to collapse a panel in which they have just made an action that tells us they wish to interact with the panel further (via changes to a variable). The hope was that replacing the accordion header with the back arrow and the current action's title maintains a better, simple panel hierarchy, while also further promoting the ideas above. Thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MichaelMarcialis Thanks for explaining that. When I thought about keeping the accordion header visible I didn't think "let's continue to allow them to collapse that panel" but more about "let's give them context and remind them where they are" i.e. Variables > Edit Variable. So in that sense, I think keeping the title could help communicate the existing hierarchy more clearly.

I agree that the back arrow can also help communicate that hierarchy and if you keep it, I would remove the accordion header. I think my main concern is that adding the left to right animation makes the interface feel a bit bloated. Maybe we could use another animation/transition.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool. Just to dig into that a bit more, is it specifically the left-to-right animation that you dislike? Or is it more about timing/easing/etc? I can totally see the feeling of bloat if you feel the transition is a little too sluggish.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool. Just to dig into that a bit more, is it specifically the left-to-right animation that you dislike? Or is it more about timing/easing/etc? I can totally see the feeling of bloat if you feel the transition is a little too sluggish.

It's the timing/easing. It doesn't feel super smooth.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to the animation being a bit rough. In testing this, it seems to freeze mid-way through. If we're going to keep it, then I agree it needs some refinement.

Copy link
Contributor

@ppisljar ppisljar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

app arch changes lgtm

@poffdeluxe
Copy link
Contributor Author

@elasticmachine merge upstream

@elasticmachine
Copy link
Contributor

merge conflict between base and head

@crob611
Copy link
Contributor

crob611 commented Jul 8, 2020

A few visual questions/issues

Do True/False need translations?
image

If the list is sorted by variable type, then the type header is truncated
image

Does the copy snippet need it's own icon AND to be in the triple dot menu?

Copy link
Contributor

@MichaelMarcialis MichaelMarcialis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making those suggested changes, @poffdeluxe. Looks great! Approving.

If I get some time tomorrow, I'll try to join you in fiddling around with our animation options to see if we can smooth the sliding animation out a bit.

@poffdeluxe
Copy link
Contributor Author

@elasticmachine merge upstream

@ryankeairns ryankeairns self-requested a review July 13, 2020 15:10
Copy link
Contributor

@ryankeairns ryankeairns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As evidenced by the gif below, there is still a rather ugly state of the UI that occurs right after creation and deletion of a variable (note: this is in Firefox)

I suppose there could be differing opinions on whether or not this is a showstopper (since it all works fine), but for me it falls below our design threshold since it appears momentarily broken.

Is there anything else that can be done for that momentary glitch right after create/delete? It looks like the form height shrinks and exposes part of the incoming panel before the animation begins. Perhaps showing a loading div or something?

wpvars

@ryankeairns ryankeairns self-requested a review July 13, 2020 16:45
@ryankeairns
Copy link
Contributor

We opted to remove the animation for now given the glitches and inconsistencies which appeared for me in both Firefox and Chrome. The design itself makes sense in that it provides some additional context as the form appears, but we need more time to experiment than what remains in this release.

The feature itself works well, so lets revisit the animation enhancement post FF.

@clintandrewhall
Copy link
Contributor

clintandrewhall commented Jul 13, 2020

nice work, @poffdeluxe and @ryankeairns...!

@andreadelrio Do you have any further changes that need to be made, or can this PR be approved on your part?

@poffdeluxe
Copy link
Contributor Author

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

@kbn/optimizer bundle module count

id value diff baseline
canvas 826 +27 799

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@poffdeluxe poffdeluxe merged commit 4d6ad89 into elastic:master Jul 13, 2020
@poffdeluxe poffdeluxe deleted the canvas-workpad-vars branch July 13, 2020 20:45
poffdeluxe added a commit that referenced this pull request Jul 13, 2020
* Add simple variables to Canvas workpads

* Fix type for workpad variable action and clarify comment

* Fix types in fixtures and templates

* Fixing type check errors on actions

* Addressing pr feedback and refactoring canvas sidebar accordions

* Render true/false instead of Yes/no on variables

* add warning callout when editing a variable

* Address review feedback

* More feedback

* updating storyshot with new edit mode callout

* Some animation tweaks for the panel

* one more panel tweak

* Removing the slide transition for now

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New value added to drive a business result Feature:ExpressionLanguage Interpreter expression language (aka canvas pipeline) impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. loe:medium Medium Level of Effort release_note:enhancement review Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// v7.9.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants