From a616dc3cd2c7c6cf8f2782d1af85118117855db3 Mon Sep 17 00:00:00 2001 From: Henry Heino <46334387+personalizedrefrigerator@users.noreply.github.com> Date: Sat, 9 Nov 2024 04:50:06 -0800 Subject: [PATCH] Desktop: Fix errors found by automated accessibility testing (#11246) Co-authored-by: Laurent Cozic --- .eslintignore | 2 + .gitignore | 2 + packages/app-desktop/gui/Button/Button.tsx | 3 +- .../gui/ConfigScreen/ConfigScreen.tsx | 2 +- .../app-desktop/gui/ConfigScreen/Sidebar.tsx | 4 +- .../controls/SettingDescription.tsx | 2 +- .../styles/setting-description.scss | 5 ++ packages/app-desktop/gui/FolderIconBox.tsx | 2 +- packages/app-desktop/gui/ItemList.tsx | 1 - packages/app-desktop/gui/MainScreen.tsx | 10 +-- .../NoteBody/CodeMirror/v6/CodeMirror.tsx | 1 + .../gui/NoteEditor/NoteTitle/NoteTitleBar.tsx | 1 + .../app-desktop/gui/NoteList/NoteList2.tsx | 9 +-- .../gui/NoteListWrapper/NoteListWrapper.tsx | 2 +- packages/app-desktop/gui/NoteTextViewer.tsx | 2 + packages/app-desktop/gui/Sidebar/Sidebar.tsx | 2 +- .../Sidebar/hooks/useOnRenderListWrapper.tsx | 1 - .../listItemComponents/AllNotesItem.tsx | 2 +- .../Sidebar/listItemComponents/HeaderItem.tsx | 2 +- .../gui/ToolbarButton/ToolbarButton.tsx | 2 +- packages/app-desktop/gui/styles/index.scss | 1 + .../gui/styles/note-editor-wrapper.scss | 6 ++ .../integration-tests/models/Sidebar.ts | 2 + .../integration-tests/util/setDarkMode.ts | 9 +++ .../integration-tests/util/test.ts | 2 + .../integration-tests/wcag.spec.ts | 68 +++++++++++++++++++ packages/app-desktop/package.json | 1 + .../components/NoteEditor/NoteEditor.tsx | 2 + .../editor/CodeMirror/configFromSettings.ts | 1 + .../testUtil/createEditorSettings.ts | 1 + packages/editor/types.ts | 2 + packages/lib/themes/light.ts | 4 +- packages/tools/cspell/dictionary4.txt | 1 + yarn.lock | 19 ++++++ 34 files changed, 153 insertions(+), 23 deletions(-) create mode 100644 packages/app-desktop/gui/styles/note-editor-wrapper.scss create mode 100644 packages/app-desktop/integration-tests/util/setDarkMode.ts create mode 100644 packages/app-desktop/integration-tests/wcag.spec.ts diff --git a/.eslintignore b/.eslintignore index 2cf3e2e2c..ed0dbe599 100644 --- a/.eslintignore +++ b/.eslintignore @@ -511,10 +511,12 @@ packages/app-desktop/integration-tests/util/createStartupArgs.js packages/app-desktop/integration-tests/util/extendedExpect.js packages/app-desktop/integration-tests/util/firstNonDevToolsWindow.js packages/app-desktop/integration-tests/util/getImageSourceSize.js +packages/app-desktop/integration-tests/util/setDarkMode.js packages/app-desktop/integration-tests/util/setFilePickerResponse.js packages/app-desktop/integration-tests/util/setMessageBoxResponse.js packages/app-desktop/integration-tests/util/test.js packages/app-desktop/integration-tests/util/waitForNextOpenPath.js +packages/app-desktop/integration-tests/wcag.spec.js packages/app-desktop/playwright.config.js packages/app-desktop/plugins/GotoAnything.js packages/app-desktop/services/autoUpdater/AutoUpdaterService.test.js diff --git a/.gitignore b/.gitignore index 5b0c0fe6f..b5d02cf90 100644 --- a/.gitignore +++ b/.gitignore @@ -487,10 +487,12 @@ packages/app-desktop/integration-tests/util/createStartupArgs.js packages/app-desktop/integration-tests/util/extendedExpect.js packages/app-desktop/integration-tests/util/firstNonDevToolsWindow.js packages/app-desktop/integration-tests/util/getImageSourceSize.js +packages/app-desktop/integration-tests/util/setDarkMode.js packages/app-desktop/integration-tests/util/setFilePickerResponse.js packages/app-desktop/integration-tests/util/setMessageBoxResponse.js packages/app-desktop/integration-tests/util/test.js packages/app-desktop/integration-tests/util/waitForNextOpenPath.js +packages/app-desktop/integration-tests/wcag.spec.js packages/app-desktop/playwright.config.js packages/app-desktop/plugins/GotoAnything.js packages/app-desktop/services/autoUpdater/AutoUpdaterService.test.js diff --git a/packages/app-desktop/gui/Button/Button.tsx b/packages/app-desktop/gui/Button/Button.tsx index 4dea7c565..3269f61d7 100644 --- a/packages/app-desktop/gui/Button/Button.tsx +++ b/packages/app-desktop/gui/Button/Button.tsx @@ -224,7 +224,8 @@ const Button = React.forwardRef((props: Props, ref: any) => { function renderIcon() { if (!props.iconName) return null; return { } return ( -
+
props.theme.dividerColor}; background-color: ${(props: StyleProps) => props.theme.selectedColor2}; font-size: ${(props: StyleProps) => Math.round(props.theme.fontSize)}px; - opacity: 0.5; + opacity: 0.58; `; export const StyledListItemLabel = styled.span` @@ -131,9 +131,9 @@ export default function Sidebar(props: Props) { onKeyDown={onKeyDown} >