Eui: [META] Compressed panels release plan

Created on 5 Sep 2019  ยท  5Comments  ยท  Source: elastic/eui

This is a meta ticket to describe some basic timelines for merging compressed panels into EUI and Kibana. If you have questions ask @cchaos or @snide

Summary

One of the feedback points we've taken to heart in design is that a lot of EUI's form controls are too bulky for heavy interactive UI like those found in maps, cavas, viz and lens. As a team we decided to rework the compressed (so named for a prop that lives on all EUI form controls) forms to allow them to take up less space and be a little more on demand with their functionality. Below is a good example of how this works.

image

What specifically changed?

  • Any form control with compressed got some tweaks to make them more minimal
  • We added compressed stylings to several components that did not yet have them
  • Compressed forms can now show in an inline format so labels show to the left
  • We added some new functionality to troublesome components like range inputs so they weren't as visually bulky
  • [BREAKING] EuiFormRow no longer has bottom padding, nor does it add margin to any + * siblings. Instead, it only adds top margin to siblings of the same type .euiFormRow + .euiFormRow This means if layouts relied on margin being added to non-form row children, they'll need spacers added. https://github.com/elastic/eui/pull/2181
  • [BREAKING] EuiFormRow no longer passes compressed down to its children. This was not correct anyway but React wasn't complaining because the prop was fully lowercase. If the child didn't have a prop called compressed it was being passed down as an html attribute like which is invalid. https://github.com/elastic/eui/pull/2181

PRs as part of this change

Kibana follow up

9/11 - Merge event in EUI

9/13 - Initial EUI merge into Kibana https://github.com/elastic/kibana/pull/45475/

  • [x] Update hard "breaks" in Kibana for EUI PR @cchaos

