Skip to content

[Discover] Fix doc viewer table columns#113124

Merged
dimaanj merged 8 commits intoelastic:masterfrom
dimaanj:fix-doc-viewer-table-columns
Oct 1, 2021
Merged

[Discover] Fix doc viewer table columns#113124
dimaanj merged 8 commits intoelastic:masterfrom
dimaanj:fix-doc-viewer-table-columns

Conversation

@dimaanj
Copy link
Copy Markdown
Contributor

@dimaanj dimaanj commented Sep 27, 2021

Summary

Fixes #112966

Checklist

Risk Matrix

Delete this section if it is not applicable to this PR.

Before

07F98A44-862F-4D71-9DC2-0F37080F057E

A7AB26A7-DDE8-42F7-BAF8-00E849872648

658423F4-9D94-44D9-BA95-27CF2E6C4E40

After

05A98831-FF3B-4695-9CDD-04E457BA4FA4

EE012B23-7A4C-45C3-B2A5-EE92FE40A307

75DFA90B-6EB9-489A-ACB4-5B5B6D8CB485

Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.

When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:

Risk Probability Severity Mitigation/Notes
Multiple Spaces—unexpected behavior in non-default Kibana Space. Low High Integration tests will verify that all features are still supported in non-default Kibana Space and when user switches between spaces.
Multiple nodes—Elasticsearch polling might have race conditions when multiple Kibana nodes are polling for the same tasks. High Low Tasks are idempotent, so executing them multiple times will not result in logical error, but will degrade performance. To test for this case we add plenty of unit tests around this logic and document manual testing procedure.
Code should gracefully handle cases when feature X or plugin Y are disabled. Medium High Unit tests will verify that any feature flag or plugin combination still results in our service operational.
See more potential risk examples

For maintainers

