Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

👤🔊 OP Accessibility: Screen Reader Improvements #1118

Merged
merged 21 commits into from
Feb 10, 2024
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
7d60bdc
proof of concept for the welcome page
niccolopaganini Nov 26, 2023
9d970d2
first commit - Adding the button for the Open Access Study
niccolopaganini Dec 4, 2023
120059c
Removed open-access study link, added button roles to existing button…
niccolopaganini Dec 6, 2023
69e3bee
profileSettings needs more finetuning for the logout button
niccolopaganini Dec 14, 2023
2620ad6
Merge branch 'Accessibility_changes' into screen-reader
sebastianbarry Dec 18, 2023
3ed90d5
Adding Prettier
sebastianbarry Dec 19, 2023
f359bfc
Fix disconnected text/button for accessibility for logout
sebastianbarry Jan 2, 2024
f12bf5a
Add accessibility label for Metrics Cards icons on dashboard
sebastianbarry Jan 2, 2024
2b41759
Add accessibilityLabel properties to the navigation menu
sebastianbarry Jan 2, 2024
e3e1461
Remove non-character characters
sebastianbarry Jan 9, 2024
8d8a40f
Remove focusability for SettingRow icons
sebastianbarry Jan 9, 2024
dd1f404
Change accessibilityRole for ExpandMenu "developer zone" to spinbutto…
sebastianbarry Jan 9, 2024
771cb15
Remove unnecessary translation
sebastianbarry Jan 10, 2024
bd9b2f2
Remove unnecessary translation
sebastianbarry Jan 10, 2024
d5b7b51
Delete package-lock.json
sebastianbarry Jan 10, 2024
b94abff
Change logout button from TouchableOpacity to a List.item
sebastianbarry Jan 22, 2024
44ac249
Merge branch 'service_rewrite_2023' of https://github.com/e-mission/e…
JGreenlee Feb 5, 2024
c4798c6
Merge branch 'master' into screen-reader
sebastianbarry Feb 6, 2024
3090f33
Undoing desc and descriptionText changes in www/js/control/SettingRow…
sebastianbarry Feb 9, 2024
b0596e0
Undoing desc and descriptionText changes in www/js/control/SettingRow…
sebastianbarry Feb 9, 2024
cf7c860
Add translation for "more info" on join page
sebastianbarry Feb 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30,100 changes: 30,100 additions & 0 deletions package-lock.json
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove this file please

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Deleted d5b7b51

Large diffs are not rendered by default.

