Skip to content
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

[Table Vis] Fix visualization overflow #62630

Merged
merged 4 commits into from
Apr 9, 2020

Conversation

sulemanof
Copy link
Contributor

@sulemanof sulemanof commented Apr 6, 2020

Summary

In some cases when a visualization has a horizontal scrollbar (table vis in this case),
the editor sidebar goes out of screen:

table_overflow

The issue was firstly mentioned here: elastic/eui#2701 (comment)
but since the Resizable component is not ready yet, I think it worth a fix in the kibana codebase

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@sulemanof sulemanof added release_note:fix Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.7.0 v7.8 v8.0.0 labels Apr 6, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@sulemanof sulemanof marked this pull request as ready for review April 6, 2020 16:06
@sulemanof sulemanof requested a review from a team as a code owner April 6, 2020 16:06
@cchaos
Copy link
Contributor

cchaos commented Apr 6, 2020

It looks like the proper fix would be to ensure that the calculations of the panel widths take the width of the resizer into account, which it currently does not. For example, the left side width is 71.6177% and the right side width is 28.3735% which adds up to ~100%.

I worry that adding a blanket overflow: auto may add unnecessary scrollbars to particular visualizations that may not be want we want. This page is notoriously nested and there was a lot of work ensuring it's ok across the different viz types.

I would instead, fix the calculation of the resizer, even if it just ends up applying the width as a calc. EG: width: calc(71.6177% - 12px)

@rayafratkina rayafratkina added v7.8.0 and removed v7.8 labels Apr 6, 2020
@sulemanof
Copy link
Contributor Author

It looks like the proper fix would be to ensure that the calculations of the panel widths take the width of the resizer into account, which it currently does not. For example, the left side width is 71.6177% and the right side width is 28.3735% which adds up to ~100%.

I worry that adding a blanket overflow: auto may add unnecessary scrollbars to particular visualizations that may not be want we want. This page is notoriously nested and there was a lot of work ensuring it's ok across the different viz types.

I would instead, fix the calculation of the resizer, even if it just ends up applying the width as a calc. EG: width: calc(71.6177% - 12px)

The issue is not caused by the resizer width here, you could even remove it from the DOM to reproduce it:

table

In 7.6 there was one layer nested less :

image

where the visEditor__canvas takes care of overflow: auto.

But now there is a parent div added with class visEditor__visualization :

image

So adding this rule won't break up any existing vis, since they are already overflowed in a child div.
At least I didn't notice any break in other visualizations

@@ -72,6 +72,7 @@
display: flex;
flex-basis: 100%;
flex: 1;
overflow: auto;
Copy link
Contributor

Choose a reason for hiding this comment

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

Ok I've tested it further and can reproduce. I had to shrink my screen's width in order to see the sidebar width get smaller than the min-width of 350px.

Can you change this to hidden though, as then we know we won't get unwanted scrollbars and it will force the inner child to show the scrollbars instead.

Suggested change
overflow: auto;
overflow: hidden;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, done

Copy link
Contributor

@cchaos cchaos left a comment

Choose a reason for hiding this comment

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

👍 I only checked this in Chrome. Probably worth checking in FF & IE11

Copy link
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

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

Tested in Chrome and Firefox and works for me - couldn't convince IE to start up.

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

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

@sulemanof sulemanof merged commit abe3ccf into elastic:master Apr 9, 2020
@sulemanof sulemanof deleted the fix/data_table_vis branch April 9, 2020 14:00
sulemanof added a commit to sulemanof/kibana that referenced this pull request Apr 9, 2020
* Fix data table vis overflowing

* Change overflow to hidden
sulemanof added a commit to sulemanof/kibana that referenced this pull request Apr 9, 2020
* Fix data table vis overflowing

* Change overflow to hidden
sulemanof added a commit that referenced this pull request Apr 9, 2020
* Fix data table vis overflowing

* Change overflow to hidden
sulemanof added a commit that referenced this pull request Apr 9, 2020
* Fix data table vis overflowing

* Change overflow to hidden
jloleysens added a commit to jloleysens/kibana that referenced this pull request Apr 9, 2020
…chore/put-all-xjson-together

* 'master' of github.com:elastic/kibana:
  [EPM] Update UI copy to use `integration` (elastic#63077)
  [NP] Inline buildPointSeriesData and buildHierarchicalData dependencies (elastic#61575)
  [Maps] create NOT EXISTS filter for tooltip property with no value (elastic#62849)
  [Endpoint] Add link to Logs UI to the Host Details view (elastic#62852)
  [UI COPY] Fixes typo in max_shingle_size for search_as_you_type (elastic#63071)
  [APM] docs: add alerting examples for APM (elastic#62864)
  [EPM] Change PACKAGES_SAVED_OBJECT_TYPE id (elastic#62818)
  docs: fix rendering of bulleted list (elastic#62855)
  Exposed AddMessageVariables as separate component (elastic#63007)
  Add Data - Adding cloud reset password link to cloud instructions (elastic#62835)
  [ML] DF Analytics:  update memory estimate after adding exclude fields (elastic#62850)
  [Table Vis] Fix visualization overflow (elastic#62630)
  [Endpoint][EPM] Endpoint depending on ingest manager to initialize (elastic#62871)
  [Remote clusters] Fix flaky jest tests (elastic#58768)
  [Discover] Hide time picker when an indexpattern without timefield is selected (elastic#62134)
  Move search source parsing and serializing to data (elastic#59919)
  [ML] Functional tests - stabilize typing in mml input (elastic#63091)
  [data.search.aggs]: Clean up TimeBuckets implementation (elastic#62123)
  [ML] Functional transform tests - stabilize source selection (elastic#63087)
  add embed flag to saved object url as well (elastic#62926)

# Conflicts:
#	x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/es_index.tsx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported release_note:fix Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.7.0 v7.8.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants