Skip to content

Commit d18acb8

Browse files
semdwildemat
authored andcommitted
[One Workflow] UI/UX Design Alignment - Historical (elastic#241978)
## Summary issue: elastic/security-team#14392 White background in the editor when we are in _Executions_ tab. <img width="987" height="346" alt="Captura de pantalla 2025-11-05 a les 14 28 22" src="https://github.com/user-attachments/assets/f9f3e616-0425-4828-a02b-68a568f36727" /> Fixed execution history item clickable area: <img width="502" height="346" alt="Captura de pantalla 2025-11-05 a les 14 30 35" src="https://github.com/user-attachments/assets/3da3ea01-c273-4378-9a2b-157e0299bfd5" />
1 parent e2a140e commit d18acb8

5 files changed

Lines changed: 44 additions & 40 deletions

File tree

src/platform/plugins/shared/workflows_management/public/features/workflow_execution_list/ui/workflow_execution_list_item.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,12 @@ export const WorkflowExecutionListItem = React.memo<WorkflowExecutionListItemPro
6666
}, [selected, onClick, styles]);
6767

6868
return (
69-
<EuiPanel color="plain" hasShadow={false} paddingSize="m" hasBorder css={panelCss}>
69+
<EuiPanel onClick={onClick} hasShadow={false} paddingSize="m" hasBorder css={panelCss}>
7070
<EuiFlexGroup
7171
gutterSize="m"
7272
alignItems="center"
7373
justifyContent="flexStart"
74-
onClick={onClick ?? undefined}
7574
responsive={false}
76-
color="plain"
7775
>
7876
<EuiFlexItem grow={false}>{getExecutionStatusIcon(euiTheme, status)}</EuiFlexItem>
7977
<EuiFlexItem>
@@ -132,10 +130,11 @@ const componentStyles = {
132130
}),
133131
selectableContainer: ({ euiTheme }: UseEuiTheme) =>
134132
css({
135-
backgroundColor: euiTheme.colors.backgroundBasePlain,
136-
cursor: 'pointer',
137133
'&:hover': {
138134
backgroundColor: euiTheme.colors.backgroundBaseInteractiveHover,
135+
// Prevent hover animation effect from affecting the panel
136+
boxShadow: 'none',
137+
transform: 'none',
139138
},
140139
}),
141140
};

src/platform/plugins/shared/workflows_management/public/shared/ui/json_data_view/json_editor_common.tsx

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,14 @@
77
* License v3.0 only", or the "Server Side Public License, v 1".
88
*/
99

10-
import {
11-
EuiButtonEmpty,
12-
EuiCopy,
13-
EuiFlexGroup,
14-
EuiFlexItem,
15-
type UseEuiTheme,
16-
useEuiTheme,
17-
} from '@elastic/eui';
10+
import { EuiButtonEmpty, EuiCopy, EuiFlexGroup, EuiFlexItem, type UseEuiTheme } from '@elastic/eui';
1811
import { css } from '@emotion/react';
19-
import React, { useEffect } from 'react';
12+
import React from 'react';
2013
import { CodeEditor } from '@kbn/code-editor';
2114
import { useMemoCss } from '@kbn/css-utils/public/use_memo_css';
2215
import { i18n } from '@kbn/i18n';
23-
import { monaco } from '@kbn/monaco';
16+
import type { monaco } from '@kbn/monaco';
17+
import { WORKFLOWS_MONACO_EDITOR_THEME } from '../../../widgets/workflow_yaml_editor/styles/use_workflows_monaco_theme';
2418

