-
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
[Dashboard Usability] Moves scrollbar to panel section #145628
Changes from 58 commits
00fdc98
83fd7ad
b96acc0
d52a748
e6e12f5
d9a6083
c766516
94fb0a8
a7be283
550c9e2
6db3151
96878e9
8e52180
a29b956
5ae15c7
0c56299
0c67558
7657bb4
0c2fe97
de92647
0c95ec0
f4e21af
27677e4
7296356
99a7bf0
87c9860
108a30b
9ef7013
9b9107a
69c3bb2
460fbd7
05bf2cf
c4f813f
5133101
f9d3547
7b52925
e549031
6f0201a
95f8993
3654233
5389c4f
5d61a4e
160fe90
e3b7c1a
aa91500
6d7683f
b8c0d93
2ccc09c
a62db98
acbf6c0
098fa6e
f5d9185
dbc5024
87a9a80
c19bf2f
84495f3
5914895
2b3414f
2bcc0ce
f1ad633
011e2fe
ab51a19
06f05ee
8e714c1
ee7ffa4
4d797ef
1219623
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,10 +10,11 @@ import './_dashboard_container.scss'; | |
|
||
import { v4 as uuidv4 } from 'uuid'; | ||
import classNames from 'classnames'; | ||
import { EuiLoadingElastic, EuiLoadingSpinner } from '@elastic/eui'; | ||
import React, { useEffect, useMemo, useRef, useState } from 'react'; | ||
|
||
import useObservable from 'react-use/lib/useObservable'; | ||
|
||
import { EuiLoadingElastic, EuiLoadingSpinner, useEuiOverflowScroll } from '@elastic/eui'; | ||
import { css } from '@emotion/react'; | ||
import { useReduxEmbeddableContext } from '@kbn/presentation-util-plugin/public'; | ||
|
||
import { | ||
|
@@ -110,13 +111,20 @@ export const DashboardContainerRenderer = ({ | |
{ 'dashboardViewport--screenshotMode': isScreenshotMode() }, | ||
{ 'dashboardViewport--loading': loading } | ||
); | ||
|
||
const viewportStyles = css` | ||
${useEuiOverflowScroll('y', true)} | ||
`; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Is adding padding the best solution here? Ideally we wouldn't want to change the look of the dashboard like that. Plus, the gutter created by the tops of the Controls is roughly the same as the gutter between the elements of the Unified Search bar. @andreadelrio, thoughts on this? Maybe there's some way to remove the fade There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can just remove the blur by not passing I think adding 4px top padding to the controls is sufficient to offset the blur, but if we don't want the additional height added, I can remove the blur. Here are some screenshots to compare: Extra top paddingwithout adding top paddingwith 4px top paddingBlur vs no blurwith blur, scroll midway down the dashboardno blur, scroll midway down the dashboardThere was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Crazy idea, but could we add a scroll listener that removes the blur only when at the top? Similar to the scroll listener that was added for options list suggestions. Might be overkill though 🤷 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Padding the top and bottom is recommended by EUI. But we could also just remove the mask as Catherine suggested. I don't feel strongly either way. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that the border doesn't work too well when the page is at the top. In view mode, the border when the page is at the top makes the Controls look very separate from the filter context, which I suppose is somewhat true. In edit mode, having two borders like that in quick succession is also strange, maybe we leave the border in place, but we don't put the border under the unified search bar in edit mode, and only show the one under the editor? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ThomThomson you mean like this with only the bottom bar? @MichaelMarcialis What do you think? only bottom borderborders between every barThere was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I would say that looks better. The whole pinned section gets one border at the bottom! What do you think? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. I like @ThomThomson's suggestion here for the single border in edit mode. Looks like you've already implemented it, so thumbs up from me! |
||
|
||
const loadingSpinner = showPlainSpinner ? ( | ||
<EuiLoadingSpinner size="xxl" /> | ||
) : ( | ||
<EuiLoadingElastic size="xxl" /> | ||
); | ||
return ( | ||
<div className={viewportClasses}>{loading ? loadingSpinner : <div ref={dashboardRoot} />}</div> | ||
<div className={viewportClasses} css={viewportStyles}> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if related to this change. But the open context menu on panels does not scroll with the dashboard anymore. Adding There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
{loading ? loadingSpinner : <div ref={dashboardRoot} />} | ||
</div> | ||
); | ||
}; | ||
|
||
|
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.
Excluding the
kibanaFullBodyHeight
mixin from thes
breakpoint appears to be causing dueling scrollbars to appear at small viewport sizes. Fixed in f1ad633.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.
Oh nice catch! I added a
xs
too because I was still seeing the dual scrollbar when I shrank the viewport width even more.