21 changes: 11 additions & 10 deletions www/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,13 @@
"to-label": "To Label",
"show-all": "All Trips",
"no-trips-found": "No trips found",
"choose-mode": "Mode 📝 ",
"choose-replaced-mode": "Replaces 📝",
"choose-purpose": "Purpose 📝",
"choose-survey": "Add Trip Details 📝 ",
"select-mode-scroll": "Mode (👇 for more)",
"select-replaced-mode-scroll": "Replaces (👇 for more)",
"select-purpose-scroll": "Purpose (👇 for more)",
"choose-mode": "Mode",
"choose-replaced-mode": "Replaces",
"choose-purpose": "Purpose",
shankari marked this conversation as resolved.
Show resolved Hide resolved
"choose-survey": "Add Trip Details",
"select-mode-scroll": "Mode (scroll for more)",
"select-replaced-mode-scroll": "Replaces (scroll for more)",
"select-purpose-scroll": "Purpose (scroll for more)",
shankari marked this conversation as resolved.
Show resolved Hide resolved
"delete-entry-confirm": "Are you sure you wish to delete this entry?",
"detected": "Detected:",
"labeled-mode": "Labeled Mode",
Expand Down Expand Up @@ -380,7 +380,8 @@
"all-green-status": "Make sure that all status checks are green",
"dont-force-kill": "Do not force kill the app",
"background-restrictions": "On Samsung and Huwaei phones, make sure that background restrictions are turned off",
"close": "Close"
"close": "Close",
"open-access-study": "Link to Open Access Study"
shankari marked this conversation as resolved.
Show resolved Hide resolved
sebastianbarry marked this conversation as resolved.
Show resolved Hide resolved
},
"config": {
"unable-read-saved-config": "Unable to read saved config",
Expand Down Expand Up @@ -441,8 +442,8 @@
"header": "Who gets to see the information",
"public-dash": "Aggregate metrics derived from the travel patterns will be made available on a public dashboard to provide transparency into the impact of the program. These metrics will focus on information summaries such as counts, distances and durations, and will not display individual travel locations or times.",
"individual-info": "Individual labeling rates and trip level information will only be made available to:",
"program-admins": "🧑 Program administrators from {{deployment_partner_name}} to {{raw_data_use}}, and",
"nrel-devs": "💻 NREL OpenPATH developers for debugging",
"program-admins": "Program administrators from {{deployment_partner_name}} to {{raw_data_use}}, and",
"nrel-devs": "NREL OpenPATH developers for debugging",
"TSDC-info": "The data will also be periodically archived in NREL’s Transportation Secure Data Center (TSDC) after a delay of 3 to 6 months. It will then be made available for legitimate research through existing, privacy-preserving TSDC operating procedures. Further information on the procedures is available",
"on-website": " on the website ",
"and-in": "and in",
Expand Down
3 changes: 3 additions & 0 deletions www/js/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,21 @@ const defaultRoutes = (t) => [
title: t('diary.label-tab'),
focusedIcon: 'check-bold',
unfocusedIcon: 'check-outline',
accessibilityLabel: t('diary.label-tab'),
},
{
key: 'metrics',
title: t('metrics.dashboard-tab'),
focusedIcon: 'chart-box',
unfocusedIcon: 'chart-box-outline',
accessibilityLabel: t('metrics.dashboard-tab'),
},
{
key: 'control',
title: t('control.profile-tab'),
focusedIcon: 'account',
unfocusedIcon: 'account-outline',
accessibilityLabel: t('control.profile-tab'),
},
];