@dimaanj dimaanj added Feature:Discover Discover Application release_note:fix v8.0.0 v7.16.0 v7.15.1 Team:DataDiscovery Discover, search (data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. t// labels Sep 27, 2021
@dimaanj dimaanj requested a review from a team September 27, 2021 14:15
@dimaanj dimaanj self-assigned this Sep 27, 2021
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

@kertal
Copy link
Copy Markdown
Member

kertal commented Sep 28, 2021

ACK, will review

@kertal
Copy link
Copy Markdown
Member

kertal commented Sep 29, 2021

@elasticmachine merge upstream

Copy link
Copy Markdown
Member

@kertal kertal left a comment

Choose a reason for hiding this comment

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

this would fix the issue 👍 . however there's one thing I'd like to discuss. So when you have just short filenames and a very broad screen, there's lots of whitespace with this approach:

Bildschirmfoto 2021-09-29 um 11 23 05

the alternative solution would be to assign a min width to the fieldname column like this:

.kbnDocViewer__tableRow td:nth-child(2) {
    min-width: 108px;
 }

Then it would look like this:
Bildschirmfoto 2021-09-29 um 11 20 12
More space for the value which I think is more imortant in this case

WDYT dear @elastic/kibana-design

Here's some testdata

POST testdata/_doc/1
{
  "veryvery.very.very.very.veryvery.veryveryvery.very.veryvery.veryvery.very.veryvery.very.very.very.very.very.veryveryvery.long.key": "shortvalue"
}

POST testdata/_doc/2
{
  "shortkey": "veryvery.very.very.very.veryvery.veryveryvery.very.veryvery.veryvery.very.veryvery.very.very.very.very.very.veryveryvery.long.keyveryvery.very.very.very.veryvery.veryveryvery.very.veryvery.veryvery.very.veryvery.very.very.very.very.very.veryveryvery.long.keyveryvery.very.very.very.veryvery.veryveryvery.very.veryvery.veryvery.very.veryvery.very.very.very.very.very.veryveryvery.long.keyveryvery.very.very.very.veryvery.veryveryvery.very.veryvery.veryvery.very.veryvery.very.very.very.very.very.veryveryvery.long.keyveryvery.very.very.very.veryvery.veryveryvery.very.veryvery.veryvery.very.veryvery.very.very.very.very.very.veryveryvery.long.keyveryvery.very.very.very.veryvery.veryveryvery.very.veryvery.veryvery.very.veryvery.very.very.very.very.very.veryveryvery.long.keyveryvery.very.very.very.veryvery.veryveryvery.very.veryvery.veryvery.very.veryvery.very.very.very.very.very.veryveryvery.long.key"
}

POST testdata/_doc/3
{
  "veryvery.very.very.very.veryvery.veryveryvery.very.veryvery.veryvery.very.veryvery.very.very.very.very.very.veryveryvery.long.key": "veryvery.very.very.very.veryvery.veryveryvery.very.veryvery.veryvery.very.veryvery.very.very.very.very.very.veryveryvery.long.keyveryvery.very.very.very.veryvery.veryveryvery.very.veryvery.veryvery.very.veryvery.very.very.very.very.very.veryveryvery.long.keyveryvery.very.very.very.veryvery.veryveryvery.very.veryvery.veryvery.very.veryvery.very.very.very.very.very.veryveryvery.long.keyveryvery.very.very.very.veryvery.veryveryvery.very.veryvery.veryvery.very.veryvery.very.very.very.very.very.veryveryvery.long.keyveryvery.very.very.very.veryvery.veryveryvery.very.veryvery.veryvery.very.veryvery.very.very.very.very.very.veryveryvery.long.keyveryvery.very.very.very.veryvery.veryveryvery.very.veryvery.veryvery.very.veryvery.very.very.very.very.very.veryveryvery.long.keyveryvery.very.very.very.veryvery.veryveryvery.very.veryvery.veryvery.very.veryvery.very.very.very.very.very.veryveryvery.long.key"
}

@majagrubic
Copy link
Copy Markdown
Contributor

I like the solution of having min-width in there.

@dimaanj dimaanj requested a review from a team as a code owner September 29, 2021 18:09
@dimaanj
Copy link
Copy Markdown
Contributor Author

dimaanj commented Sep 29, 2021

@elasticmachine merge upstream

@andreadelrio
Copy link
Copy Markdown
Contributor

this would fix the issue 👍 . however there's one thing I'd like to discuss. So when you have just short filenames and a very broad screen, there's lots of whitespace with this approach:

Bildschirmfoto 2021-09-29 um 11 23 05

the alternative solution would be to assign a min width to the fieldname column like this:

.kbnDocViewer__tableRow td:nth-child(2) {
    min-width: 108px;
 }

Then it would look like this: Bildschirmfoto 2021-09-29 um 11 20 12 More space for the value which I think is more imortant in this case

WDYT dear @elastic/kibana-design

I also like the approach you're proposing here. Let's just remember to use Eui variables to get the pixel value $euiSizeM * 9 should get you there.

@dmitriynj if you could add some quick before/after screenshots to these PRs it would be super useful when reviewing.

Copy link
Copy Markdown
Member

@kertal kertal left a comment

Choose a reason for hiding this comment

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

I think the first column should have a fixed width, else it could look like this:
Bildschirmfoto 2021-09-30 um 11 46 02
should work correctly when the change in table_columns.tsx was reverted. CSS change is fine 👍

@dimaanj dimaanj requested a review from kertal September 30, 2021 14:48
@dimaanj
Copy link
Copy Markdown
Contributor Author

dimaanj commented Sep 30, 2021

@elasticmachine merge upstream

@kibanamachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
discover 378.7KB 379.0KB +288.0B

History

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

cc @dmitriynj

font-family: $euiCodeFontFamily;

// set min-width for each column except actions
.euiTableRowCell:nth-child(n+2) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

TIL you can do something like n+2 nice!

Copy link
Copy Markdown
Member

@kertal kertal left a comment

Choose a reason for hiding this comment

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

LGTM, tested a-la-carte with Firefox, Chrome, Safari. Thx for teaching me advanced CSS 🙏

Copy link
Copy Markdown
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.

LGTM

@dimaanj dimaanj merged commit 88fa27d into elastic:master Oct 1, 2021
dimaanj added a commit to dimaanj/kibana that referenced this pull request Oct 1, 2021
* [Discover] fix doc viewer table columns

* [Discover] apply suggestions

* [Discover] apply suggestion

* [Discover] fix action column

* [Discover] do not apply min-width to actions column

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
dimaanj added a commit to dimaanj/kibana that referenced this pull request Oct 1, 2021
* [Discover] fix doc viewer table columns

* [Discover] apply suggestions

* [Discover] apply suggestion

* [Discover] fix action column

* [Discover] do not apply min-width to actions column

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
@byronhulcher
Copy link
Copy Markdown
Contributor

Is it possible this broke master? I'm seeing errors from CI for Quick commit checks after pulling master in with this code.

ERROR 
      src/plugins/discover/public/application/components/doc_viewer/doc_viewer.scss
       15:3  ✖  Cannot parse selector   parseError
       15:3  ✖  Cannot parse selector   parseError
       15:3  ✖  Cannot parse selector   parseError
       15:3  ✖  Cannot parse selector   parseError
       21:5  ✖  Cannot parse selector   parseError
       21:5  ✖  Cannot parse selector   parseError
       21:5  ✖  Cannot parse selector   parseError
       23:7  ✖  Cannot parse selector   parseError

See https://github.com/elastic/kibana/pull/113550/checks?check_run_id=3769108058

@byronhulcher
Copy link
Copy Markdown
Contributor

Sorry, your file appearing may have been a false flag, currently suspecting #113443

dimaanj added a commit that referenced this pull request Oct 1, 2021
* [Discover] fix doc viewer table columns

* [Discover] apply suggestions

* [Discover] apply suggestion

* [Discover] fix action column

* [Discover] do not apply min-width to actions column

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
dimaanj added a commit that referenced this pull request Oct 1, 2021
* [Discover] fix doc viewer table columns

* [Discover] apply suggestions

* [Discover] apply suggestion

* [Discover] fix action column

* [Discover] do not apply min-width to actions column

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

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

Labels

Feature:Discover Discover Application release_note:fix Team:DataDiscovery Discover, search (data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. t// v7.15.1 v7.16.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Event columns do not size properly in Kibana Discover event flyout

7 participants