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

[Discover] Update data table grid styles #164187

Closed
wants to merge 20 commits into from

Conversation

jughosta
Copy link
Contributor

@jughosta jughosta commented Aug 17, 2023

Summary

This PRs:

  • swaps checkbox and row selection
  • removes vertical borders
  • adds rows highlight
  • increases cell padding
  • adds row stripes
  • updates header background
  • removes grey background from field name and makes it bolder (part of [UnifiedDataTable] Redesign Document column #164634)

Before:
Screenshot 2023-08-17 at 16 46 51

After:
Screenshot 2023-09-05 at 15 46 31

@jughosta jughosta added release_note:enhancement Feature:Discover Discover Application backport:skip This commit does not require backporting Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. labels Aug 17, 2023
@jughosta jughosta self-assigned this Aug 17, 2023
@jughosta jughosta marked this pull request as ready for review August 17, 2023 19:48
@jughosta jughosta requested review from a team as code owners August 17, 2023 19:48
@elasticmachine
Copy link
Contributor

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

@kertal kertal changed the title [Discover] Update grid styles [Discover] Update data table grid styles Aug 21, 2023
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 putting this together, @jughosta! Looks great. Sending some initial questions/comments for your initial review below. Also CCing @andreadelrio, in case she has additional input.

fontSize: 's',
cellPadding: 's',
rowHover: 'none',
cellPadding: 'm',
Copy link
Contributor

Choose a reason for hiding this comment

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

If the intent here is to begin adopting some aspects of the newly proposed Discover design refresh, this padding will need to be increased to match the designs.

Suggested change
cellPadding: 'm',
cellPadding: 'l',

@@ -11,10 +11,10 @@ import { EuiDataGridStyle } from '@elastic/eui';
// data types
export const kibanaJSON = 'kibana-json';
export const GRID_STYLE = {
border: 'all',
border: 'horizontal',
Copy link
Contributor

Choose a reason for hiding this comment

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

We may want to hold off on removal of vertical borders until we add the proposed column highlighting, as it helps to indicate to users where the column boundaries are located when vertical borders are absent. Thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we should hold off on this change until column highlighting is available. Padding included in the cells should produce enough space between columns for users to tell when a column begins and ends. See:
image

Also, note that the column highlighting is not currently considered part of the MVP we're aiming for.

Copy link
Member

Choose a reason for hiding this comment

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

Agreed we don't need to wait, IMO it's already looking nice 👍

cellPadding: 's',
rowHover: 'none',
cellPadding: 'm',
rowHover: 'highlight',
Copy link
Contributor

Choose a reason for hiding this comment

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

Similarly, we may want to wait to enable row highlighting until we alter the contents of the "Document" column to no longer use the EUI description list component styling. I say this because field names within the "Document" column to appear in a gray badge that is very difficult to see when combined with the new highlight (but will be addressed when we switch to bolding the field names and prepending them with field type tokens). Thoughts?

Copy link
Contributor

@andreadelrio andreadelrio Aug 22, 2023

Choose a reason for hiding this comment

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

I agree. @kertal do we have an issue tracking that? I couldn't find one and #164287 doesn't cover it, maybe we should update it to include:

  • Remove grey background from EuiDescriptionList's title in table and make it bolder.

Copy link
Member

Choose a reason for hiding this comment

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

working on an issue for that

Copy link
Member

Choose a reason for hiding this comment

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

@MichaelMarcialis here's the issue #164634

Comment on lines 36 to 39
.euiDataGrid__controls {
border: none;
border-bottom: $euiBorderThin;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Assuming we do proceed with using the border="horizontal" prop for the data grid now, I believe you can actually get rid of these styles entirely (as the data grid is already styled this way with that prop configuration).

Suggested change
.euiDataGrid__controls {
border: none;
border-bottom: $euiBorderThin;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed via de53757

Comment on lines 49 to 52
.dscDiscoverGrid__table .euiDataGridRowCell:first-of-type {
border-left: none;
border-right: none;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Out of curiosity, is this styling necessary? If it's to prevent the checkbox from being cut-off by 2px, would it be better to just change the width of the column to account for the additional 2px of transparent border, rather than overriding EUI styles? Or are the transparent borders an EUI bug that needs to be addressed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the idea, @MichaelMarcialis!
Updated via de53757

@jughosta jughosta marked this pull request as draft September 4, 2023 13:20
@jughosta jughosta marked this pull request as ready for review September 4, 2023 15:58
Copy link
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.

Looking pretty 👍 and works as expected.
2 things

  • @andreadelrio suggested for now to keep the order of checkbox and expand icon last week
  • I think we need a line on top of the grid when being displayed on a dashboard?
Dashboards_-_Elastic

@jughosta
Copy link
Contributor Author

jughosta commented Sep 5, 2023

@kertal

@andreadelrio suggested for now to keep the order of checkbox and expand icon last week

Swapped the buttons back:
Screenshot 2023-09-05 at 15 46 31

@jughosta
Copy link
Contributor Author

jughosta commented Sep 5, 2023

@kertal

I think we need a line on top of the grid when being displayed on a dashboard?

Added top border and also adjusted side paddings on Surrounding Documents page.

Screenshot 2023-09-05 at 16 23 17 Screenshot 2023-09-05 at 16 24 38

@andreadelrio
Copy link
Contributor

andreadelrio commented Sep 6, 2023

@jughosta Looking very nice! As part of this PR, I would also like to see the background of rows for the tabs for Documents | Field Statistics removed (given the agreement in today's team sync to keep those tabs for now).

@andreadelrio
Copy link
Contributor

@jughosta Looking very nice! As part of this PR, I would also like to see the background of rows for the tabs for Documents | Field Statistics removed (given the agreement in today's team sync to keep those tabs for now).

@jughosta you can disregard the above as I've seen you already have it as part of #165687

@kibana-ci
Copy link
Collaborator

kibana-ci commented Sep 6, 2023

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] Serverless Security Cypress Tests #8 / Add endpoint exception from rule details edits an endpoint exception item edits an endpoint exception item
  • [job] [logs] Serverless Security Explore Cypress Tests #1 / Enable risk scores "before all" hook for "shows enable host risk button" "before all" hook for "shows enable host risk button"
  • [job] [logs] Serverless Observability Examples Tests / serverless examples UI Unified Field List Examples Field stats field distribution "before all" hook for "should return an auto histogram for numbers and top values"
  • [job] [logs] Serverless Observability Tests / serverless observability UI Configure Closure options change closure option successfully

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 550.3KB 550.8KB +451.0B

History

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

cc @jughosta

@kertal kertal self-requested a review September 6, 2023 10:33
Copy link
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.

Code + Rendering LGTM. Pretty it is already, and more prettier it will be soon 🪞 . Tested locally and worked as expected. ✅

@jughosta
Copy link
Contributor Author

jughosta commented Sep 6, 2023

Closing in favour of a single PR with all redesign changes #165866

@jughosta jughosta closed this Sep 6, 2023
jughosta added a commit that referenced this pull request Sep 12, 2023
## Summary

### Part 1

- Resolves #164287
- Closes #146339
- Previously separate PR #164187

Changes:
- ~~swaps checkbox and row selection~~
- removes vertical borders
- adds rows highlight
- increases cell padding
- adds row stripes
- updates header background
- removes grey background from field name and makes it bolder (part of
#164634)
- updates Surrounding Documents side paddings

### Part 2

- Resolves #164661
- Previously separate PR #165687

Changes:
- removes background from panels, tabs and sidebar
- updates "Add a field" button style
- removes shadow from field list items
- makes field search compact

### Part 3

- Resolves #164662

Changes:
- wraps "Add a field" button in its own container with a top border
- ~~adds a drag handle to sidebar items~~
- ~~adds new Show/Hide buttons to toggle sidebar~~ moves sidebar toggle
button from discover plugin to unified field list
- reduces spaces between sidebar items from 4px to 2px
- reduces padding on Single Document page
- removes border above grid tabs

<img width="600" alt="Screenshot 2023-09-07 at 14 39 48"
src="https://github.com/elastic/kibana/assets/1415710/976db247-fd70-4c9b-8634-552ece45b522">


Please note that "auto" row height is in a separate PR which is also
ready for review #164218

---------

Co-authored-by: kibanamachine <[email protected]>
Co-authored-by: Davis McPhee <[email protected]>
Co-authored-by: Davis McPhee <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Discover Discover Application release_note:enhancement Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Discover] Update data table styles
6 participants