Refine accessibilityHint (#7554)

* `accessibilityHint`

* accessibilityHint

* Update

Co-Authored-By: jason-me <mail@jason-hester.me>

* Update LoginForm.tsx

---------

Co-authored-by: jason-me <mail@jason-hester.me>
This commit is contained in:
Minseo Lee
2025-02-12 06:07:00 +09:00
committed by GitHub
parent eabe3ed231
commit b1cc4a5e9f
28 changed files with 40 additions and 40 deletions
@@ -762,7 +762,7 @@ function SearchInput({
autoComplete="off" autoComplete="off"
autoCapitalize="none" autoCapitalize="none"
accessibilityLabel={_(msg`Search profiles`)} accessibilityLabel={_(msg`Search profiles`)}
accessibilityHint={_(msg`Search profiles`)} accessibilityHint={_(msg`Searches for profiles`)}
/> />
</View> </View>
) )
+1 -1
View File
@@ -112,7 +112,7 @@ export function VideoPostCard({
return ( return (
<Link <Link
accessibilityHint={_(msg`Tap to view video in immersive mode.`)} accessibilityHint={_(msg`Views video in immersive mode`)}
label={_(msg`Video from ${author.handle}: ${text}`)} label={_(msg`Video from ${author.handle}: ${text}`)}
to={{ to={{
screen: 'VideoFeed', screen: 'VideoFeed',
@@ -505,7 +505,7 @@ function SearchInput({
autoCapitalize="none" autoCapitalize="none"
autoFocus autoFocus
accessibilityLabel={_(msg`Search profiles`)} accessibilityLabel={_(msg`Search profiles`)}
accessibilityHint={_(msg`Search profiles`)} accessibilityHint={_(msg`Searches for profiles`)}
/> />
</View> </View>
) )
+2 -2
View File
@@ -47,7 +47,7 @@ export function HostingProvider({
</Text> </Text>
<Button <Button
label={toNiceDomain(serviceUrl)} label={toNiceDomain(serviceUrl)}
accessibilityHint={_(msg`Press to change hosting provider`)} accessibilityHint={_(msg`Changes hosting provider`)}
onPress={onPressSelectService} onPress={onPressSelectService}
variant="ghost" variant="ghost"
color="secondary" color="secondary"
@@ -63,7 +63,7 @@ export function HostingProvider({
<Button <Button
testID="selectServiceButton" testID="selectServiceButton"
label={toNiceDomain(serviceUrl)} label={toNiceDomain(serviceUrl)}
accessibilityHint={_(msg`Press to change hosting provider`)} accessibilityHint={_(msg`Changes hosting provider`)}
variant="solid" variant="solid"
color="secondary" color="secondary"
style={[ style={[
+3 -3
View File
@@ -146,10 +146,10 @@ function ContentHiderActive({
label={desc.name} label={desc.name}
accessibilityHint={ accessibilityHint={
modui.noOverride modui.noOverride
? _(msg`Learn more about the moderation applied to this content.`) ? _(msg`Learn more about the moderation applied to this content`)
: override : override
? _(msg`Hide the content`) ? _(msg`Hides the content`)
: _(msg`Show the content`) : _(msg`Shows the content`)
}> }>
{state => ( {state => (
<View <View
+1 -1
View File
@@ -76,7 +76,7 @@ export function PostHider({
}} }}
accessibilityRole="button" accessibilityRole="button"
accessibilityHint={ accessibilityHint={
override ? _(msg`Hide the content`) : _(msg`Show the content`) override ? _(msg`Hides the content`) : _(msg`Shows the content`)
} }
accessibilityLabel="" accessibilityLabel=""
style={[ style={[
+1 -1
View File
@@ -232,7 +232,7 @@ export const LoginForm = ({
onSubmitEditing={onPressNext} onSubmitEditing={onPressNext}
blurOnSubmit={false} // HACK: https://github.com/facebook/react-native/issues/21911#issuecomment-558343069 Keyboard blur behavior is now handled in onSubmitEditing blurOnSubmit={false} // HACK: https://github.com/facebook/react-native/issues/21911#issuecomment-558343069 Keyboard blur behavior is now handled in onSubmitEditing
editable={!isProcessing} editable={!isProcessing}
accessibilityHint={_(msg`Input your password`)} accessibilityHint={_(msg`Enter your password`)}
/> />
<Button <Button
testID="forgotPasswordButton" testID="forgotPasswordButton"
@@ -281,7 +281,7 @@ function ChatListItemReady({
!isDeletedAccount !isDeletedAccount
? _(msg`Go to conversation with ${profile.handle}`) ? _(msg`Go to conversation with ${profile.handle}`)
: _( : _(
msg`This conversation is with a deleted or a deactivated account. Press for options.`, msg`This conversation is with a deleted or a deactivated account. Press for options`,
) )
} }
accessibilityActions={ accessibilityActions={
+1 -3
View File
@@ -53,9 +53,7 @@ export function Layout({children}: React.PropsWithChildren<{}>) {
aria-role="dialog" aria-role="dialog"
aria-label={dialogLabel} aria-label={dialogLabel}
accessibilityLabel={dialogLabel} accessibilityLabel={dialogLabel}
accessibilityHint={_( accessibilityHint={_(msg`Customizes your Bluesky experience`)}
msg`The following steps will help customize your Bluesky experience.`,
)}
style={[ style={[
// @ts-ignore web only -prf // @ts-ignore web only -prf
isWeb ? a.fixed : a.absolute, isWeb ? a.fixed : a.absolute,
+1 -1
View File
@@ -60,7 +60,7 @@ export function ErrorState({error}: {error: string}) {
color="secondary" color="secondary"
variant="solid" variant="solid"
label={_(msg`Go Back`)} label={_(msg`Go Back`)}
accessibilityHint="Return to previous page" accessibilityHint="Returns to previous page"
onPress={onPressBack}> onPress={onPressBack}>
<ButtonText> <ButtonText>
<Trans>Go Back</Trans> <Trans>Go Back</Trans>
+1 -1
View File
@@ -65,7 +65,7 @@ export function AboutSettingsScreen({}: Props) {
</SettingsList.LinkItem> </SettingsList.LinkItem>
<SettingsList.PressableItem <SettingsList.PressableItem
label={_(msg`Version ${appVersion}`)} label={_(msg`Version ${appVersion}`)}
accessibilityHint={_(msg`Copy build version to clipboard`)} accessibilityHint={_(msg`Copies build version to clipboard`)}
onPress={() => { onPress={() => {
setStringAsync( setStringAsync(
`Build version: ${appVersion}; Bundle info: ${bundleInfo}; Bundle date: ${BUNDLE_DATE}; Platform: ${Platform.OS}; Platform version: ${Platform.Version}`, `Build version: ${appVersion}; Bundle info: ${bundleInfo}; Bundle date: ${BUNDLE_DATE}; Platform: ${Platform.OS}; Platform version: ${Platform.Version}`,
+1 -1
View File
@@ -124,7 +124,7 @@ export function AccountSettingsScreen({}: Props) {
</SettingsList.PressableItem> </SettingsList.PressableItem>
<SettingsList.PressableItem <SettingsList.PressableItem
label={_(msg`Handle`)} label={_(msg`Handle`)}
accessibilityHint={_(msg`Open change handle dialog`)} accessibilityHint={_(msg`Opens change handle dialog`)}
onPress={() => changeHandleControl.open()}> onPress={() => changeHandleControl.open()}>
<SettingsList.ItemIcon icon={AtIcon} /> <SettingsList.ItemIcon icon={AtIcon} />
<SettingsList.ItemText> <SettingsList.ItemText>
@@ -213,7 +213,7 @@ function AppIcon({icon, size = 50}: {icon: AppIconSet; size: number}) {
return ( return (
<PressableScale <PressableScale
accessibilityLabel={icon.name} accessibilityLabel={icon.name}
accessibilityHint={_(msg`Tap to change app icon`)} accessibilityHint={_(msg`Changes app icon`)}
targetScale={0.95} targetScale={0.95}
onPress={() => { onPress={() => {
if (isAndroid) { if (isAndroid) {
+2 -2
View File
@@ -101,7 +101,7 @@ export function SettingsScreen({}: Props) {
<SettingsList.PressableItem <SettingsList.PressableItem
label={_(msg`Switch account`)} label={_(msg`Switch account`)}
accessibilityHint={_( accessibilityHint={_(
msg`Show other accounts you can switch to`, msg`Shows other accounts you can switch to`,
)} )}
onPress={() => { onPress={() => {
if (!reducedMotion) { if (!reducedMotion) {
@@ -205,7 +205,7 @@ export function SettingsScreen({}: Props) {
<SettingsList.PressableItem <SettingsList.PressableItem
onPress={() => Linking.openURL(HELP_DESK_URL)} onPress={() => Linking.openURL(HELP_DESK_URL)}
label={_(msg`Help`)} label={_(msg`Help`)}
accessibilityHint={_(msg`Open helpdesk in browser`)}> accessibilityHint={_(msg`Opens helpdesk in browser`)}>
<SettingsList.ItemIcon icon={CircleQuestionIcon} /> <SettingsList.ItemIcon icon={CircleQuestionIcon} />
<SettingsList.ItemText> <SettingsList.ItemText>
<Trans>Help</Trans> <Trans>Help</Trans>
@@ -537,7 +537,7 @@ function OwnHandlePage({goToServiceHandle}: {goToServiceHandle: () => void}) {
<Button <Button
label={_(msg`Use default provider`)} label={_(msg`Use default provider`)}
accessibilityHint={_(msg`Go back to previous page`)} accessibilityHint={_(msg`Returns to previous page`)}
onPress={goToServiceHandle} onPress={goToServiceHandle}
variant="outline" variant="outline"
color="secondary" color="secondary"
+1 -1
View File
@@ -284,7 +284,7 @@ function WizardInner({
<Layout.Header.Outer> <Layout.Header.Outer>
<Layout.Header.BackButton <Layout.Header.BackButton
label={_(msg`Back`)} label={_(msg`Back`)}
accessibilityHint={_(msg`Go back to the previous step`)} accessibilityHint={_(msg`Returns to the previous step`)}
onPress={evt => { onPress={evt => {
if (state.currentStep !== 'Details') { if (state.currentStep !== 'Details') {
evt.preventDefault() evt.preventDefault()
+2 -2
View File
@@ -800,7 +800,7 @@ function Overlay({
: _(msg`Follow ${handle}`) : _(msg`Follow ${handle}`)
} }
accessibilityHint={ accessibilityHint={
profile.viewer?.following ? _(msg`Unfollow user`) : '' profile.viewer?.following ? _(msg`Unfollows the user`) : ''
} }
size="small" size="small"
variant="solid" variant="solid"
@@ -930,7 +930,7 @@ function ExpandableRichTextView({
/> />
{constrained && !screenReaderEnabled && ( {constrained && !screenReaderEnabled && (
<Pressable <Pressable
accessibilityHint={_(msg`Tap to expand or collapse post text.`)} accessibilityHint={_(msg`Expands or collapses post text`)}
accessibilityLabel={expanded ? _(msg`Read less`) : _(msg`Read more`)} accessibilityLabel={expanded ? _(msg`Read less`) : _(msg`Read more`)}
hitSlop={HITSLOP_20} hitSlop={HITSLOP_20}
onPress={() => setExpanded(prev => !prev)} onPress={() => setExpanded(prev => !prev)}
+1 -1
View File
@@ -1241,7 +1241,7 @@ function ComposerFooter({
onPress={onEmojiButtonPress} onPress={onEmojiButtonPress}
style={a.p_sm} style={a.p_sm}
label={_(msg`Open emoji picker`)} label={_(msg`Open emoji picker`)}
accessibilityHint={_(msg`Open emoji picker`)} accessibilityHint={_(msg`Opens emoji picker`)}
variant="ghost" variant="ghost"
shape="round" shape="round"
color="primary"> color="primary">
+1 -1
View File
@@ -70,7 +70,7 @@ export function ComposerReplyTo({replyTo}: {replyTo: ComposerOptsPostRef}) {
msg`Expand or collapse the full post you are replying to`, msg`Expand or collapse the full post you are replying to`,
)} )}
accessibilityHint={_( accessibilityHint={_(
msg`Expand or collapse the full post you are replying to`, msg`Expands or collapses the full post you are replying to`,
)}> )}>
<PreviewableUserAvatar <PreviewableUserAvatar
size={50} size={50}
@@ -135,7 +135,7 @@ export function EmojiPicker({state, close, pinToTop}: IProps) {
<Pressable <Pressable
accessible accessible
accessibilityLabel={_(msg`Close emoji picker`)} accessibilityLabel={_(msg`Close emoji picker`)}
accessibilityHint={_(msg`Tap to close the emoji picker`)} accessibilityHint={_(msg`Closes the emoji picker`)}
onPress={close} onPress={close}
style={[a.fixed, a.inset_0]} style={[a.fixed, a.inset_0]}
/> />
@@ -171,7 +171,7 @@ export function EmojiPicker({state, close, pinToTop}: IProps) {
<Pressable <Pressable
accessible accessible
accessibilityLabel={_(msg`Close emoji picker`)} accessibilityLabel={_(msg`Close emoji picker`)}
accessibilityHint={_(msg`Tap to close the emoji picker`)} accessibilityHint={_(msg`Closes the emoji picker`)}
onPress={close} onPress={close}
style={[a.fixed, a.inset_0]} style={[a.fixed, a.inset_0]}
/> />
+1 -1
View File
@@ -802,7 +802,7 @@ function BackdatedPostIndicator({post}: {post: AppBskyFeedDefs.PostView}) {
<Button <Button
label={_(msg`Archived post`)} label={_(msg`Archived post`)}
accessibilityHint={_( accessibilityHint={_(
msg`Show information about when this post was created`, msg`Shows information about when this post was created`,
)} )}
onPress={e => { onPress={e => {
e.preventDefault() e.preventDefault()
+3 -1
View File
@@ -293,7 +293,9 @@ const DropdownItems = ({
onPress={() => onPressItem(index)} onPress={() => onPressItem(index)}
accessibilityRole="button" accessibilityRole="button"
accessibilityLabel={item.label} accessibilityLabel={item.label}
accessibilityHint={_(msg`Option ${index + 1} of ${numItems}`)}> accessibilityHint={_(
msg`Selects option ${index + 1} of ${numItems}`,
)}>
{item.icon && ( {item.icon && (
<FontAwesomeIcon <FontAwesomeIcon
style={styles.icon} style={styles.icon}
+2 -2
View File
@@ -196,7 +196,7 @@ export function AutoSizedImage({
onPressIn={onPressIn} onPressIn={onPressIn}
// alt here is what screen readers actually use // alt here is what screen readers actually use
accessibilityLabel={image.alt} accessibilityLabel={image.alt}
accessibilityHint={_(msg`Tap to view full image`)} accessibilityHint={_(msg`Views full image`)}
style={[ style={[
a.w_full, a.w_full,
a.rounded_md, a.rounded_md,
@@ -218,7 +218,7 @@ export function AutoSizedImage({
onPressIn={onPressIn} onPressIn={onPressIn}
// alt here is what screen readers actually use // alt here is what screen readers actually use
accessibilityLabel={image.alt} accessibilityLabel={image.alt}
accessibilityHint={_(msg`Tap to view full image`)} accessibilityHint={_(msg`Views full image`)}
style={[a.h_full]}> style={[a.h_full]}>
{contents} {contents}
</Pressable> </Pressable>
@@ -56,7 +56,7 @@ function PlaceholderOverlay({
<Pressable <Pressable
accessibilityRole="button" accessibilityRole="button"
accessibilityLabel={_(msg`Play Video`)} accessibilityLabel={_(msg`Play Video`)}
accessibilityHint={_(msg`Play Video`)} accessibilityHint={_(msg`Plays the video`)}
onPress={onPress} onPress={onPress}
style={[styles.overlayContainer]}> style={[styles.overlayContainer]}>
{!isPlayerActive ? ( {!isPlayerActive ? (
+1 -1
View File
@@ -39,7 +39,7 @@ function PlaybackControls({
return ( return (
<Pressable <Pressable
accessibilityRole="button" accessibilityRole="button"
accessibilityHint={_(msg`Play or pause the GIF`)} accessibilityHint={_(msg`Plays or pauses the GIF`)}
accessibilityLabel={isPlaying ? _(msg`Pause`) : _(msg`Play`)} accessibilityLabel={isPlaying ? _(msg`Pause`) : _(msg`Play`)}
style={[ style={[
a.absolute, a.absolute,
@@ -132,13 +132,13 @@ function VideoControls({
onPress={enterFullscreen} onPress={enterFullscreen}
style={a.flex_1} style={a.flex_1}
accessibilityLabel={_(msg`Video`)} accessibilityLabel={_(msg`Video`)}
accessibilityHint={_(msg`Tap to enter full screen`)} accessibilityHint={_(msg`Enters full screen`)}
accessibilityRole="button" accessibilityRole="button"
/> />
<ControlButton <ControlButton
onPress={togglePlayback} onPress={togglePlayback}
label={isPlaying ? _(msg`Pause`) : _(msg`Play`)} label={isPlaying ? _(msg`Pause`) : _(msg`Play`)}
accessibilityHint={_(msg`Tap to play or pause`)} accessibilityHint={_(msg`Plays or pauses the video`)}
style={{left: 6}}> style={{left: 6}}>
{isPlaying ? ( {isPlaying ? (
<PauseIcon width={13} fill={t.palette.white} /> <PauseIcon width={13} fill={t.palette.white} />
@@ -155,7 +155,7 @@ function VideoControls({
? _(msg({message: `Unmute`, context: 'video'})) ? _(msg({message: `Unmute`, context: 'video'}))
: _(msg({message: `Mute`, context: 'video'})) : _(msg({message: `Mute`, context: 'video'}))
} }
accessibilityHint={_(msg`Tap to toggle sound`)} accessibilityHint={_(msg`Toggles the sound`)}
style={{right: 6}}> style={{right: 6}}>
{muted ? ( {muted ? (
<MuteIcon width={13} fill={t.palette.white} /> <MuteIcon width={13} fill={t.palette.white} />
+1 -1
View File
@@ -1007,7 +1007,7 @@ function ErrorScreen({error}: {error: string}) {
<Button <Button
type="default" type="default"
accessibilityLabel={_(msg`Go back`)} accessibilityLabel={_(msg`Go back`)}
accessibilityHint={_(msg`Return to previous page`)} accessibilityHint={_(msg`Returns to previous page`)}
onPress={onPressBack} onPress={onPressBack}
style={{flexShrink: 1}}> style={{flexShrink: 1}}>
<Text type="button" style={pal.text}> <Text type="button" style={pal.text}>
+2 -2
View File
@@ -807,7 +807,7 @@ export function SearchScreen(
hitSlop={HITSLOP_10} hitSlop={HITSLOP_10}
label={_(msg`Menu`)} label={_(msg`Menu`)}
accessibilityHint={_( accessibilityHint={_(
msg`Access navigation links and settings`, msg`Provides access to navigation links and settings`,
)} )}
size="large" size="large"
variant="solid" variant="solid"
@@ -1033,7 +1033,7 @@ function SearchHistory({
accessibilityRole="button" accessibilityRole="button"
accessibilityLabel={_(msg`Remove profile`)} accessibilityLabel={_(msg`Remove profile`)}
accessibilityHint={_( accessibilityHint={_(
msg`Remove profile from search history`, msg`Removes profile from search history`,
)} )}
onPress={() => onRemoveProfileClick(profile)} onPress={() => onRemoveProfileClick(profile)}
hitSlop={createHitslop(6)} hitSlop={createHitslop(6)}