-
Notifications
You must be signed in to change notification settings - Fork 14.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
feat(dashboard): Make FilterBar width resizable #20778
feat(dashboard): Make FilterBar width resizable #20778
Conversation
/testenv up |
@ktmud Container image not yet published for this PR. Please try again when build is complete. |
@ktmud Ephemeral environment creation failed. Please check the Actions logs for details. |
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.
LGTM if CI passes. Thanks for the comprehensive tests.
@@ -37,6 +37,7 @@ export const PLACEHOLDER_DATASOURCE: Datasource = { | |||
export const MAIN_HEADER_HEIGHT = 53; | |||
export const CLOSED_FILTER_BAR_WIDTH = 32; | |||
export const OPEN_FILTER_BAR_WIDTH = 260; |
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.
Maybe rename this to OPEN_FILTER_BAR_DEFAULT_WIDTH
?
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 kept this variable because some custom override might be impacted.
@@ -85,6 +86,7 @@ const ActionButtonsContainer = styled.div` | |||
`; | |||
|
|||
export const ActionButtons = ({ | |||
width, |
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.
width, | |
width = OPEN_FILTER_BAR_WIDTH |
Nit: let's assign a default value as soon as possible
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.
sounds good
@@ -103,7 +105,7 @@ export const ActionButtons = ({ | |||
); | |||
|
|||
return ( | |||
<ActionButtonsContainer> | |||
<ActionButtonsContainer data-test="filterbar-action-buttons" width={width || OPEN_FILTER_BAR_WIDTH}> |
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.
<ActionButtonsContainer data-test="filterbar-action-buttons" width={width || OPEN_FILTER_BAR_WIDTH}> | |
<ActionButtonsContainer data-test="filterbar-action-buttons" width={width}> |
No need for ||
if default value is assigned.
Codecov Report
@@ Coverage Diff @@
## master #20778 +/- ##
=======================================
Coverage 66.28% 66.29%
=======================================
Files 1756 1757 +1
Lines 66756 66775 +19
Branches 7049 7052 +3
=======================================
+ Hits 44252 44266 +14
- Misses 20708 20710 +2
- Partials 1796 1799 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
|
* Add Resizable panel in DashboardBuilder to adjust the width for FiltersPanel * store the adjusted width for individual dashboard in localStorage to memorize the state * migrate DashboardBuilder test code by testing-library and jest
b402ec3
to
0c55015
Compare
SUMMARY
The current native filterbar section is fixed size.
Since the filter is not wide enough for moderately wide data to be seen, some filter value with the long overlapped prefix string such like the following case truncated with the repeated strings.
There is an HTML tooltip that appear on mouseover but it's slow and bad user experience.
The dropdown needs to be widened over the sidebar but the dropdown also truncated under the sidebar to fix the #19399
Therefore, this commit makes the sidebar resizable to be widened itself.
This commit adds the Resizable panel for native filterbar to adjust the width wider to help this inconvenient case.
It also stores the adjusted width for individual dashboard in localStorage to memorize the state.
Addition to the feature, this commit also migrates DashboardBuilder test code to testing-library, jest and typescript to enable emotion test helpers.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before:
resizaable-filterbar--before.mov
After:
resizable-filterbar--after.mov
TESTING IN
STRUCTIONS
ADDITIONAL INFORMATION