-
Notifications
You must be signed in to change notification settings - Fork 843
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
[EuiDataGrid] Add rowHeightSwitcher logic + API change #5372
Merged
cee-chen
merged 31 commits into
elastic:feat/datagrid/toolbar-reorg-and-row-height-switcher
from
cee-chen:datagrid-row-height-control
Nov 24, 2021
Merged
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
916c1c7
Rename styleSelector to displaySelector + update types & docs
cee-chen 79c878d
Refactor out nested object helper
cee-chen 58fe94f
Update displaySelector with conditional density/row height options
cee-chen 37aecd6
Add rowHeightsOptions controls to popover
cee-chen 129b2bb
Add conditional lineCount row and logic
cee-chen 742051d
Fix styles not applying correctly for rowHeightsOptions that have und…
cee-chen be59b08
Fix multiline content not top-aligning correctly when in single/undef…
cee-chen 75e933a
Fix single/undefined row heights to account for passed lineHeight API…
cee-chen 39aa176
Add changelog entry
cee-chen 8580dc8
[PR feedback] Increase default lineCount to 2
cee-chen 0a4eae8
Merge branch 'feat/datagrid/toolbar-reorg-and-row-height-switcher' in…
cee-chen 7e34537
Fix changelog
cee-chen d31a66d
Fix control column appearance by switching them back to vertical cent…
cee-chen 670dc2c
Tweak various height alignments on compressed grid settings
cee-chen c3f237d
Fix expand action button background color mismatch for auto/lineCount…
cee-chen 4dac79e
PR feedback: convert cell actions CSS selectors to mixin
cee-chen cb51f97
Fix sasslint issues
cee-chen b70aa3d
PR feedback: Change line count number to EuiRange
cee-chen 52d70e3
PR feedback - remove height tweaks for compressed auto fit
cee-chen 3891366
[PR feedback] Remove `showStyleSelector`
cee-chen cab4a06
Remove unused unit tests
cee-chen 571be25
[PR feedback] Intelligently disable toolbar control if all nested opt…
cee-chen 9348b1d
Merge branch 'feat/datagrid/toolbar-reorg-and-row-height-switcher' in…
cee-chen 3dd2d3f
Do not fall back to undefined/single for static heights
cee-chen 0ab5aac
PR changelog feedback
constancecchen f226ad7
Update grid density to also intelligently detect initial state
cee-chen be0db10
Merge branch 'feat/datagrid/toolbar-reorg-and-row-height-switcher' in…
cee-chen fc9f65c
[PR feedback] Improve typing to avoid any usage
cee-chen 4250a73
[PR feedback] Document recommendation for disabling row height switch…
cee-chen fc4105c
[Pr feedback] Simplify getNestedObjectOptions
cee-chen 0b9ca21
Add workaround for failing Cypress tests
cee-chen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This fix/workaround essentially has the single/undefined row heights act as
lineCount
of1
, which allows single rows to take advantage oflineCount
's ability to get cell heights/font sizes/line heights and dynamically respond to density changes.Before:
The non-dynamic height changing is even more noticeable now that single row heights are no longer center aligned (per previous commit/fix) and now that you can compare
lineCount
directly againstundefined
, which does correctly reset the minimum row height based on density.After:
I initially played with an approach that used a static
minRowHeight
map depending on density and exporting that from the display selector - but I think this approach is much simpler/better because it's using the logic we already have, and also accounts for row/line height differences between the legacy theme and Amsterdam theme.This also fixes an issue that occurs when switching from
lineCount
toundefined
heights - theundefined
heights' minRowHeight was not being correctly reset, so this approach basically kills two birds with one stone.