2519
const codeEditorAriaLabel = i18n.translate('workflows.jsonDataView.codeEditorAriaLabel', {
2620
defaultMessage: 'Read only JSON view',
@@ -49,18 +43,6 @@ export const JsonCodeEditorCommon = ({
4943
enableFindAction,
5044
}: JsonCodeEditorCommonProps) => {
5145
const styles = useMemoCss(componentStyles);
52-
const { euiTheme } = useEuiTheme();
53-
useEffect(() => {
54-
monaco.editor.defineTheme('workflows-subdued', {
55-
base: 'vs',
56-
inherit: true,
57-
rules: [],
58-
colors: {
59-
'editor.background': euiTheme.colors.backgroundBaseSubdued,
60-
},
61-
});
62-
}, [euiTheme]);
63-
6446
if (jsonValue === '') {
6547
return null;
6648
}
@@ -74,7 +56,8 @@ export const JsonCodeEditorCommon = ({
7456
editorDidMount={onEditorDidMount}
7557
aria-label={codeEditorAriaLabel}
7658
options={{
77-
theme: 'workflows-subdued',
59+
// Limitation: it's not possible to use different themes for different code editors in the same page, so the same theme as the workflow yaml editor is used.
60+
theme: WORKFLOWS_MONACO_EDITOR_THEME,
7861
automaticLayout: true,
7962
fontSize: 12,
8063
// prevent line numbers margin from being too wide

src/platform/plugins/shared/workflows_management/public/widgets/workflow_yaml_editor/styles/use_workflow_editor_styles.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import { transparentize } from '@elastic/eui';
1212
import { css } from '@emotion/react';
1313
import { useMemoCss } from '@kbn/css-utils/public/use_memo_css';
1414

15+
export const EXECUTION_YAML_SNAPSHOT_CLASS = 'execution-yaml-snapshot';
16+
1517
/**
1618
* Hook that provides memoized CSS styles for the workflow YAML editor component
1719
*/
@@ -144,12 +146,17 @@ export const useWorkflowEditorStyles = () => {
144146
},
145147
}),
146148

147-
editorContainer: css({
148-
flex: '1 1 0',
149-
minWidth: 0,
150-
overflowY: 'auto',
151-
minHeight: 0,
152-
}),
149+
editorContainer: ({ euiTheme }: UseEuiTheme) =>
150+
css({
151+
flex: '1 1 0',
152+
minWidth: 0,
153+
overflowY: 'auto',
154+
minHeight: 0,
155+
backgroundColor: euiTheme.colors.backgroundBaseSubdued,
156+
[`&.${EXECUTION_YAML_SNAPSHOT_CLASS}`]: {
157+
backgroundColor: euiTheme.colors.backgroundBasePlain,
158+
},
159+
}),
153160

154161
validationErrorsContainer: css({
155162
flexShrink: 0,

src/platform/plugins/shared/workflows_management/public/widgets/workflow_yaml_editor/styles/use_workflows_monaco_theme.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,18 @@ import { useEffect } from 'react';
1212

1313
import { monaco } from '@kbn/monaco';
1414

15+
export const WORKFLOWS_MONACO_EDITOR_THEME = 'workflows-theme';
16+
1517
export function useWorkflowsMonacoTheme() {
1618
const { euiTheme } = useEuiTheme();
1719
useEffect(() => {
18-
monaco.editor.defineTheme('workflows-subdued', {
20+
monaco.editor.defineTheme(WORKFLOWS_MONACO_EDITOR_THEME, {
1921
base: 'vs',
2022
inherit: true,
2123
rules: [],
2224
colors: {
2325
'list.hoverForeground': euiTheme.colors.textPrimary,
2426
'list.hoverBackground': euiTheme.colors.backgroundBaseInteractiveSelect,
25-
'editor.background': euiTheme.colors.backgroundBaseSubdued,
2627
'editorSuggestWidget.foreground': euiTheme.colors.textParagraph,
2728
'editorSuggestWidget.background': euiTheme.colors.backgroundBasePlain,
2829
'editorSuggestWidget.selectedForeground': euiTheme.colors.textPrimary,
@@ -36,6 +37,10 @@ export function useWorkflowsMonacoTheme() {
3637
'editorLineNumber.activeForeground': euiTheme.colors.textSubdued,
3738
'editorIndentGuide.background1': euiTheme.colors.backgroundLightText,
3839
'editorIndentGuide.activeBackground1': euiTheme.colors.borderBaseDisabled,
40+
// Transparent backgrounds, they are set by the styles of the editor container behind.
41+
'editor.background': '#00000000',
42+
'editorGutter.background': '#00000000',
43+
'minimap.background': '#00000000',
3944
},
4045
});
4146
}, [euiTheme]);

src/platform/plugins/shared/workflows_management/public/widgets/workflow_yaml_editor/ui/workflow_yaml_editor.tsx

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
import { EuiButton, EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, useEuiTheme } from '@elastic/eui';
1313
import { css } from '@emotion/react';
14+
import classnames from 'classnames';
1415
import type { SchemasSettings } from 'monaco-yaml';
1516
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
1617
import { useDispatch, useSelector } from 'react-redux';
@@ -70,8 +71,14 @@ import { useRegisterKeyboardCommands } from '../lib/use_register_keyboard_comman
7071
import { navigateToErrorPosition } from '../lib/utils';
7172
import { GlobalWorkflowEditorStyles } from '../styles/global_workflow_editor_styles';
7273
import { useDynamicTypeIcons } from '../styles/use_dynamic_type_icons';
73-
import { useWorkflowEditorStyles } from '../styles/use_workflow_editor_styles';
74-
import { useWorkflowsMonacoTheme } from '../styles/use_workflows_monaco_theme';
74+
import {
75+
EXECUTION_YAML_SNAPSHOT_CLASS,
76+
useWorkflowEditorStyles,
77+
} from '../styles/use_workflow_editor_styles';
78+
import {
79+
useWorkflowsMonacoTheme,
80+
WORKFLOWS_MONACO_EDITOR_THEME,
81+
} from '../styles/use_workflows_monaco_theme';
7582

7683
const editorOptions: monaco.editor.IStandaloneEditorConstructionOptions = {
7784
minimap: { enabled: false },
@@ -88,7 +95,7 @@ const editorOptions: monaco.editor.IStandaloneEditorConstructionOptions = {
8895
wordWrap: 'on',
8996
wordWrapColumn: 80,
9097
wrappingIndent: 'indent',
91-
theme: 'workflows-subdued',
98+
theme: WORKFLOWS_MONACO_EDITOR_THEME,
9299
padding: {
93100
top: 24,
94101
bottom: 16,
@@ -591,7 +598,10 @@ export const WorkflowYAMLEditor = ({
591598
</EuiFlexGroup>
592599
</div>
593600
)}
594-
<div css={styles.editorContainer}>
601+
<div
602+
css={styles.editorContainer}
603+
className={classnames({ [EXECUTION_YAML_SNAPSHOT_CLASS]: isExecutionYaml })}
604+
>
595605
<YamlEditor
596606
editorDidMount={handleEditorDidMount}
597607
editorWillUnmount={handleEditorWillUnmount}

0 commit comments

Comments
 (0)