diff options
-rw-r--r-- | src/view/com/auth/create/CreateAccount.tsx | 8 | ||||
-rw-r--r-- | src/view/com/auth/login/Login.tsx | 24 | ||||
-rw-r--r-- | src/view/com/lightbox/Lightbox.web.tsx | 8 | ||||
-rw-r--r-- | src/view/com/post-thread/PostThread.tsx | 8 | ||||
-rw-r--r-- | src/view/com/profile/ProfileHeader.tsx | 6 | ||||
-rw-r--r-- | src/view/com/search/HeaderWithInput.tsx | 7 | ||||
-rw-r--r-- | src/view/com/util/ViewHeader.tsx | 8 | ||||
-rw-r--r-- | src/view/screens/Home.tsx | 4 | ||||
-rw-r--r-- | src/view/shell/Drawer.tsx | 18 | ||||
-rw-r--r-- | src/view/shell/bottom-bar/BottomBar.tsx | 21 | ||||
-rw-r--r-- | src/view/shell/desktop/LeftNav.tsx | 9 | ||||
-rw-r--r-- | src/view/shell/desktop/Search.tsx | 2 |
12 files changed, 56 insertions, 67 deletions
diff --git a/src/view/com/auth/create/CreateAccount.tsx b/src/view/com/auth/create/CreateAccount.tsx index ac03081df..26bf03386 100644 --- a/src/view/com/auth/create/CreateAccount.tsx +++ b/src/view/com/auth/create/CreateAccount.tsx @@ -75,9 +75,7 @@ export const CreateAccount = observer( <TouchableOpacity onPress={onPressBackInner} testID="backBtn" - accessibilityRole="button" - accessibilityLabel="Go back" - accessibilityHint="Navigates to the previous screen"> + accessibilityRole="button"> <Text type="xl" style={pal.link}> Back </Text> @@ -87,9 +85,7 @@ export const CreateAccount = observer( <TouchableOpacity testID="nextBtn" onPress={onPressNext} - accessibilityRole="button" - accessibilityLabel="Go to next" - accessibilityHint="Navigates to the next screen"> + accessibilityRole="button"> {model.isProcessing ? ( <ActivityIndicator /> ) : ( diff --git a/src/view/com/auth/login/Login.tsx b/src/view/com/auth/login/Login.tsx index cec08192c..87512287b 100644 --- a/src/view/com/auth/login/Login.tsx +++ b/src/view/com/auth/login/Login.tsx @@ -241,11 +241,7 @@ const ChooseAccountForm = ({ </View> </TouchableOpacity> <View style={[s.flexRow, s.alignCenter, s.pl20, s.pr20]}> - <TouchableOpacity - onPress={onPressBack} - accessibilityRole="button" - accessibilityLabel="Go back" - accessibilityHint="Navigates to the previous screen"> + <TouchableOpacity onPress={onPressBack} accessibilityRole="button"> <Text type="xl" style={[pal.link, s.pl5]}> Back </Text> @@ -454,11 +450,7 @@ const LoginForm = ({ </View> ) : undefined} <View style={[s.flexRow, s.alignCenter, s.pl20, s.pr20]}> - <TouchableOpacity - onPress={onPressBack} - accessibilityRole="button" - accessibilityLabel="Go back" - accessibilityHint="Navigates to the previous screen"> + <TouchableOpacity onPress={onPressBack} accessibilityRole="button"> <Text type="xl" style={[pal.link, s.pl5]}> Back </Text> @@ -632,11 +624,7 @@ const ForgotPasswordForm = ({ </View> ) : undefined} <View style={[s.flexRow, s.alignCenter, s.pl20, s.pr20]}> - <TouchableOpacity - onPress={onPressBack} - accessibilityRole="button" - accessibilityLabel="Go back" - accessibilityHint="Navigates to the previous screen"> + <TouchableOpacity onPress={onPressBack} accessibilityRole="button"> <Text type="xl" style={[pal.link, s.pl5]}> Back </Text> @@ -794,11 +782,7 @@ const SetNewPasswordForm = ({ </View> ) : undefined} <View style={[s.flexRow, s.alignCenter, s.pl20, s.pr20]}> - <TouchableOpacity - onPress={onPressBack} - accessibilityRole="button" - accessibilityLabel="Go back" - accessibilityHint="Navigates to the previous screen"> + <TouchableOpacity onPress={onPressBack} accessibilityRole="button"> <Text type="xl" style={[pal.link, s.pl5]}> Back </Text> diff --git a/src/view/com/lightbox/Lightbox.web.tsx b/src/view/com/lightbox/Lightbox.web.tsx index 1d4a9c215..3388b54b2 100644 --- a/src/view/com/lightbox/Lightbox.web.tsx +++ b/src/view/com/lightbox/Lightbox.web.tsx @@ -106,8 +106,8 @@ function LightboxInner({ onPress={onPressLeft} style={[styles.btn, styles.leftBtn]} accessibilityRole="button" - accessibilityLabel="Go back" - accessibilityHint="Navigates to previous image in viewer"> + accessibilityLabel="Previous image" + accessibilityHint=""> <FontAwesomeIcon icon="angle-left" style={styles.icon} @@ -120,8 +120,8 @@ function LightboxInner({ onPress={onPressRight} style={[styles.btn, styles.rightBtn]} accessibilityRole="button" - accessibilityLabel="Go to next" - accessibilityHint="Navigates to next image in viewer"> + accessibilityLabel="Next image" + accessibilityHint=""> <FontAwesomeIcon icon="angle-right" style={styles.icon} diff --git a/src/view/com/post-thread/PostThread.tsx b/src/view/com/post-thread/PostThread.tsx index b886e61e8..b3da0b01b 100644 --- a/src/view/com/post-thread/PostThread.tsx +++ b/src/view/com/post-thread/PostThread.tsx @@ -183,8 +183,8 @@ export const PostThread = observer(function PostThread({ <TouchableOpacity onPress={onPressBack} accessibilityRole="button" - accessibilityLabel="Go back" - accessibilityHint="Navigates to the previous screen"> + accessibilityLabel="Back" + accessibilityHint=""> <Text type="2xl" style={pal.link}> <FontAwesomeIcon icon="angle-left" @@ -217,8 +217,8 @@ export const PostThread = observer(function PostThread({ <TouchableOpacity onPress={onPressBack} accessibilityRole="button" - accessibilityLabel="Go back" - accessibilityHint="Navigates to the previous screen"> + accessibilityLabel="Back" + accessibilityHint=""> <Text type="2xl" style={pal.link}> <FontAwesomeIcon icon="angle-left" diff --git a/src/view/com/profile/ProfileHeader.tsx b/src/view/com/profile/ProfileHeader.tsx index 10f648e3d..d3945ea2a 100644 --- a/src/view/com/profile/ProfileHeader.tsx +++ b/src/view/com/profile/ProfileHeader.tsx @@ -458,8 +458,8 @@ const ProfileHeaderLoaded = observer( onPress={onPressBack} hitSlop={BACK_HITSLOP} accessibilityRole="button" - accessibilityLabel="Go back" - accessibilityHint="Navigates to the previous screen"> + accessibilityLabel="Back" + accessibilityHint=""> <View style={styles.backBtnWrapper}> <BlurView style={styles.backBtn} blurType="dark"> <FontAwesomeIcon size={18} icon="angle-left" style={s.white} /> @@ -472,7 +472,7 @@ const ProfileHeaderLoaded = observer( onPress={onPressAvi} accessibilityRole="image" accessibilityLabel={`View ${view.handle}'s avatar`} - accessibilityHint={`Opens ${view.handle}'s avatar in an image viewer`}> + accessibilityHint=""> <View style={[ pal.view, diff --git a/src/view/com/search/HeaderWithInput.tsx b/src/view/com/search/HeaderWithInput.tsx index bd92e974a..7a9e0cc62 100644 --- a/src/view/com/search/HeaderWithInput.tsx +++ b/src/view/com/search/HeaderWithInput.tsx @@ -55,8 +55,9 @@ export function HeaderWithInput({ onPress={onPressMenu} hitSlop={MENU_HITSLOP} style={styles.headerMenuBtn} - accessibilityLabel="Go back" - accessibilityHint="Navigates to the previous screen"> + accessibilityRole="button" + accessibilityLabel="Back" + accessibilityHint=""> <UserAvatar size={30} avatar={store.me.avatar} /> </TouchableOpacity> <View @@ -84,6 +85,8 @@ export function HeaderWithInput({ onSubmitEditing={onSubmitQuery} autoFocus={true} accessibilityRole="search" + accessibilityLabel="Search" + accessibilityHint="" /> {query ? ( <TouchableOpacity diff --git a/src/view/com/util/ViewHeader.tsx b/src/view/com/util/ViewHeader.tsx index 9c85cfa24..7f5b5b7c2 100644 --- a/src/view/com/util/ViewHeader.tsx +++ b/src/view/com/util/ViewHeader.tsx @@ -62,12 +62,8 @@ export const ViewHeader = observer(function ({ hitSlop={BACK_HITSLOP} style={canGoBack ? styles.backBtn : styles.backBtnWide} accessibilityRole="button" - accessibilityLabel={canGoBack ? 'Go back' : 'Go to menu'} - accessibilityHint={ - canGoBack - ? 'Navigates to the previous screen' - : 'Navigates to the menu' - }> + accessibilityLabel={canGoBack ? 'Back' : 'Menu'} + accessibilityHint=""> {canGoBack ? ( <FontAwesomeIcon size={18} diff --git a/src/view/screens/Home.tsx b/src/view/screens/Home.tsx index 2b102ae31..18e4f2506 100644 --- a/src/view/screens/Home.tsx +++ b/src/view/screens/Home.tsx @@ -245,8 +245,8 @@ const FeedPage = observer( onPress={onPressCompose} icon={<ComposeIcon2 strokeWidth={1.5} size={29} style={s.white} />} accessibilityRole="button" - accessibilityLabel="Compose" - accessibilityHint="Opens post composer" + accessibilityLabel="Compose post" + accessibilityHint="" /> </View> ) diff --git a/src/view/shell/Drawer.tsx b/src/view/shell/Drawer.tsx index 404374b95..1b8983e83 100644 --- a/src/view/shell/Drawer.tsx +++ b/src/view/shell/Drawer.tsx @@ -171,7 +171,7 @@ export const DrawerContent = observer(() => { } label="Search" accessibilityLabel="Search" - accessibilityHint="Search through users and posts" + accessibilityHint="" bold={isAtSearch} onPress={onPressSearch} /> @@ -193,7 +193,7 @@ export const DrawerContent = observer(() => { } label="Home" accessibilityLabel="Home" - accessibilityHint="Navigates to default feed" + accessibilityHint="" bold={isAtHome} onPress={onPressHome} /> @@ -214,12 +214,8 @@ export const DrawerContent = observer(() => { ) } label="Notifications" - accessibilityLabel={ - notifications.unreadCountLabel === '1' - ? 'Notifications: 1 unread notification' - : `Notifications: ${notifications.unreadCountLabel} unread notifications` - } - accessibilityHint="Opens notification feed" + accessibilityLabel="Notifications" + accessibilityHint={`${store.me.notifications.unreadCountLabel} unread`} count={notifications.unreadCountLabel} bold={isAtNotifications} onPress={onPressNotifications} @@ -242,7 +238,7 @@ export const DrawerContent = observer(() => { } label="Profile" accessibilityLabel="Profile" - accessibilityHint="See profile display name, avatar, description, and other profile items" + accessibilityHint="" onPress={onPressProfile} /> <MenuItem @@ -255,7 +251,7 @@ export const DrawerContent = observer(() => { } label="Settings" accessibilityLabel="Settings" - accessibilityHint="Manage settings for your account, like handle, content moderation, and app passwords" + accessibilityHint="" onPress={onPressSettings} /> </View> @@ -332,7 +328,7 @@ function MenuItem({ testID={`menuItemButton-${label}`} style={styles.menuItem} onPress={onPress} - accessibilityRole="menuitem" + accessibilityRole="tab" accessibilityLabel={accessibilityLabel} accessibilityHint=""> <View style={[styles.menuItemIconWrapper]}> diff --git a/src/view/shell/bottom-bar/BottomBar.tsx b/src/view/shell/bottom-bar/BottomBar.tsx index b32072d5a..c11a0128c 100644 --- a/src/view/shell/bottom-bar/BottomBar.tsx +++ b/src/view/shell/bottom-bar/BottomBar.tsx @@ -94,8 +94,9 @@ export const BottomBar = observer(({navigation}: BottomTabBarProps) => { ) } onPress={onPressHome} - accessibilityLabel="Go home" - accessibilityHint="Navigates to feed home" + accessibilityRole="tab" + accessibilityLabel="Home" + accessibilityHint="" /> <Btn testID="bottomBarSearchBtn" @@ -116,6 +117,8 @@ export const BottomBar = observer(({navigation}: BottomTabBarProps) => { } onPress={onPressSearch} accessibilityRole="search" + accessibilityLabel="Search" + accessibilityHint="" /> <Btn testID="bottomBarNotificationsBtn" @@ -136,8 +139,10 @@ export const BottomBar = observer(({navigation}: BottomTabBarProps) => { } onPress={onPressNotifications} notificationCount={store.me.notifications.unreadCountLabel} + accessible={true} + accessibilityRole="tab" accessibilityLabel="Notifications" - accessibilityHint="Navigates to notifications" + accessibilityHint={`${store.me.notifications.unreadCountLabel} unread`} /> <Btn testID="bottomBarProfileBtn" @@ -159,8 +164,9 @@ export const BottomBar = observer(({navigation}: BottomTabBarProps) => { </View> } onPress={onPressProfile} + accessibilityRole="tab" accessibilityLabel="Profile" - accessibilityHint="Navigates to profile" + accessibilityHint="" /> </Animated.View> ) @@ -169,7 +175,10 @@ export const BottomBar = observer(({navigation}: BottomTabBarProps) => { interface BtnProps extends Pick< ComponentProps<typeof TouchableOpacity>, - 'accessibilityRole' | 'accessibilityHint' | 'accessibilityLabel' + | 'accessible' + | 'accessibilityRole' + | 'accessibilityHint' + | 'accessibilityLabel' > { testID?: string icon: JSX.Element @@ -184,6 +193,7 @@ function Btn({ notificationCount, onPress, onLongPress, + accessible, accessibilityHint, accessibilityLabel, }: BtnProps) { @@ -194,6 +204,7 @@ function Btn({ onPress={onLongPress ? onPress : undefined} onPressIn={onLongPress ? undefined : onPress} onLongPress={onLongPress} + accessible={accessible} accessibilityLabel={accessibilityLabel} accessibilityHint={accessibilityHint}> {notificationCount ? ( diff --git a/src/view/shell/desktop/LeftNav.tsx b/src/view/shell/desktop/LeftNav.tsx index 86f1a3ef3..17d078dc5 100644 --- a/src/view/shell/desktop/LeftNav.tsx +++ b/src/view/shell/desktop/LeftNav.tsx @@ -66,7 +66,7 @@ function BackBtn() { style={styles.backBtn} accessibilityRole="button" accessibilityLabel="Go back" - accessibilityHint="Navigates to the previous screen"> + accessibilityHint=""> <FontAwesomeIcon size={24} icon="angle-left" @@ -102,8 +102,9 @@ const NavItem = observer( style={styles.navItemWrapper} hoverStyle={pal.viewLight} onPress={onPress} + accessibilityRole="tab" accessibilityLabel={label} - accessibilityHint={`Navigates to ${label}`}> + accessibilityHint=""> <View style={[styles.navItemIconWrapper]}> {isCurrent ? iconFilled : icon} {typeof count === 'string' && count ? ( @@ -129,8 +130,8 @@ function ComposeBtn() { style={[styles.newPostBtn]} onPress={onPressCompose} accessibilityRole="button" - accessibilityLabel="New post" - accessibilityHint="Opens post composer"> + accessibilityLabel="Compose post" + accessibilityHint=""> <View style={styles.newPostBtnIconWrapper}> <ComposeIcon2 size={19} diff --git a/src/view/shell/desktop/Search.tsx b/src/view/shell/desktop/Search.tsx index a58a68fbf..c7b322b58 100644 --- a/src/view/shell/desktop/Search.tsx +++ b/src/view/shell/desktop/Search.tsx @@ -68,6 +68,8 @@ export const DesktopSearch = observer(function DesktopSearch() { onChangeText={onChangeQuery} onSubmitEditing={onSubmit} accessibilityRole="search" + accessibilityLabel="Search" + accessibilityHint="" /> {query ? ( <View style={styles.cancelBtn}> |