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 all 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
19 changes: 10 additions & 9 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 @@ -372,6 +372,7 @@
"paste-code": "Paste code",
"scan-hint": "Scan the barcode with your phone camera",
"paste-hint": "Or, paste the code as text",
"more-info": "More Info",
"about-app-title": "About {{appName}}",
"about-app-para-1": "The National Renewable Energy Laboratory’s Open Platform for Agile Trip Heuristics (NREL OpenPATH) enables people to track their travel modes—car, bus, bike, walking, etc.—and measure their associated energy use and carbon footprint.",
"about-app-para-2": "The app empowers communities to understand their travel mode choices and patterns, experiment with options to make them more sustainable, and evaluate the results. Such results can inform effective transportation policy and planning and be used to build more sustainable and accessible cities.",
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 @@ -26,18 +26,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 @@ -9,6 +9,7 @@ const ToggleSwitch = ({ value, buttons, ...rest }: SegmentedButtonsProps) => {
value={value as any}
buttons={buttons.map((o) => ({
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.tsx
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'}
expanded={expanded}
onPress={handlePress}>
{props.children}
Expand Down
26 changes: 22 additions & 4 deletions www/js/control/ProfileSettings.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
import React, { useState, useEffect, useContext, useRef } from 'react';
import { Modal, StyleSheet, ScrollView } from 'react-native';
import { Dialog, Button, useTheme, Text, Appbar, IconButton, TextInput } from 'react-native-paper';
import {
Dialog,
Button,
useTheme,
Text,
Appbar,
IconButton,
TextInput,
List,
} from 'react-native-paper';
import { useTranslation } from 'react-i18next';
import ExpansionSection from './ExpandMenu';
import SettingRow from './SettingRow';
Expand Down Expand Up @@ -420,10 +429,19 @@ const ProfileSettings = () => {
<Appbar.Header
statusBarHeight={0}
elevated={true}
style={{ height: 46, backgroundColor: colors.surface }}>
style={{ height: 46, backgroundColor: colors.surface }}
accessibilityRole="navigation">
<Appbar.Content title={t('control.profile-tab')} />
<Text>{t('control.log-out')}</Text>
<IconButton icon="logout" onPress={() => setLogoutVis(true)}></IconButton>
<List.Item
style={{ flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-end' }}
title={t('control.log-out')}
titleStyle={{ fontSize: 14, color: 'black', paddingEnd: 5 }}
accessible={true}
accessibilityLabel={t('control.log-out')}
accessibilityRole="button"
onPress={() => setLogoutVis(true)}
right={() => <List.Icon icon="logout" aria-hidden={true} />}
/>
</Appbar.Header>

<ScrollView>
Expand Down
17 changes: 13 additions & 4 deletions www/js/control/SettingRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,20 @@ type Props = {
descStyle?: any;
};
const SettingRow = ({ textKey, iconName, action, desc, switchValue, descStyle }: Props) => {
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} />;
shankari marked this conversation as resolved.
Show resolved Hide resolved
} else {
rightComponent = <Switch value={switchValue} />;
rightComponent = (
<Switch
value={switchValue}
accessibilityLabel={t(textKey as any)}
accessibilityHint={switchValue ? t('Currently enabled') : t('Currently disabled')}
/>
);
}
let descriptionText;
if (desc) {
Expand All @@ -36,6 +42,9 @@ const SettingRow = ({ textKey, iconName, action, desc, switchValue, descStyle }:
description={desc}
descriptionStyle={descStyle ? descStyle : styles.description}
descriptionNumberOfLines={4}
accessible={true}
accessibilityLabel={t(textKey as any)}
accessibilityRole="button"
onPress={(e) => action(e)}
right={() => rightComponent}
/>
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={t('join.more-info')}
icon="information-variant"
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