Skip to content

[One Workflow] Use EUI primary tint for word occurrence highlight in YAML editor#267667

Merged
r4zr32d3k1l merged 3 commits into
mainfrom
claude/nice-ptolemy-d29aa5
May 8, 2026
Merged

[One Workflow] Use EUI primary tint for word occurrence highlight in YAML editor#267667
r4zr32d3k1l merged 3 commits into
mainfrom
claude/nice-ptolemy-d29aa5

Conversation

@r4zr32d3k1l
Copy link
Copy Markdown
Contributor

@r4zr32d3k1l r4zr32d3k1l commented May 5, 2026

Before
image

After
image

Summary

Replaces the default gray Monaco word-occurrence highlight (visible in the workflows YAML editor when the cursor sits on a token like name or type) with euiTheme.colors.backgroundLightPrimary, so the highlight matches the EUI primary accents already used elsewhere in the editor (selection, hover) instead of reading as a generic gray box.

The override is scoped via [data-test-subj='workflowYamlEditor'] so it only affects the workflows YAML editor — no impact on other Monaco editors in Kibana.

Before / After

  • Before: Monaco's default neutral gray wordHighlightText background.
  • After: EUI backgroundLightPrimary, visually consistent with the rest of the editor's primary-tinted highlights.

Test plan

  • Open a workflow in the workflows YAML editor.
  • Place the cursor on a YAML key (e.g. name, type) — all matching occurrences should be highlighted in soft EUI primary blue, not gray.
  • Verify the change does NOT bleed into other Monaco-based editors in Kibana (Console, Lens formula bar, etc.).
  • Verify in both light and dark EUI themes.

🤖 Generated with Claude Code

…L editor

Override the default neutral-gray Monaco wordHighlightText color with
euiTheme.colors.backgroundLightPrimary so the occurrence highlight matches
the rest of the editor's primary-tinted accents (selection, hover) and
reads as part of the EUI palette instead of a generic gray.

Scoped to [data-test-subj='workflowYamlEditor'] so it only affects the
workflows YAML editor and doesn't leak into other Monaco editors in
Kibana.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@r4zr32d3k1l r4zr32d3k1l added backport:version Backport to applied version labels release_note:skip Skip the PR/issue when compiling release notes Team:One Workflow Team label for One Workflow (Workflow automation) v9.4.0 labels May 5, 2026
@Kiryous Kiryous self-requested a review May 5, 2026 10:15
@Kiryous Kiryous changed the title [Workflows] Use EUI primary tint for word occurrence highlight in YAML editor [One Workflow] Use EUI primary tint for word occurrence highlight in YAML editor May 5, 2026
}

