-
Notifications
You must be signed in to change notification settings - Fork 920
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 page collapsible panels #5635
Discover page collapsible panels #5635
Conversation
Looks good |
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.
@Ganesh0107 Thanks for the PR! I have tested the change locally and I have a few comments on the PR:
- The DCO check has failed. The project needs never commit in the PR to be signed off using git's signoff feature
-s
. Can you check the details for the DCO workflow failure for step on how to remedy it? - The EUI Resize component's children are rerndered every time a resize event happens. This causes performance issues. Can you memoize its children to prevent this. Here is how another application that uses the same component does it: https://github.com/opensearch-project/OpenSearch-Dashboards/blob/main/src/plugins/vis_builder/public/application/components/workspace.tsx#L157-L159. This is not a blocker but will really improve the change :)
<EuiResizableContainer> | ||
{(EuiResizablePanel, EuiResizableButton) => ( | ||
<> | ||
<EuiResizablePanel initialSize={140} minSize="10%" mode="collapsible"> |
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.
<EuiResizablePanel initialSize={140} minSize="10%" mode="collapsible"> | |
<EuiResizablePanel initialSize={140} minSize="10%" mode="collapsible" paddingSize="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.
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.
Thats fine for now. I'd leave minor modifications to spacing and padding to a full UX review since they have to match other experiences too.
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, I'm fine with 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.
Updated style={{ paddingRight: 8 }}
</EuiResizablePanel> | ||
<EuiResizableButton /> | ||
|
||
<EuiResizablePanel initialSize={1140} minSize="65%" mode="main"> |
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.
<EuiResizablePanel initialSize={1140} minSize="65%" mode="main"> | |
<EuiResizablePanel initialSize={1140} minSize="65%" mode="main" paddingSize="none"> |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #5635 +/- ##
==========================================
+ Coverage 67.01% 67.03% +0.02%
==========================================
Files 3296 3296
Lines 63370 63349 -21
Branches 10093 10089 -4
==========================================
+ Hits 42465 42468 +3
+ Misses 18456 18431 -25
- Partials 2449 2450 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
<EuiResizableContainer> | ||
{(EuiResizablePanel, EuiResizableButton) => ( | ||
<> | ||
<EuiResizablePanel initialSize={140} minSize="10%" mode="collapsible"> |
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.
initialSize
is number in percent according to OUI documentation, could you check if initialSize={140}
and initialSize={1140}
are correctly used?
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 @ruanyl , Updated the initial size with percent according to OUI documentation.
<EuiResizableContainer> | ||
{(EuiResizablePanel, EuiResizableButton) => ( | ||
<> | ||
<EuiResizablePanel initialSize={140} minSize="10%" mode="collapsible"> |
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.
min-width: 400px; | ||
max-width: 620px; | ||
min-width: 180px; | ||
top: 0; |
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 top: 0
seems not necessary
Thanks for the improvement! Could you also add an entry about this change to |
Signed-off-by: Ganesh0107 <ganesh.gopal@freshworks.com>
Signed-off-by: Ganesh0107 <ganesh.gopal@freshworks.com>
Signed-off-by: Ganesh0107 <ganesh.gopal@freshworks.com>
169db75
to
a071290
Compare
@Ganesh0107 will you able to make the changes suggested in the review? We are currently tracking this issue for the 2.12 release, so let me know if I can help in any way here :) |
@ashwin-pc I have made the changes and testing them locally, will commit the changes soon |
Signed-off-by: Ganesh0107 <ganesh.gopal@freshworks.com>
Signed-off-by: Ganesh0107 <ganesh.gopal@freshworks.com>
max-width: 620px; | ||
min-width: 180px; |
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 am not a fan of these. Wouldn't they limit how far I can narrow or expand the panels? Wouldn't having a min
prevent me from totally collapsing the left-bar if i desired?
Also, shouldn't these be unnecessary, even unwanted, inside a resizable-container?
I am having trouble seeing the need for these boundaries.
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 any way have buttons for collapse and expand, this will not prevent from completely closing it
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.
onClick of the button , the side bar will be collapsed.
screen-recording-2024-01-12-at-122141-am_kPc2t5La.mp4
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.
Can we eliminate these two styles. They dont seem necessary anymore
@Ganesh0107 Looks like your latest change has neither the |
Signed-off-by: Ganesh0107 <ganesh.gopal@freshworks.com>
@ashwin-pc Apologies for the oversight. I've pushed the latest changes, including the missing CSS adjustment. Please review the updated code, and let me know if there are any further adjustments needed. |
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 changes @Ganesh0107. I pulled down the changes and have a few more minor changes that are needed. The biggest one being that this layout has to render correctly in mobile too. Ive added all my suggestions inline so that its easy but once those are made the PR should be good to go :)
initialSize={25} | ||
minSize="10%" | ||
mode="collapsible" | ||
style={{ paddingRight: 8 }} |
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.
style={{ paddingRight: 8 }} | |
style={isMobile ? { paddingBottom: 8 } : { paddingRight: 8 }} | |
paddingSize="none" |
</EuiResizablePanel> | ||
<EuiResizableButton /> | ||
|
||
<EuiResizablePanel initialSize={75} minSize="65%" mode="main"> |
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.
<EuiResizablePanel initialSize={75} minSize="65%" mode="main"> | |
<EuiResizablePanel initialSize={75} minSize="65%" mode="main" paddingSize="none"> |
max-width: 620px; | ||
min-width: 180px; |
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.
Can we eliminate these two styles. They dont seem necessary anymore
<EuiPageBody className="deLayout__canvas"> | ||
<Canvas {...params} /> | ||
</EuiPageBody> | ||
<EuiResizableContainer> |
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.
<EuiResizableContainer> | |
<EuiResizableContainer direction={isMobile ? 'vertical' : 'horizontal'}> |
And you can get the value of isMobile as follows:
import { ..., useIsWithinBreakpoints } from '@elastic/eui';
// ...
const isMobile = useIsWithinBreakpoints(['xs', 's', 'm']);
<> | ||
<EuiResizablePanel | ||
initialSize={25} | ||
minSize="10%" |
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.
minSize="10%" | |
minSize="260px" |
Signed-off-by: Ganesh0107 <ganesh.gopal@freshworks.com>
Signed-off-by: Ganesh0107 <ganesh.gopal@freshworks.com>
@ashwin-pc Updated the suggested changes, currently adding test cases. PR will be ready for review shortly. Let me know if further adjustments are required. Thanks! |
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.
Looks like you missed on of my suggestions. The rest looks good :)
Signed-off-by: Ganesh0107 <ganesh.gopal@freshworks.com>
Co-authored-by: Ashwin P Chandran <ashwinpc1993@gmail.com> Signed-off-by: Ganesh0107 <ganesh.gopal@freshworks.com>
Signed-off-by: Ganesh0107 <ganesh.gopal@freshworks.com>
@ashwin-pc Thanks for letting me know. I've made the necessary changes |
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.
@Ganesh0107 thanks for making the changes, the PR looks good. Sorry but i noticed one other change thats needed. The Changelog entry you have made is for the 1.x releases. Since this change has not been released yet, it should go to the unreleased section of the file, which is in and around line 30
Signed-off-by: Ganesh0107 <ganesh.gopal@freshworks.com>
This reverts commit 34a1b12.
Signed-off-by: Ganesh0107 <ganesh.gopal@freshworks.com>
@Ganesh0107 thanks for the PR. I have incorporated your changes in #5789 and will credit you for your contribution on that PR instead of this one since I had to make changes on top of yours for another feature. Closing this PR for now since the changes have already been incorporated elsewhere. |
Description
This PR resolves Discover 2.0's missing left sidebar expand/collapse features by integrating OUI's resizable container
Issues Resolved
Closes #4780 [Data Explorer] Left side bar can not be expanded and collapsed
Screenshot
Screen.Recording.2023-12-22.at.12.54.52.AM.mov
Check List
yarn test:jest
yarn test:jest_integration