Expand Down
1 change: 1 addition & 0 deletions www/js/components/ToggleSwitch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const ToggleSwitch = ({ value, buttons, ...rest }: SegmentedButtonsProps) => {
buttons={buttons.map((o) => ({
value: o.value,
icon: o.icon,
accessibilityLabel: o.value,
shankari marked this conversation as resolved.
Show resolved Hide resolved
uncheckedColor: colors.onSurfaceDisabled,
showSelectedCheck: true,
style: {
Expand Down
2 changes: 2 additions & 0 deletions www/js/control/ExpandMenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ const ExpansionSection = (props) => {
style={styles.section(colors.surface)}
title={t(props.sectionTitle)}
titleStyle={rowStyles.title}
accessible={true}
accessibilityLabel={t(props.sectionTitle) + ' spinbutton'}
shankari marked this conversation as resolved.
Show resolved Hide resolved
expanded={expanded}
onPress={handlePress}>
{props.children}
Expand Down
17 changes: 13 additions & 4 deletions www/js/control/ProfileSettings.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState, useEffect, useContext, useRef } from 'react';
import { Modal, StyleSheet, ScrollView } from 'react-native';
import { Modal, StyleSheet, ScrollView, View, TouchableOpacity } from 'react-native';
import { Dialog, Button, useTheme, Text, Appbar, IconButton, TextInput } from 'react-native-paper';
import { getAngularService } from '../angular-react-helper';
import { useTranslation } from 'react-i18next';
Expand Down Expand Up @@ -392,10 +392,19 @@ const ProfileSettings = () => {
<Appbar.Header
statusBarHeight={0}
elevated={true}
style={{ height: 46, backgroundColor: 'white', elevation: 3 }}>
style={{ height: 46, backgroundColor: 'white', elevation: 3 }}
accessibilityRole="navigation">
<Appbar.Content title={t('control.profile-tab')} />
<Text>{t('control.log-out')}</Text>
<IconButton icon="logout" onPress={() => setLogoutVis(true)}></IconButton>
<TouchableOpacity
onPress={() => setLogoutVis(true)}
style={{ flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-end' }}
aria-labelledby="logout-group"
accessible={true}>
<Text id="logout-group" focusable={false}>
{t('control.log-out')}
</Text>
<IconButton aria-hidden={true} icon="logout" />
</TouchableOpacity>
</Appbar.Header>

<ScrollView>
Expand Down
22 changes: 16 additions & 6 deletions www/js/control/SettingRow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,24 @@ const SettingRow = ({
switchValue = undefined,
descStyle = undefined,
}) => {
const { t } = useTranslation(); //this accesses the translations
const { colors } = useTheme(); // use this to get the theme colors instead of hardcoded #hex colors
const { t } = useTranslation(); // Access translations
const { colors } = useTheme(); // Get theme colors

let rightComponent;
if (iconName) {
rightComponent = <List.Icon icon={iconName} />;
rightComponent = <List.Icon icon={iconName} aria-hidden={true} />;
} else {
rightComponent = <Switch value={switchValue} />;
rightComponent = (
<Switch
value={switchValue}
accessibilityLabel={t(textKey)}
accessibilityHint={switchValue ? t('Currently enabled') : t('Currently disabled')}
/>
);
}
let descriptionText;
if (desc) {
descriptionText = { desc };
descriptionText = desc;
} else {
descriptionText = '';
}
Expand All @@ -32,14 +38,18 @@ const SettingRow = ({
style={styles.item(colors.surface)}
title={t(textKey)}
titleStyle={styles.title}
description={desc}
description={descriptionText}
descriptionStyle={descStyle ? descStyle : styles.description}
descriptionNumberOfLines={4}
accessible={true}
accessibilityLabel={t(textKey)}
accessibilityRole="button"
onPress={(e) => action(e)}
right={() => rightComponent}
/>
);
};

export const styles = StyleSheet.create({
item: (surfaceColor) => ({
justifyContent: 'space-between',
Expand Down
19 changes: 12 additions & 7 deletions www/js/onboarding/WelcomePage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useContext, useState } from 'react';
import React, { useContext, useState, useEffect } from 'react';
import { Trans, useTranslation } from 'react-i18next';
import {
View,
Expand Down Expand Up @@ -100,6 +100,7 @@ const WelcomePage = () => {
<Surface style={[onboardingStyles.page, { paddingVertical: 0 }]}>
<View style={s.headerArea(windowWidth, colors)} aria-hidden={true} />
<IconButton
accessibilityLabel="More info"
icon="information-variant"
shankari marked this conversation as resolved.
Show resolved Hide resolved
containerColor={colors.onPrimary}
iconColor={colors.primary}
Expand All @@ -125,16 +126,20 @@ const WelcomePage = () => {
</View>
<View style={s.buttonsSection}>
<View style={{ width: windowWidth / 2 - 5, paddingHorizontal: 10, gap: 8 }}>
<WelcomePageButton onPress={scanCode} icon="qrcode">
{t('join.scan-code')}
</WelcomePageButton>
<View accessibilityRole="button">
<WelcomePageButton onPress={scanCode} icon="qrcode">
{t('join.scan-code')}
</WelcomePageButton>
</View>
<Text style={{ textAlign: 'center', margin: 'auto' }}>{t('join.scan-hint')}</Text>
</View>
<Divider style={{ width: 2, height: '100%' }} />
<View style={{ width: windowWidth / 2 - 5, paddingHorizontal: 10, gap: 8 }}>
<WelcomePageButton onPress={() => setPasteModalVis(true)} icon="content-paste">
{t('join.paste-code')}
</WelcomePageButton>
<View accessibilityRole="button">
<WelcomePageButton onPress={() => setPasteModalVis(true)} icon="content-paste">
{t('join.paste-code')}
</WelcomePageButton>
</View>
<Text style={{ textAlign: 'center', margin: 'auto' }}>{t('join.paste-hint')}</Text>
</View>
</View>
Expand Down
Loading