[data-test-subj='workflowYamlEditor'] .monaco-editor .wordHighlightText {
background-color: ${euiTheme.colors.backgroundLightPrimary};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The workflow editor already defines its own Monaco theme (WORKFLOWS_MONACO_EDITOR_THEME in use_workflows_monaco_theme.ts) and overrides things like editor.selectionBackground and editor.hoverHighlightBackground through the colors map. Since .wordHighlightText is a first-class Monaco token (editor.wordHighlightTextBackground), could we set it there instead of a CSS rule?

Two upsides:

  1. No need for the [data-test-subj='workflowYamlEditor'] selector to scope the rule. The workflows theme is only attached to the workflow YAML editor (and the manual run form), so the override scopes naturally and we avoid styling off a data-test-subj (it's meant for test selection).
  2. It lives next to the other Monaco color overrides (selection, hover, suggest widget, etc.), so future readers find them in one place.

Roughly:

// use_workflows_monaco_theme.ts, inside colors: { ... }
'editor.wordHighlightTextBackground': euiTheme.colors.backgroundLightPrimary,
// optional, for completeness if YAML ever gets read/write semantics:
'editor.wordHighlightBackground': euiTheme.colors.backgroundLightPrimary,
'editor.wordHighlightStrongBackground': euiTheme.colors.backgroundLightPrimary,

One thing to double-check: the existing theme uses chroma(transparentize(euiTheme.colors.primary, 0.1)) for selection, vs backgroundLightPrimary here. They're close but not identical. Worth picking one and being consistent so the highlight, selection, and hover tints don't look like three slightly different blues stacked on top of each other.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good call, done in c6fccdd:

  • Moved the override into use_workflows_monaco_theme.ts using editor.wordHighlightTextBackground (plus the read/write variants for completeness), and removed the CSS rule + the [data-test-subj='workflowYamlEditor'] selector hack.
  • For the consistency point, aligned with the existing selection pattern: chroma(transparentize(euiTheme.colors.primary, 0.1)).hex(). The highlight, selection, and hover now all live on the same primary-tinted ramp (selection/word at 0.1, hover at 0.15).

@Kiryous
Copy link
Copy Markdown
Contributor

Kiryous commented May 6, 2026

Quick note on the broader Monaco-theme question, since the PR title is editor-scoped: I checked the shared kbn-monaco default theme (src/platform/packages/shared/kbn-monaco/src/code_editor/theme.ts) and it doesn't set any editor.wordHighlight* tokens, so Console / Lens / every other Kibana Monaco editor still shows Monaco's default gray. So this PR is genuinely workflow-editor-only and there's no precedent to align with yet.

If the new tinted highlight feels nicer in practice, a follow-up could promote editor.wordHighlightTextBackground (+ the read/write variants) into the shared theme so the rest of Kibana picks it up too. Probably out of scope for this PR, just flagging.

@r4zr32d3k1l
Copy link
Copy Markdown
Contributor Author

Thanks for checking the broader theme context @Kiryous! Agreed this PR is editor-scoped for now — happy to open a follow-up to promote editor.wordHighlight*Background into the shared kbn-monaco theme once we see how the tinted highlight reads in practice across other Monaco editors (Console, Lens, etc.).

@Kiryous Kiryous self-requested a review May 6, 2026 11:53
Address review feedback: set editor.wordHighlightTextBackground (plus
the read/write variants) on the workflows Monaco theme instead of
overriding the .wordHighlightText CSS class. The workflows theme is
only attached to the workflow YAML editor and the manual run form, so
the override scopes naturally and we no longer rely on a
data-test-subj selector for styling.

Aligned the color with the existing selection background
(chroma(transparentize(primary, 0.1))) for visual consistency with
the other primary-tinted accents in the theme.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@Kiryous Kiryous marked this pull request as ready for review May 6, 2026 12:13
@Kiryous Kiryous requested a review from a team as a code owner May 6, 2026 12:13
Copy link
Copy Markdown
Contributor

@Kiryous Kiryous left a comment

Choose a reason for hiding this comment

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

LGTM

@r4zr32d3k1l r4zr32d3k1l enabled auto-merge (squash) May 7, 2026 07:53
@kibanamachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Scout Lane #7 - stateful-classic / default / local-stateful-classic - APM integration not installed but setup completed - Admin user
  • [job] [logs] Scout Lane #7 - stateful-classic / default / local-stateful-classic - Observability Landing Page (discover.isEsqlDefault enabled) - redirects to onboarding when no logs data exists
  • [job] [logs] Scout Lane #7 - stateful-classic / default / local-stateful-classic - Profiling is not setup and no data is loaded - Admin users
  • [job] [logs] Scout Lane #7 - stateful-classic / default / local-stateful-classic - Profiling is not setup and no data is loaded - Viewer users

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
workflowsManagement 2.3MB 2.3MB +268.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
agentBuilderWorkflows 21.2KB 21.5KB +268.0B

History

@r4zr32d3k1l r4zr32d3k1l merged commit 090eedf into main May 8, 2026
32 checks passed
@r4zr32d3k1l r4zr32d3k1l deleted the claude/nice-ptolemy-d29aa5 branch May 8, 2026 18:33
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 9.4

https://github.com/elastic/kibana/actions/runs/25572737006

@kibanamachine
Copy link
Copy Markdown
Contributor

💚 All backports created successfully

Status Branch Result
9.4

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request May 8, 2026
…ht in YAML editor (#267667) (#268532)

# Backport

This will backport the following commits from `main` to `9.4`:
- [[One Workflow] Use EUI primary tint for word occurrence highlight in
YAML editor (#267667)](#267667)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Pavel
M","email":"91208591+r4zr32d3k1l@users.noreply.github.com"},"sourceCommit":{"committedDate":"2026-05-08T18:33:52Z","message":"[One
Workflow] Use EUI primary tint for word occurrence highlight in YAML
editor (#267667)\n\nBefore \n<img width=\"370\" height=\"235\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/98e6bc67-e6ab-40a0-98eb-c012774a26c4\"\n/>\n\nAfter\n<img
width=\"410\" height=\"264\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/639634ef-717f-4b59-bc69-5e03c416cfea\"\n/>\n\n\n##
Summary\n\nReplaces the default gray Monaco word-occurrence highlight
(visible in\nthe workflows YAML editor when the cursor sits on a token
like `name` or\n`type`) with `euiTheme.colors.backgroundLightPrimary`,
so the highlight\nmatches the EUI primary accents already used elsewhere
in the editor\n(selection, hover) instead of reading as a generic gray
box.\n\nThe override is scoped via
`[data-test-subj='workflowYamlEditor']` so it\nonly affects the
workflows YAML editor — no impact on other Monaco\neditors in
Kibana.\n\n### Before / After\n\n- **Before:** Monaco's default neutral
gray `wordHighlightText`\nbackground.\n- **After:** EUI
`backgroundLightPrimary`, visually consistent with the\nrest of the
editor's primary-tinted highlights.\n\n## Test plan\n\n- [ ] Open a
workflow in the workflows YAML editor.\n- [ ] Place the cursor on a YAML
key (e.g. `name`, `type`) — all\nmatching occurrences should be
highlighted in soft EUI primary blue, not\ngray.\n- [ ] Verify the
change does NOT bleed into other Monaco-based editors\nin Kibana
(Console, Lens formula bar, etc.).\n- [ ] Verify in both light and dark
EUI themes.\n\n🤖 Generated with [Claude
Code](https://claude.com/claude-code)\n\n---------\n\nCo-authored-by:
Claude Opus 4.7
<noreply@anthropic.com>","sha":"090eedfc778cbba025e76b75c337299ac35a7135","branchLabelMapping":{"^v9.5.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:version","Team:One
Workflow","v9.5.0","v9.4.1"],"title":"[One Workflow] Use EUI primary
tint for word occurrence highlight in YAML
editor","number":267667,"url":"https://github.com/elastic/kibana/pull/267667","mergeCommit":{"message":"[One
Workflow] Use EUI primary tint for word occurrence highlight in YAML
editor (#267667)\n\nBefore \n<img width=\"370\" height=\"235\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/98e6bc67-e6ab-40a0-98eb-c012774a26c4\"\n/>\n\nAfter\n<img
width=\"410\" height=\"264\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/639634ef-717f-4b59-bc69-5e03c416cfea\"\n/>\n\n\n##
Summary\n\nReplaces the default gray Monaco word-occurrence highlight
(visible in\nthe workflows YAML editor when the cursor sits on a token
like `name` or\n`type`) with `euiTheme.colors.backgroundLightPrimary`,
so the highlight\nmatches the EUI primary accents already used elsewhere
in the editor\n(selection, hover) instead of reading as a generic gray
box.\n\nThe override is scoped via
`[data-test-subj='workflowYamlEditor']` so it\nonly affects the
workflows YAML editor — no impact on other Monaco\neditors in
Kibana.\n\n### Before / After\n\n- **Before:** Monaco's default neutral
gray `wordHighlightText`\nbackground.\n- **After:** EUI
`backgroundLightPrimary`, visually consistent with the\nrest of the
editor's primary-tinted highlights.\n\n## Test plan\n\n- [ ] Open a
workflow in the workflows YAML editor.\n- [ ] Place the cursor on a YAML
key (e.g. `name`, `type`) — all\nmatching occurrences should be
highlighted in soft EUI primary blue, not\ngray.\n- [ ] Verify the
change does NOT bleed into other Monaco-based editors\nin Kibana
(Console, Lens formula bar, etc.).\n- [ ] Verify in both light and dark
EUI themes.\n\n🤖 Generated with [Claude
Code](https://claude.com/claude-code)\n\n---------\n\nCo-authored-by:
Claude Opus 4.7
<noreply@anthropic.com>","sha":"090eedfc778cbba025e76b75c337299ac35a7135"}},"sourceBranch":"main","suggestedTargetBranches":["9.4"],"targetPullRequestStates":[{"branch":"main","label":"v9.5.0","branchLabelMappingKey":"^v9.5.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/267667","number":267667,"mergeCommit":{"message":"[One
Workflow] Use EUI primary tint for word occurrence highlight in YAML
editor (#267667)\n\nBefore \n<img width=\"370\" height=\"235\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/98e6bc67-e6ab-40a0-98eb-c012774a26c4\"\n/>\n\nAfter\n<img
width=\"410\" height=\"264\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/639634ef-717f-4b59-bc69-5e03c416cfea\"\n/>\n\n\n##
Summary\n\nReplaces the default gray Monaco word-occurrence highlight
(visible in\nthe workflows YAML editor when the cursor sits on a token
like `name` or\n`type`) with `euiTheme.colors.backgroundLightPrimary`,
so the highlight\nmatches the EUI primary accents already used elsewhere
in the editor\n(selection, hover) instead of reading as a generic gray
box.\n\nThe override is scoped via
`[data-test-subj='workflowYamlEditor']` so it\nonly affects the
workflows YAML editor — no impact on other Monaco\neditors in
Kibana.\n\n### Before / After\n\n- **Before:** Monaco's default neutral
gray `wordHighlightText`\nbackground.\n- **After:** EUI
`backgroundLightPrimary`, visually consistent with the\nrest of the
editor's primary-tinted highlights.\n\n## Test plan\n\n- [ ] Open a
workflow in the workflows YAML editor.\n- [ ] Place the cursor on a YAML
key (e.g. `name`, `type`) — all\nmatching occurrences should be
highlighted in soft EUI primary blue, not\ngray.\n- [ ] Verify the
change does NOT bleed into other Monaco-based editors\nin Kibana
(Console, Lens formula bar, etc.).\n- [ ] Verify in both light and dark
EUI themes.\n\n🤖 Generated with [Claude
Code](https://claude.com/claude-code)\n\n---------\n\nCo-authored-by:
Claude Opus 4.7
<noreply@anthropic.com>","sha":"090eedfc778cbba025e76b75c337299ac35a7135"}},{"branch":"9.4","label":"v9.4.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Pavel M <91208591+r4zr32d3k1l@users.noreply.github.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels release_note:skip Skip the PR/issue when compiling release notes Team:One Workflow Team label for One Workflow (Workflow automation) v9.4.2 v9.5.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants