-
Notifications
You must be signed in to change notification settings - Fork 1.4k
feat(voip): Support a11y #7106
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
Merged
Merged
feat(voip): Support a11y #7106
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
c65e3b8
docs: voip accessibility design spec and a11y conventions
diegolmello 2c88a4e
docs: voip accessibility implementation plan
diegolmello 0d20125
docs: update i18n task to use translation agent
diegolmello dce5b24
feat(a11y): add useIsScreenReaderEnabled hook
diegolmello 22e6f14
feat(a11y): add Toggle_call_controls i18n key to all locales
diegolmello 112591b
feat(a11y): hide call buttons from screen reader when controls are no…
diegolmello 7722f5c
feat(a11y): add accessibility label and role to DialpadButton
diegolmello 1d51a0c
feat(a11y): add accessibility label and role to PeerItem
diegolmello d2f7a0b
feat(a11y): keep call controls visible when screen reader is active
diegolmello ac681a4
feat(a11y): disable tap-to-hide controls when screen reader is active
diegolmello 3922ca6
feat(a11y): landscape layout for CallView
diegolmello 472ea40
docs: update accessibility spec, plan, and conventions
diegolmello 9f5e774
chore: format code and fix lint issues
diegolmello 4b0a087
chore: format code and fix lint issues
diegolmello e7bcfee
ignore worktrees
diegolmello 7822932
test(voip): fix failing unit tests for CallView and CallButtons
diegolmello cc7f97b
Fix briding header
diegolmello 93722b0
fix(a11y): remove debug style and fix screen reader hook race condition
diegolmello adfe401
Fix conflicts
diegolmello 19ab42a
action: organized translations
diegolmello ea09f69
Merge branch 'feat.voip-lib-new' into feat.voip-a11y
diegolmello be1ffd0
fix(voip): address PR review comments for a11y
diegolmello 8cd5b3a
chore: remove superpowers docs from PR
diegolmello a37efcc
Fix lint
diegolmello 4067d15
fix: podfile (#7122)
OtavioStasiak 37f86e5
Merge branch 'feat.voip-lib-new' into feat.voip-a11y
diegolmello File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -92,4 +92,4 @@ e2e/e2e_account.ts | |
| skills-lock.json | ||
| CLAUDE.local.md | ||
| AGENTS.md | ||
| .superset/ | ||
| .superset/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| import { renderHook, act } from '@testing-library/react-native'; | ||
| import { AccessibilityInfo } from 'react-native'; | ||
|
|
||
| import { useIsScreenReaderEnabled } from './useIsScreenReaderEnabled'; | ||
|
|
||
| describe('useIsScreenReaderEnabled', () => { | ||
| beforeEach(() => { | ||
| jest.spyOn(AccessibilityInfo, 'isScreenReaderEnabled').mockResolvedValue(false); | ||
| jest.spyOn(AccessibilityInfo, 'addEventListener').mockReturnValue({ remove: jest.fn() } as any); | ||
| }); | ||
|
|
||
| afterEach(() => { | ||
| jest.restoreAllMocks(); | ||
| }); | ||
|
|
||
| it('returns false initially', () => { | ||
| const { result } = renderHook(() => useIsScreenReaderEnabled()); | ||
| expect(result.current).toBe(false); | ||
| }); | ||
|
|
||
| it('returns true after isScreenReaderEnabled resolves true', async () => { | ||
| jest.spyOn(AccessibilityInfo, 'isScreenReaderEnabled').mockResolvedValue(true); | ||
| const { result } = renderHook(() => useIsScreenReaderEnabled()); | ||
| await act(async () => {}); | ||
| expect(result.current).toBe(true); | ||
| }); | ||
|
|
||
| it('updates when screenReaderChanged event fires', () => { | ||
| let capturedListener: (enabled: boolean) => void = () => {}; | ||
| jest.spyOn(AccessibilityInfo, 'addEventListener').mockImplementation((_event, cb) => { | ||
| capturedListener = cb as unknown as (enabled: boolean) => void; | ||
| return { remove: jest.fn() } as any; | ||
| }); | ||
|
|
||
| const { result } = renderHook(() => useIsScreenReaderEnabled()); | ||
|
|
||
| act(() => { | ||
| capturedListener(true); | ||
| }); | ||
|
|
||
| expect(result.current).toBe(true); | ||
| }); | ||
|
|
||
| it('removes the event listener on unmount', () => { | ||
| const removeMock = jest.fn(); | ||
| jest.spyOn(AccessibilityInfo, 'addEventListener').mockReturnValue({ remove: removeMock } as any); | ||
|
|
||
| const { unmount } = renderHook(() => useIsScreenReaderEnabled()); | ||
| unmount(); | ||
|
|
||
| expect(removeMock).toHaveBeenCalled(); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| import { useEffect, useState } from 'react'; | ||
| import { AccessibilityInfo } from 'react-native'; | ||
|
|
||
| export const useIsScreenReaderEnabled = (): boolean => { | ||
| const [enabled, setEnabled] = useState(false); | ||
|
|
||
| useEffect(() => { | ||
| let ignore = false; | ||
| AccessibilityInfo.isScreenReaderEnabled().then(result => { | ||
| if (!ignore) { | ||
| setEnabled(result); | ||
| } | ||
| }); | ||
| const subscription = AccessibilityInfo.addEventListener('screenReaderChanged', result => { | ||
| if (!ignore) { | ||
| setEnabled(result); | ||
| } | ||
| }); | ||
| return () => { | ||
| ignore = true; | ||
| subscription.remove(); | ||
| }; | ||
| }, []); | ||
|
|
||
| return enabled; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.