-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Conversation
Pinging @elastic/kibana-data-discovery (Team:DataDiscovery) |
There was a problem hiding this 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', |
There was a problem hiding this comment.
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.
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', |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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:
Also, note that the column highlighting is not currently considered part of the MVP we're aiming for.
There was a problem hiding this comment.
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', |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
.euiDataGrid__controls { | ||
border: none; | ||
border-bottom: $euiBorderThin; | ||
} |
There was a problem hiding this comment.
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).
.euiDataGrid__controls { | |
border: none; | |
border-bottom: $euiBorderThin; | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed via de53757
.dscDiscoverGrid__table .euiDataGridRowCell:first-of-type { | ||
border-left: none; | ||
border-right: none; | ||
} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
# Conflicts: # packages/kbn-unified-data-table/src/components/data_table.scss # packages/kbn-unified-data-table/src/constants.ts
There was a problem hiding this 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?
|
@jughosta Looking very nice! As part of this PR, I would also like to see the background of rows for the tabs for |
@jughosta you can disregard the above as I've seen you already have it as part of #165687 |
💔 Build FailedFailed CI Steps
Test Failures
Metrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: cc @jughosta |
There was a problem hiding this 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. ✅
Closing in favour of a single PR with all redesign changes #165866 |
## 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]>
Summary
This PRs:
swaps checkbox and row selectionBefore:
After: