Skip to content
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] Add scroll margin to panels #193430

Merged
merged 15 commits into from
Oct 7, 2024
3 changes: 1 addition & 2 deletions src/plugins/dashboard/public/dashboard_api/track_panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ export function initializeTrackPanel(untilEmbeddableLoaded: (id: string) => Prom
};
return;
}

panelRef.scrollIntoView({ block: 'center' });
panelRef.scrollIntoView({ block: 'nearest' });
});
},
scrollToTop: () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
* .embPanel--editing doesn't get updating without a hard refresh
*/

.dshDashboardGrid__item {
scroll-margin-top: calc((var(--euiFixedHeadersOffset, 100) * 2) + $euiSizeS);
scroll-margin-bottom: $euiSizeS;
}
rshen91 marked this conversation as resolved.
Show resolved Hide resolved

// LAYOUT MODES
// Adjust borders/etc... for non-spaced out and expanded panels
.dshLayout-withoutMargins {
Expand Down Expand Up @@ -36,9 +41,11 @@
0% {
outline: solid $euiSizeXS transparentize($euiColorSuccess, 1);
}

25% {
outline: solid $euiSizeXS transparentize($euiColorSuccess, .5);
}

100% {
outline: solid $euiSizeXS transparentize($euiColorSuccess, 1);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const Item = React.forwardRef<HTMLDivElement, Props>(
const hidePanel = expandedPanelId !== undefined && expandedPanelId !== id;
const focusPanel = focusedPanelId !== undefined && focusedPanelId === id;
const blurPanel = focusedPanelId !== undefined && focusedPanelId !== id;
const classes = classNames({
const classes = classNames('dshDashboardGrid__item', {
'dshDashboardGrid__item--expanded': expandPanel,
'dshDashboardGrid__item--hidden': hidePanel,
'dshDashboardGrid__item--focused': focusPanel,
Expand Down