Skip to content

Commit 34d0278

Browse files
authored
[Lens] (Accessibility) Improve landmarks in Lens (elastic#84511) (elastic#84645)
1 parent 5178374 commit 34d0278

File tree

3 files changed

+44
-10
lines changed

3 files changed

+44
-10
lines changed

x-pack/plugins/lens/public/editor_frame_service/editor_frame/frame_layout.scss

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,18 @@
1212
}
1313

1414
.lnsFrameLayout__pageContent {
15-
display: flex;
1615
overflow: hidden;
1716
flex-grow: 1;
17+
flex-direction: row;
1818
}
1919

2020
.lnsFrameLayout__pageBody {
2121
@include euiScrollBar;
2222
min-width: $lnsPanelMinWidth + $euiSizeXL;
2323
overflow: hidden auto;
24+
display: flex;
25+
flex-direction: column;
26+
flex: 1 1 100%;
2427
// Leave out bottom padding so the suggestions scrollbar stays flush to window edge
2528
// Leave out left padding so the left sidebar's focus states are visible outside of content bounds
2629
// This also means needing to add same amount of margin to page content and suggestion items

x-pack/plugins/lens/public/editor_frame_service/editor_frame/frame_layout.tsx

+39-8
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
import './frame_layout.scss';
88

99
import React from 'react';
10-
import { EuiPage, EuiPageSideBar, EuiPageBody } from '@elastic/eui';
10+
import { EuiPage, EuiPageBody, EuiScreenReaderOnly } from '@elastic/eui';
11+
import { i18n } from '@kbn/i18n';
1112

1213
export interface FrameLayoutProps {
1314
dataPanel: React.ReactNode;
@@ -19,16 +20,46 @@ export interface FrameLayoutProps {
1920
export function FrameLayout(props: FrameLayoutProps) {
2021
return (
2122
<EuiPage className="lnsFrameLayout">
22-
<div className="lnsFrameLayout__pageContent">
23-
<EuiPageSideBar className="lnsFrameLayout__sidebar">{props.dataPanel}</EuiPageSideBar>
24-
<EuiPageBody className="lnsFrameLayout__pageBody" restrictWidth={false}>
23+
<EuiPageBody
24+
restrictWidth={false}
25+
className="lnsFrameLayout__pageContent"
26+
aria-labelledby="lns_ChartTitle"
27+
>
28+
<section className="lnsFrameLayout__sidebar" aria-labelledby="dataPanelId">
29+
<EuiScreenReaderOnly>
30+
<h2 id="dataPanelId">
31+
{i18n.translate('xpack.lens.section.dataPanelLabel', {
32+
defaultMessage: 'Data panel',
33+
})}
34+
</h2>
35+
</EuiScreenReaderOnly>
36+
{props.dataPanel}
37+
</section>
38+
<section className="lnsFrameLayout__pageBody" aria-labelledby="workspaceId">
39+
<EuiScreenReaderOnly>
40+
<h2 id="workspaceId">
41+
{i18n.translate('xpack.lens.section.workspaceLabel', {
42+
defaultMessage: 'Visualization workspace',
43+
})}
44+
</h2>
45+
</EuiScreenReaderOnly>
2546
{props.workspacePanel}
2647
{props.suggestionsPanel}
27-
</EuiPageBody>
28-
<EuiPageSideBar className="lnsFrameLayout__sidebar lnsFrameLayout__sidebar--right">
48+
</section>
49+
<section
50+
className="lnsFrameLayout__sidebar lnsFrameLayout__sidebar--right"
51+
aria-labelledby="configPanel"
52+
>
53+
<EuiScreenReaderOnly>
54+
<h2 id="configPanel">
55+
{i18n.translate('xpack.lens.section.configPanelLabel', {
56+
defaultMessage: 'Config panel',
57+
})}
58+
</h2>
59+
</EuiScreenReaderOnly>
2960
{props.configPanel}
30-
</EuiPageSideBar>
31-
</div>
61+
</section>
62+
</EuiPageBody>
3263
</EuiPage>
3364
);
3465
}

x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel_wrapper.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export function WorkspacePanelWrapper({
102102
</div>
103103
<EuiPageContent className="lnsWorkspacePanelWrapper">
104104
<EuiScreenReaderOnly>
105-
<h1 data-test-subj="lns_ChartTitle">
105+
<h1 id="lns_ChartTitle" data-test-subj="lns_ChartTitle">
106106
{title ||
107107
i18n.translate('xpack.lens.chartTitle.unsaved', { defaultMessage: 'Unsaved' })}
108108
</h1>

0 commit comments

Comments
 (0)