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

chore: better a11y for onboarding; #3584

Merged
merged 35 commits into from
Oct 1, 2024
Merged

chore: better a11y for onboarding; #3584

merged 35 commits into from
Oct 1, 2024

Conversation

ilasw
Copy link
Contributor

@ilasw ilasw commented Sep 25, 2024

Changes

  • Change on form inputs to make sure that can accept accessibility props;
  • Updated Onboarding removing for screen readers presentational elements and adding label for a good navigation;
  • Autofocus the first access point for inputs.

I added autofocus attribute into form fields, but we should test how it behaves for users. Scared that the browser will scroll down bringing the input inside the viewport.

Events

Did you introduce any new tracking events?

Experiment

Did you introduce any new experiments?

Manual Testing

Caution

Please make sure existing components are not breaking/affected by this PR

Preview domain

https://fix-onboarding-accessibility.preview.app.daily.dev

Copy link

vercel bot commented Sep 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
daily-webapp ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 1, 2024 2:17pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
storybook ⬜️ Ignored (Inspect) Oct 1, 2024 2:17pm

@@ -101,13 +101,15 @@ function ProfilePictureComponent(
return null;
}

const imageAlt = `${user.username || user.name || user.id}'s profile`;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alt for those kind of images was "Undedined's profile picture"

Comment on lines +28 to +30
<h2 {...attrs} className="text-center font-bold typo-title2">
{title}
</h2>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Need to pass id for aria-labelledby

@@ -73,7 +73,7 @@ export const AuthSignBack = ({
<ConditionalWrapper
condition={provider !== 'password'}
wrapper={(component) => (
<div className="relative">
<div className="relative" aria-hidden>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Onboarding's profile image is not a required information on screen reader, maybe is better to skip just to the login button since image cannot be seen in those cases.

Comment on lines +37 to +41
<ArrowIcon
aria-hidden
className="rotate-90"
role="presentation"
/>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This kind of icons that are only presentational and gives no utility to the screen reader user are better to be not present in their navigation

Copy link
Contributor

Choose a reason for hiding this comment

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

not urgent, but we should probably add some config to Icon component maybe to make it easier.

@@ -52,6 +52,7 @@ function LoginForm({

return (
<AuthForm
aria-label="Login using email and password"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Made this to give a name to the form, this should be mandatory but, as a general optimization, we can also make it point with aria-labelledby to the form title if we are 100% sure to have one

className={classNames(
'flex items-center justify-center text-text-quaternary typo-callout',
className,
)}
role="separator"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think that "or" need to be read, but open to discussion

Comment on lines +24 to +26
aria-label={`Continue as ${
signBack.name || signBack.email
} from ${provider}`}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

trying to give more context to the user

<a href={`${webappUrl}users`}>Leaderboard</a>
</li>
</ul>
<footer>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Those links are always in the end of the page, footer is a better tag element imo

@@ -846,7 +846,7 @@ describe('Feed', () => {
const title = await screen.findByTestId('post-modal-title');
expect(title).toHaveTextContent(firstPost.node.title);

await screen.findByRole('navigation');
await screen.findAllByRole('navigation');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

wasn't working because is finding more than one element that has this role

Comment on lines +30 to 32
export interface IconProps extends ComponentProps<'svg'> {
secondary?: boolean;
size?: IconSize;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Need to make the icons able to receive aria- attributes

Copy link
Contributor

Choose a reason for hiding this comment

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

ComponentProps is prefered anyway :)

if (firstChild instanceof HTMLElement) {
firstChild.focus();
}
}, 0);
Copy link
Contributor Author

@ilasw ilasw Sep 25, 2024

Choose a reason for hiding this comment

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

Need to wait for next rendering before moving focus into the new tab element.

if we don't focus the new tab user will loose the focus from the entire page once that the current tab-changing triggering button will disappear.

@ilasw ilasw changed the title chore: updated component for better a11y on signup; chore: better a11y for onboarding; Sep 26, 2024
Copy link
Contributor

@nensidosari nensidosari left a comment

Choose a reason for hiding this comment

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

Great work!

packages/shared/src/components/Logo.tsx Outdated Show resolved Hide resolved
@ilasw ilasw merged commit 7168bc8 into main Oct 1, 2024
10 checks passed
@ilasw ilasw deleted the fix-onboarding-accessibility branch October 1, 2024 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants