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] Remove borders from presentation panel and CSS clean up for hover actions #198454

Merged
merged 25 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
3ba63da
Fix border styles in dashboard
cqliu1 Oct 30, 2024
a22965f
Move border styles into presentation panel
cqliu1 Nov 1, 2024
4f0b522
Delete unused CSS
cqliu1 Nov 1, 2024
c72ef4c
More cleanup
cqliu1 Nov 1, 2024
f5f6fbe
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Nov 1, 2024
ac03c42
Remove conflicting styles in solutions
cqliu1 Nov 1, 2024
f4ae6de
Fix emotion
cqliu1 Nov 4, 2024
ed0b4fc
Merge branch 'main' of https://github.com/elastic/kibana into dashboa…
cqliu1 Nov 4, 2024
9420aea
Fix hover actions check
cqliu1 Nov 5, 2024
db2e564
Only show panel border on hover if hover actions are available
cqliu1 Nov 5, 2024
d89fdde
Merge branch 'main' of https://github.com/elastic/kibana into dashboa…
cqliu1 Nov 5, 2024
0146c38
Add comments
cqliu1 Nov 5, 2024
ff5237d
Fix z-index on hover actions hover
cqliu1 Nov 7, 2024
3c57f94
Fix hover actions getting cut off
cqliu1 Nov 7, 2024
5360032
Fix outlines on hover with margins on and off
cqliu1 Nov 7, 2024
32d978b
Move hover actions styles to emotion
cqliu1 Nov 7, 2024
945ccd5
Remove unused imports
cqliu1 Nov 7, 2024
57399c7
Merge branch 'main' of https://github.com/elastic/kibana into dashboa…
cqliu1 Nov 7, 2024
1b38329
Update presentation_panel_hover_actions.tsx
cqliu1 Nov 7, 2024
e75da38
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Nov 8, 2024
ed9869c
Fix whitespace
cqliu1 Nov 11, 2024
acff0b1
Merge branch 'main' of https://github.com/elastic/kibana into dashboa…
cqliu1 Nov 11, 2024
4b5535a
Change hover border selectors
cqliu1 Nov 11, 2024
397b828
Merge branch 'main' of https://github.com/elastic/kibana into dashboa…
cqliu1 Nov 11, 2024
bff6474
Merge branch 'main' into dashboard/hover-actions-style-cleanup
cqliu1 Nov 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,12 @@
z-index: $euiZLevel9;
top: -$euiSizeXL;

// Show hover actions with drag handle
.embPanel__hoverActions:has(.embPanel--dragHandle) {
opacity: 1;
}

// Hide hover actions without drag handle
.embPanel__hoverActions:not(:has(.embPanel--dragHandle)) {
opacity: 0;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,44 +1,11 @@
/**
* EDITING MODE
* Use .dshLayout--editing to target editing state because
* .embPanel--editing doesn't get updating without a hard refresh
*/

.dshLayout--editing {
// change the style of the hover actions border to a dashed line in edit mode
.embPanel__hoverActionsAnchor {
.embPanel__hoverActionsWrapper {
.embPanel__hoverActions {
border-color: $euiColorMediumShade;
border-style: dashed;
}
}
}
}

// LAYOUT MODES
// Adjust borders/etc... for non-spaced out and expanded panels
.dshLayout-withoutMargins {
.embPanel,
.embPanel__hoverActionsAnchor {
box-shadow: none;
outline: none;
border-radius: 0;
}

&.dshLayout--editing {
.embPanel__hoverActionsAnchor:hover {
outline: 1px dashed $euiColorMediumShade;
}
}

.embPanel__hoverActionsAnchor:hover {
outline: $euiBorderThin;
z-index: $euiZLevel2;
}
margin-top: $euiSizeS;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is adds space between controls and the dashboard grid when margins are off.


.embPanel__content,
.dshDashboardGrid__item--highlighted,
.embPanel,
.embPanel__hoverActionsAnchor,
.lnsExpressionRenderer {
border-radius: 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ Default.args = {
hideHeader: false,
loading: false,
showShadow: false,
showBorder: true,
showBorder: false,
Heenawter marked this conversation as resolved.
Show resolved Hide resolved
title: 'Hello World',
viewMode: true,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export const getLensAttributes = (group: EventAnnotationGroupConfig, timeField:
language: 'kuery',
},
filters: [],
showBorder: false,
datasourceStates: {
formBased: {
layers: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
height: 100%;
min-height: $euiSizeL + 2px; // + 2px to account for border
position: relative;
border: none;
outline: $euiBorderThin;

&-isLoading {
// completely center the loading indicator
Expand Down Expand Up @@ -105,47 +103,9 @@
}
}

// OPTIONS MENU

/**
* 1. Use opacity to make this element accessible to screen readers and keyboard.
* 2. Show on focus to enable keyboard accessibility.
* 3. Always show in editing mode
*/

.embPanel__optionsMenuButton {
background-color: transparentize($euiColorLightShade, .5);
border-bottom-right-radius: 0;
border-top-left-radius: 0;

&:focus {
background-color: transparentize($euiColorLightestShade, .5);
}
}

.embPanel__optionsMenuPopover-loading {
width: $euiSizeS * 32;
}

.embPanel__optionsMenuPopover-notification::after {
position: absolute;
top: 0;
right: 0;
content: '•';
transform: translate(50%, -50%);
color: $euiColorAccent;
font-size: $euiSizeL;
}

// EDITING MODE

.embPanel--editing {
transition: all $euiAnimSpeedFast $euiAnimSlightResistance;
outline: 1px dashed $euiColorMediumShade;

.embPanel--dragHandle {
transition: background-color $euiAnimSpeedFast $euiAnimSlightResistance;

.embPanel--dragHandle:hover {
background-color: transparentize($euiColorWarning, lightOrDarkTheme(.9, .7));
cursor: move;
Expand All @@ -170,56 +130,14 @@
z-index: $euiZLevel1;
}

.embPanel__hoverActionsAnchor {
position: relative;
height: 100%;

.embPanel__hoverActionsWrapper {
height: $euiSizeXL;
position: absolute;
top: 0;
display: flex;
justify-content: space-between;
padding: 0 $euiSize;
flex-wrap: nowrap;
min-width: 100%;
z-index: -1;
pointer-events: none; // Prevent hover actions wrapper from blocking interactions with other panels
}

.embPanel__hoverActions {
opacity: 0;
padding: calc($euiSizeXS - 1px);
display: flex;
flex-wrap: nowrap;
border: $euiBorderThin;

background-color: $euiColorEmptyShade;
height: $euiSizeXL;

pointer-events: all; // Re-enable pointer-events for hover actions
}

.embPanel--dragHandle {
cursor: move;
.embPanel--dragHandle {
cursor: move;

img {
pointer-events: all !important;
}
img {
pointer-events: all !important;
}
}

.embPanel__descriptionTooltipAnchor {
padding: $euiSizeXS;
}

&:hover .embPanel__hoverActionsWrapper,
&:focus-within .embPanel__hoverActionsWrapper,
.embPanel__hoverActionsWrapper--lockHoverActions {
z-index: $euiZLevel9;
top: -$euiSizeXL;

.embPanel__hoverActions {
opacity: 1;
}
}
}
.embPanel__descriptionTooltipAnchor {
padding: $euiSizeXS;
}
Loading