Skip to content

Commit

Permalink
fix(IT Wallet): [SIW-1595] Fix IT Wallet a11y issues (#6248)
Browse files Browse the repository at this point in the history
## Short description
This PR fixes a11y problems in the eID and credential's issuance flows.

## List of changes proposed in this pull request
- Added a11y value to `BoolClaimItem` component
- Fixed a11y value for `ItwReleaserName` component
- Removed a11y for `ClaimLabel` component
- Removed claim content from a11y value in `ImageClaimItem` component,
which was breaking voiceover functionality

## How to test
With the voiceover enabled, check that all issuance flows are accessible
and voiceover announces the correct data

---------

Co-authored-by: LazyAfternoons <[email protected]>
Co-authored-by: LazyAfternoons <[email protected]>
  • Loading branch information
3 people authored Oct 14, 2024
1 parent bb5d91d commit 464ade9
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 22 deletions.
9 changes: 3 additions & 6 deletions ts/components/AnimatedImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ import Animated, {
withTiming
} from "react-native-reanimated";

export type AnimatedImageProps = Pick<
React.ComponentProps<typeof Image>,
"source" | "style"
>;
export type AnimatedImageProps = React.ComponentProps<typeof Image>;

/**
* AnimatedImage component renders an image with a fade-in animation
Expand All @@ -21,7 +18,7 @@ export type AnimatedImageProps = Pick<
* @param {object} [props.style] - The style to apply to the image.
* @returns {JSX.Element} The rendered AnimatedImage component.
*/
export const AnimatedImage = ({ source, style }: AnimatedImageProps) => {
export const AnimatedImage = ({ style, ...props }: AnimatedImageProps) => {
const opacity = useSharedValue(0);

const handleOnLoad = () => {
Expand All @@ -38,8 +35,8 @@ export const AnimatedImage = ({ source, style }: AnimatedImageProps) => {

return (
<Animated.Image
{...props}
style={[opacityTransition, style]}
source={source}
onLoad={handleOnLoad}
accessibilityIgnoresInvertColors={false}
/>
Expand Down
26 changes: 14 additions & 12 deletions ts/features/itwallet/common/components/ItwCredentialClaim.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,19 @@ const PlaceOfBirthClaimItem = ({
* @param label - the label of the claim
* @param claim - the claim value
*/
const BoolClaimItem = ({ label, claim }: { label: string; claim: boolean }) => (
<ListItemInfo
label={label}
value={I18n.t(
`features.itWallet.presentation.credentialDetails.boolClaim.${claim}`
)}
accessibilityLabel={I18n.t(
`features.itWallet.presentation.credentialDetails.boolClaim.${claim}`
)}
/>
);
const BoolClaimItem = ({ label, claim }: { label: string; claim: boolean }) => {
const value = I18n.t(
`features.itWallet.presentation.credentialDetails.boolClaim.${claim}`
);

return (
<ListItemInfo
label={label}
value={value}
accessibilityLabel={`${label}: ${value}`}
/>
);
};

/**
* Component which renders a generic text type claim.
Expand Down Expand Up @@ -226,7 +228,7 @@ const ImageClaimItem = ({ label, claim }: { label: string; claim: string }) => (
accessibilityIgnoresInvertColors
/>
}
accessibilityLabel={`${label} ${claim}`}
accessibilityLabel={`${label}`}
/>
);

Expand Down
2 changes: 1 addition & 1 deletion ts/features/itwallet/common/components/ItwReleaserName.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const ItwReleaserName = ({ credential, isPreview }: Props) => {
type: "iconButton",
componentProps: {
icon: "info",
accessibilityLabel: "test",
accessibilityLabel: "Info",
onPress: () => releasedByBottomSheet.present()
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ export const ClaimLabel: React.FunctionComponent<
font: "TitilliumSansPro",
fontStyle: { fontSize: fontSize * fontScale, textTransform },
lineBreakMode: "head",
numberOfLines: 1
numberOfLines: 1,
// This text should not be read by the voiceover.
// If you want to make it accessible use the parent components
accessible: false
});
};
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ exports[`CardData should match snapshot for DC front data 1`] = `
}
>
<Text
accessible={false}
allowFontScaling={false}
color="black"
defaultColor="black"
Expand Down Expand Up @@ -157,6 +158,7 @@ exports[`CardData should match snapshot for DC front data 1`] = `
}
>
<Text
accessible={false}
allowFontScaling={false}
color="black"
defaultColor="black"
Expand Down Expand Up @@ -204,6 +206,7 @@ exports[`CardData should match snapshot for DC front data 1`] = `
}
>
<Text
accessible={false}
allowFontScaling={false}
color="black"
defaultColor="black"
Expand Down Expand Up @@ -251,6 +254,7 @@ exports[`CardData should match snapshot for DC front data 1`] = `
}
>
<Text
accessible={false}
allowFontScaling={false}
color="black"
defaultColor="black"
Expand Down Expand Up @@ -298,6 +302,7 @@ exports[`CardData should match snapshot for DC front data 1`] = `
}
>
<Text
accessible={false}
allowFontScaling={false}
color="black"
defaultColor="black"
Expand Down Expand Up @@ -359,6 +364,7 @@ exports[`CardData should match snapshot for MDL back data 1`] = `
}
>
<Text
accessible={false}
allowFontScaling={false}
color="black"
defaultColor="black"
Expand Down Expand Up @@ -406,6 +412,7 @@ exports[`CardData should match snapshot for MDL back data 1`] = `
}
>
<Text
accessible={false}
allowFontScaling={false}
color="black"
defaultColor="black"
Expand Down Expand Up @@ -453,6 +460,7 @@ exports[`CardData should match snapshot for MDL back data 1`] = `
}
>
<Text
accessible={false}
allowFontScaling={false}
color="black"
defaultColor="black"
Expand Down Expand Up @@ -500,6 +508,7 @@ exports[`CardData should match snapshot for MDL back data 1`] = `
}
>
<Text
accessible={false}
allowFontScaling={false}
color="black"
defaultColor="black"
Expand Down Expand Up @@ -547,6 +556,7 @@ exports[`CardData should match snapshot for MDL back data 1`] = `
}
>
<Text
accessible={false}
allowFontScaling={false}
color="black"
defaultColor="black"
Expand Down Expand Up @@ -594,6 +604,7 @@ exports[`CardData should match snapshot for MDL back data 1`] = `
}
>
<Text
accessible={false}
allowFontScaling={false}
color="black"
defaultColor="black"
Expand Down Expand Up @@ -688,6 +699,7 @@ exports[`CardData should match snapshot for MDL front data 1`] = `
}
>
<Text
accessible={false}
allowFontScaling={false}
color="black"
defaultColor="black"
Expand Down Expand Up @@ -735,6 +747,7 @@ exports[`CardData should match snapshot for MDL front data 1`] = `
}
>
<Text
accessible={false}
allowFontScaling={false}
color="black"
defaultColor="black"
Expand Down Expand Up @@ -782,6 +795,7 @@ exports[`CardData should match snapshot for MDL front data 1`] = `
}
>
<Text
accessible={false}
allowFontScaling={false}
color="black"
defaultColor="black"
Expand Down Expand Up @@ -829,6 +843,7 @@ exports[`CardData should match snapshot for MDL front data 1`] = `
}
>
<Text
accessible={false}
allowFontScaling={false}
color="black"
defaultColor="black"
Expand Down Expand Up @@ -876,6 +891,7 @@ exports[`CardData should match snapshot for MDL front data 1`] = `
}
>
<Text
accessible={false}
allowFontScaling={false}
color="black"
defaultColor="black"
Expand Down Expand Up @@ -923,6 +939,7 @@ exports[`CardData should match snapshot for MDL front data 1`] = `
}
>
<Text
accessible={false}
allowFontScaling={false}
color="black"
defaultColor="black"
Expand Down Expand Up @@ -970,6 +987,7 @@ exports[`CardData should match snapshot for MDL front data 1`] = `
}
>
<Text
accessible={false}
allowFontScaling={false}
color="black"
defaultColor="black"
Expand Down Expand Up @@ -1017,6 +1035,7 @@ exports[`CardData should match snapshot for MDL front data 1`] = `
}
>
<Text
accessible={false}
allowFontScaling={false}
color="black"
defaultColor="black"
Expand Down Expand Up @@ -1064,6 +1083,7 @@ exports[`CardData should match snapshot for MDL front data 1`] = `
}
>
<Text
accessible={false}
allowFontScaling={false}
color="black"
defaultColor="black"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1887,7 +1887,7 @@ exports[`ItwPresentationClaimsSection should match the snapshot when claims are
}
>
<View
accessibilityLabel="test"
accessibilityLabel="Info"
accessibilityRole="button"
accessibilityState={
{
Expand Down Expand Up @@ -4386,7 +4386,7 @@ exports[`ItwPresentationClaimsSection should match the snapshot when claims are
}
>
<View
accessibilityLabel="test"
accessibilityLabel="Info"
accessibilityRole="button"
accessibilityState={
{
Expand Down

0 comments on commit 464ade9

Please sign in to comment.