[One Workflow] Use EUI primary tint for word occurrence highlight in YAML editor#267667
Conversation
…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>
| } | ||
|
|
||
| [data-test-subj='workflowYamlEditor'] .monaco-editor .wordHighlightText { | ||
| background-color: ${euiTheme.colors.backgroundLightPrimary}; |
There was a problem hiding this comment.
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:
- 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 adata-test-subj(it's meant for test selection). - 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.
There was a problem hiding this comment.
Good call, done in c6fccdd:
- Moved the override into
use_workflows_monaco_theme.tsusingeditor.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).
|
Quick note on the broader Monaco-theme question, since the PR title is editor-scoped: I checked the shared If the new tinted highlight feels nicer in practice, a follow-up could promote |
|
Thanks for checking the broader theme context @Kiryous! Agreed this PR is editor-scoped for now — happy to open a follow-up to promote |
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>
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Async chunks
Page load bundle
History
|
|
Starting backport for target branches: 9.4 https://github.com/elastic/kibana/actions/runs/25572737006 |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…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>
Before

After

Summary
Replaces the default gray Monaco word-occurrence highlight (visible in the workflows YAML editor when the cursor sits on a token like
nameortype) witheuiTheme.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
wordHighlightTextbackground.backgroundLightPrimary, visually consistent with the rest of the editor's primary-tinted highlights.Test plan
name,type) — all matching occurrences should be highlighted in soft EUI primary blue, not gray.🤖 Generated with Claude Code