During 7.5 dev - Once merged into Kibana

  • [x] Overall sanity checking @snide / @cchaos
  • [ ] Viz panels @snide
  • [x] Maps panels @cchaos / @miukimiu
  • [x] Canvas panels (https://github.com/elastic/kibana/issues/45904) @ryankeairns / @andreadelrio
  • [x] Lens panels @cchaos / @miukimiu
  • _Additional parts of Kibana UI to be added by the person who wants to take it on_

Tentative deadlines

Friday, Sept 20: Cleanup PR's created. Cleanup entails just fixing the first 4 items in the checklist below.

Wednesday, Sept 25: Cleanup PR's merged

Friday, Oct 4: Enhancement PR's created. These should entail mostly quick/but substantial changes to compressed forms to make them more aligned to our end goal of the editor style controls. The enhancements section of the checklist below.

EUI Follow up

The following form controls are currently lacking support

| control | compressed | prepend | append | other |
|---|---|---|---|---|
| EuiFieldSearch | โœ”๏ธ | โœ”๏ธ | โœ”๏ธ | |
| EuiFieldPassword | โœ”๏ธ | โŒ | โŒ | |
| EuiSelect | โœ”๏ธ | โœ”๏ธ | โœ”๏ธ | id does not seem to get passed to the actual select tag |
| EuiSuperSelect | โœ”๏ธ | โŒ | โŒ | |
| EuiComboBox | โœ”๏ธ | โœ”๏ธfor singleSelect only | โœ”๏ธfor singleSelect only | uses isDisabled instead of disabled |
| EuiColorPicker | โœ”๏ธ | โœ”๏ธ | โœ”๏ธ | no isLoading |
| EuiRange | โœ”๏ธ | โœ”๏ธ | โœ”๏ธ | |
| EuiDualRange | โœ”๏ธ | ๐Ÿšซ | ๐Ÿšซ | |
| EuiButtonGroup | โŒ | ๐Ÿšซ | ๐Ÿšซ | |
| EuiFilterButtonGroup | โŒ | ? as labels maybe | ? | |

The following are features that can be added in future releases

  • [ ] EuiFormRow Ability for consumer to adjust horizontal label size
  • [ ] Create a component specifically for selecting color spectrums/gradients
  • [ ] A square version of EuiColorPicker that just shows the color chosen not the hex. Current one using the swatch is probably too big.
meta

Most helpful comment

Consuming application checklist

Based on the outline above, here is some concrete instructions on how to best update consuming applications.

1. Check for compressed usages

Does this control live within a confined space and is not your typical fill and submit style form? If yes, keep it as compressed. Otherwise, consider removing the compressed property.

โš ๏ธNever mix compressed and non-compressed form controls in the same form.

2. Fix breaks and deprecations on EuiFormRow usages

๐Ÿ’” Break: EuiFormRow no longer has bottom padding, nor does it add margin to any + * siblings. It only adds spacing if it'sEuiFormRow + EuiFormRow`.

Look for: Any siblings of (components that come directly after) EuiFormRow that now look too close to the form row.

Fix: Insert an EuiSpacer component between the EuiFormRow and following sibling.


๐Ÿ’” Break: EuiFormRow longer passes compressed to its children (form controls).

Look for: Places where EuiFormRow has compressed but the form control does not.

Fix: Add compressed prop to the form control itself as well.


โš ๏ธ Deprecation: The compressed prop should become display="compressed"
โš ๏ธ Deprecation: The displayOnly prop should become display="center" or display="centerCompressed" if it should ale be compressed.

3. Fix breaks with EuiFormLabel usages

๐Ÿ’” Break: EuiFormLabel no longer has bottom margin

Look for: Places where EuiFormLabel is used directly and now looks too close to the component that comes after it.

Fix: insert an EuiSpacer probably with size="s" after the EuiFormLabel.


4. Fix breaks with EuiFilePicker usages

๐Ÿ’” Break: EuiFilepicker now has additional props for display that go hand in hand with compressed prop.

Look for: Places when EuiFilePicker also had compressed.

Fix: Add display="default" onto the component when compressed is used.

Enhancements

Prepend and Appends

Does your control's value have an explicit measurement like "pixels" or "minutes"? Consider adding an append prop to the form control with this measurement like:

<EuiFieldNumber append="px" />
Screen Shot 2019-09-09 at 13 20 56 PM


The checklist

  • [ ] Form control and row properly uses the compressed property.
  • [ ] Fixed any EuiFormRow sibling spacing issues.
  • [ ] Fixed any compressed EuiFormRow children that didn't also have the compressed prop.
  • [ ] Changed EuiFormRow compressed to display="compressed"
  • [ ] Changed EuiFormRow displayOnly to display="center" or display="centerCompressed"
  • [ ] Fixed any EuiFormLabel sibling spacing issues
  • [ ] Fixed any EuiFilePicker compressed issues

All 5 comments

Set up TS tables EUI release before we merge this

The work is pretty much done for this. Just waiting on one EUI PR to clear, and I have a Kibana branch locally that resolves new TS issues.

Consuming application checklist

Based on the outline above, here is some concrete instructions on how to best update consuming applications.

1. Check for compressed usages

Does this control live within a confined space and is not your typical fill and submit style form? If yes, keep it as compressed. Otherwise, consider removing the compressed property.

โš ๏ธNever mix compressed and non-compressed form controls in the same form.

2. Fix breaks and deprecations on EuiFormRow usages

๐Ÿ’” Break: EuiFormRow no longer has bottom padding, nor does it add margin to any + * siblings. It only adds spacing if it'sEuiFormRow + EuiFormRow`.

Look for: Any siblings of (components that come directly after) EuiFormRow that now look too close to the form row.

Fix: Insert an EuiSpacer component between the EuiFormRow and following sibling.


๐Ÿ’” Break: EuiFormRow longer passes compressed to its children (form controls).

Look for: Places where EuiFormRow has compressed but the form control does not.

Fix: Add compressed prop to the form control itself as well.


โš ๏ธ Deprecation: The compressed prop should become display="compressed"
โš ๏ธ Deprecation: The displayOnly prop should become display="center" or display="centerCompressed" if it should ale be compressed.

3. Fix breaks with EuiFormLabel usages

๐Ÿ’” Break: EuiFormLabel no longer has bottom margin

Look for: Places where EuiFormLabel is used directly and now looks too close to the component that comes after it.

Fix: insert an EuiSpacer probably with size="s" after the EuiFormLabel.


4. Fix breaks with EuiFilePicker usages

๐Ÿ’” Break: EuiFilepicker now has additional props for display that go hand in hand with compressed prop.

Look for: Places when EuiFilePicker also had compressed.

Fix: Add display="default" onto the component when compressed is used.

Enhancements

Prepend and Appends

Does your control's value have an explicit measurement like "pixels" or "minutes"? Consider adding an append prop to the form control with this measurement like:

<EuiFieldNumber append="px" />
Screen Shot 2019-09-09 at 13 20 56 PM


The checklist

  • [ ] Form control and row properly uses the compressed property.
  • [ ] Fixed any EuiFormRow sibling spacing issues.
  • [ ] Fixed any compressed EuiFormRow children that didn't also have the compressed prop.
  • [ ] Changed EuiFormRow compressed to display="compressed"
  • [ ] Changed EuiFormRow displayOnly to display="center" or display="centerCompressed"
  • [ ] Fixed any EuiFormLabel sibling spacing issues
  • [ ] Fixed any EuiFilePicker compressed issues

A community member contributed a nice new custom avatar feature here: https://github.com/elastic/kibana/pull/45148

It needs some design touchup and would also benefit from the compressed styles.

Adding prepend / append props for inline labels to EuiFilterGroup came up recently in the Infrastructure Metrics app in this PR https://github.com/elastic/kibana/pull/47083

This is all done, closing in favor of follow up issue #3121

Was this page helpful?
0 / 5 - 0 ratings