Skip to content

Commit 606de71

Browse files
[8.19] [ObsUX] [A11y] Improve color alternative for element announcement (elastic#219250) (elastic#219353)
# Backport This will backport the following commits from `main` to `8.19`: - [[ObsUX] [A11y] Improve color alternative for element announcement (elastic#219250)](elastic#219250) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Miriam","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-04-27T08:55:14Z","message":"[ObsUX] [A11y] Improve color alternative for element announcement (elastic#219250)\n\nCloses https://github.com/elastic/kibana/issues/212739\n\n### Summary\n\nFocus on the value for this cell, the value of the metric determines the\ncolor. And since we don’t want to name all possible options, instead of\nannouncing the color, set only aria-label attribute to determine cell\nstate.\nAlso update role for elements on the accessibility tree.\n\n<img width=\"861\" alt=\"Screenshot 2025-04-25 at 14 41 06\"\nsrc=\"https://github.com/user-attachments/assets/35ca8b9c-8bd8-424d-bd2e-a11612a0e470\"\n/>\n\n<img width=\"861\" alt=\"Screenshot 2025-04-25 at 14 40 07\"\nsrc=\"https://github.com/user-attachments/assets/3d676f0c-36af-441f-bba3-5fd63014ae4b\"\n/>\n\n<img width=\"1130\" alt=\"Screenshot 2025-04-25 at 12 27 24\"\nsrc=\"https://github.com/user-attachments/assets/83b2a816-c5e2-4a47-998c-7c3e97660a32\"\n/>","sha":"3fd7ddb5aae6a426f6928e79c03ff02bff75a578","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:obs-ux-infra_services","backport:version","v8.18.0","v9.1.0","v8.19.0","v8.18.1","v9.0.1"],"title":"[ObsUX] [A11y] Improve color alternative for element announcement","number":219250,"url":"https://github.com/elastic/kibana/pull/219250","mergeCommit":{"message":"[ObsUX] [A11y] Improve color alternative for element announcement (elastic#219250)\n\nCloses https://github.com/elastic/kibana/issues/212739\n\n### Summary\n\nFocus on the value for this cell, the value of the metric determines the\ncolor. And since we don’t want to name all possible options, instead of\nannouncing the color, set only aria-label attribute to determine cell\nstate.\nAlso update role for elements on the accessibility tree.\n\n<img width=\"861\" alt=\"Screenshot 2025-04-25 at 14 41 06\"\nsrc=\"https://github.com/user-attachments/assets/35ca8b9c-8bd8-424d-bd2e-a11612a0e470\"\n/>\n\n<img width=\"861\" alt=\"Screenshot 2025-04-25 at 14 40 07\"\nsrc=\"https://github.com/user-attachments/assets/3d676f0c-36af-441f-bba3-5fd63014ae4b\"\n/>\n\n<img width=\"1130\" alt=\"Screenshot 2025-04-25 at 12 27 24\"\nsrc=\"https://github.com/user-attachments/assets/83b2a816-c5e2-4a47-998c-7c3e97660a32\"\n/>","sha":"3fd7ddb5aae6a426f6928e79c03ff02bff75a578"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/219335","number":219335,"state":"MERGED","mergeCommit":{"sha":"a01d531b4ea1a50b3ce4b2f050f520525a1183ec","message":"[9.0] [ObsUX] [A11y] Improve color alternative for element announcement (elastic#219250) (elastic#219335)\n\n# Backport\n\nThis will backport the following commits from `main` to `9.0`:\n- [[ObsUX] [A11y] Improve color alternative for element announcement\n(elastic#219250)](https://github.com/elastic/kibana/pull/219250)\n\n\n\n### Questions ?\nPlease refer to the [Backport tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n\n\nCo-authored-by: Miriam <[email protected]>"}},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/219333","number":219333,"state":"MERGED","mergeCommit":{"sha":"6c54cf7aafd12d36ab3a139050b1f30835a496d9","message":"[8.18] [ObsUX] [A11y] Improve color alternative for element announcement (elastic#219250) (elastic#219333)\n\n# Backport\n\nThis will backport the following commits from `main` to `8.18`:\n- [[ObsUX] [A11y] Improve color alternative for element announcement\n(elastic#219250)](https://github.com/elastic/kibana/pull/219250)\n\n\n\n### Questions ?\nPlease refer to the [Backport tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n\n\nCo-authored-by: Miriam <[email protected]>"}},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/219250","number":219250,"mergeCommit":{"message":"[ObsUX] [A11y] Improve color alternative for element announcement (elastic#219250)\n\nCloses https://github.com/elastic/kibana/issues/212739\n\n### Summary\n\nFocus on the value for this cell, the value of the metric determines the\ncolor. And since we don’t want to name all possible options, instead of\nannouncing the color, set only aria-label attribute to determine cell\nstate.\nAlso update role for elements on the accessibility tree.\n\n<img width=\"861\" alt=\"Screenshot 2025-04-25 at 14 41 06\"\nsrc=\"https://github.com/user-attachments/assets/35ca8b9c-8bd8-424d-bd2e-a11612a0e470\"\n/>\n\n<img width=\"861\" alt=\"Screenshot 2025-04-25 at 14 40 07\"\nsrc=\"https://github.com/user-attachments/assets/3d676f0c-36af-441f-bba3-5fd63014ae4b\"\n/>\n\n<img width=\"1130\" alt=\"Screenshot 2025-04-25 at 12 27 24\"\nsrc=\"https://github.com/user-attachments/assets/83b2a816-c5e2-4a47-998c-7c3e97660a32\"\n/>","sha":"3fd7ddb5aae6a426f6928e79c03ff02bff75a578"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT-->
1 parent 690e852 commit 606de71

File tree

8 files changed

+22
-13
lines changed

8 files changed

+22
-13
lines changed

x-pack/platform/plugins/private/translations/translations/fr-FR.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25696,7 +25696,6 @@
2569625696
"xpack.infra.ml.steps.setupProcess.when.description": "Par défaut, les tâches de Machine Learning analysent les 4 dernières semaines de données et continuent à s'exécuter indéfiniment.",
2569725697
"xpack.infra.ml.steps.setupProcess.when.timePicker.label": "Date de début",
2569825698
"xpack.infra.ml.steps.setupProcess.when.title": "Quand votre modèle commence-t-il ?",
25699-
"xpack.infra.node.ariaLabel": "{nodeName}, cliquer pour ouvrir le menu",
2570025699
"xpack.infra.nodeContextMenu.createRuleLink": "Créer une règle d'inventaire",
2570125700
"xpack.infra.nodeContextMenu.description": "Afficher les détails pour {label} {value}",
2570225701
"xpack.infra.nodeContextMenu.title": "Détails de {inventoryName}",

x-pack/platform/plugins/private/translations/translations/ja-JP.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25672,7 +25672,6 @@
2567225672
"xpack.infra.ml.steps.setupProcess.when.description": "デフォルトでは、機械学習ジョブは直近4週間のデータを分析し、無限に実行し続けます。",
2567325673
"xpack.infra.ml.steps.setupProcess.when.timePicker.label": "開始日",
2567425674
"xpack.infra.ml.steps.setupProcess.when.title": "いつモデルを開始しますか?",
25675-
"xpack.infra.node.ariaLabel": "{nodeName}、クリックしてメニューを開きます",
2567625675
"xpack.infra.nodeContextMenu.createRuleLink": "インベントリルールの作成",
2567725676
"xpack.infra.nodeContextMenu.description": "{label} {value} の詳細を表示",
2567825677
"xpack.infra.nodeContextMenu.title": "{inventoryName}の詳細",

x-pack/platform/plugins/private/translations/translations/zh-CN.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25726,7 +25726,6 @@
2572625726
"xpack.infra.ml.steps.setupProcess.when.description": "默认情况下,Machine Learning 作业会分析过去 4 周的数据,并继续无限期地运行。",
2572725727
"xpack.infra.ml.steps.setupProcess.when.timePicker.label": "开始日期",
2572825728
"xpack.infra.ml.steps.setupProcess.when.title": "您的模型何时开始?",
25729-
"xpack.infra.node.ariaLabel": "{nodeName},单击打开菜单",
2573025729
"xpack.infra.nodeContextMenu.createRuleLink": "创建库存规则",
2573125730
"xpack.infra.nodeContextMenu.description": "查看 {label} {value} 的详情",
2573225731
"xpack.infra.nodeContextMenu.title": "{inventoryName} 详情",

x-pack/solutions/observability/plugins/infra/public/pages/metrics/inventory_view/components/waffle/swatch_label.tsx renamed to x-pack/solutions/observability/plugins/infra/public/pages/metrics/inventory_view/components/waffle/color_label.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ import React from 'react';
1212
export interface Props {
1313
color: string;
1414
label: string;
15+
paletteSelected: string;
1516
}
1617

17-
export const SwatchLabel = ({ label, color }: Props) => {
18+
export const ColorLabel = ({ label, color, paletteSelected }: Props) => {
1819
return (
1920
<EuiFlexGroup alignItems="center" gutterSize="s" responsive={false}>
2021
<EuiFlexItem grow={false}>
@@ -23,8 +24,8 @@ export const SwatchLabel = ({ label, color }: Props) => {
2324
color={color}
2425
size="xl"
2526
aria-label={i18n.translate('xpack.infra.legendControls.iconColorLabel', {
26-
defaultMessage: '{label} color',
27-
values: { label },
27+
defaultMessage: '{label} {paletteSelected} color',
28+
values: { label, paletteSelected },
2829
})}
2930
/>
3031
</EuiFlexItem>

x-pack/solutions/observability/plugins/infra/public/pages/metrics/inventory_view/components/waffle/group_of_nodes.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export const GroupOfNodes = React.memo<Props>(
6767
options={options}
6868
nodeType={nodeType}
6969
/>
70-
<Nodes>
70+
<Nodes role="list">
7171
{group.width ? (
7272
group.nodes.map((node) => (
7373
<Node

x-pack/solutions/observability/plugins/infra/public/pages/metrics/inventory_view/components/waffle/legend_controls.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import {
3737
} from '../../../../../common/inventory/types';
3838
import { getColorPalette } from '../../lib/get_color_palette';
3939
import { convertBoundsToPercents } from '../../lib/convert_bounds_to_percents';
40-
import { SwatchLabel } from './swatch_label';
40+
import { ColorLabel } from './color_label';
4141
import { PalettePreview } from './palette_preview';
4242

4343
interface Props {
@@ -211,6 +211,9 @@ export const LegendControls = ({
211211
>
212212
<>
213213
<EuiSelect
214+
aria-label={i18n.translate('xpack.infra.legendControls.colorPalette.ariaLabel', {
215+
defaultMessage: 'Color palette selection',
216+
})}
214217
options={PALETTE_OPTIONS}
215218
value={draftLegend.palette}
216219
id="palette"
@@ -282,7 +285,8 @@ export const LegendControls = ({
282285
<EuiFormRow
283286
fullWidth
284287
label={
285-
<SwatchLabel
288+
<ColorLabel
289+
paletteSelected={draftLegend.palette}
286290
color={first(paletteColors)!}
287291
label={i18n.translate('xpack.infra.legendControls.minLabel', {
288292
defaultMessage: 'Minimum',
@@ -311,7 +315,8 @@ export const LegendControls = ({
311315
fullWidth
312316
display="columnCompressed"
313317
label={
314-
<SwatchLabel
318+
<ColorLabel
319+
paletteSelected={draftLegend.palette}
315320
color={last(paletteColors)!}
316321
label={i18n.translate('xpack.infra.legendControls.maxLabel', {
317322
defaultMessage: 'Maximum',
@@ -339,6 +344,9 @@ export const LegendControls = ({
339344
<EuiFlexGroup justifyContent="flexEnd" responsive={false}>
340345
<EuiFlexItem grow={false}>
341346
<EuiButtonEmpty
347+
aria-label={i18n.translate('xpack.infra.legendControls.cancelButton.ariaLabel', {
348+
defaultMessage: 'Cancel',
349+
})}
342350
data-test-subj="infraLegendControlsCancelButton"
343351
type="submit"
344352
size="s"

x-pack/solutions/observability/plugins/infra/public/pages/metrics/inventory_view/components/waffle/node.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,13 @@ export const Node = ({
7373
position="right"
7474
content={<ConditionalToolTip currentTime={currentTime} node={node} nodeType={nodeType} />}
7575
>
76-
<div>
76+
<div role="listitem">
7777
<NodeSquare
7878
squareSize={squareSize}
7979
togglePopover={toggleAssetPopover}
8080
color={color}
8181
nodeName={node.name}
82+
nodeMetric={metric ? metric.name : ''}
8283
value={value}
8384
showBorder={detailsItemId === node.id || isPopoverOpen}
8485
/>

x-pack/solutions/observability/plugins/infra/public/pages/metrics/inventory_view/components/waffle/node_square.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,19 +163,21 @@ export const NodeSquare = ({
163163
nodeName,
164164
value,
165165
showBorder,
166+
nodeMetric,
166167
}: {
167168
squareSize: number;
168169
togglePopover: UseBooleanHandlers['toggle'];
169170
color: string;
170171
nodeName: string;
171172
value: string;
172173
showBorder?: boolean;
174+
nodeMetric?: string;
173175
}) => {
174176
const valueMode = squareSize > 70;
175177
const ellipsisMode = squareSize > 30;
176178
const nodeAriaLabel = i18n.translate('xpack.infra.node.ariaLabel', {
177-
defaultMessage: '{nodeName}, click to open menu',
178-
values: { nodeName },
179+
defaultMessage: '{nodeName} {value} {nodeMetric} ',
180+
values: { nodeName, nodeMetric, value },
179181
});
180182
const style: CSSProperties | undefined = showBorder ? { border: 'solid 4px #000' } : undefined;
181183

0 commit comments

Comments
 (0)