Mobile: Accessibility: View/edit toggle: Improve screen reader accessibility#15167
Merged
laurent22 merged 4 commits intolaurent22:devfrom Apr 21, 2026
Conversation
…ve-view-edit-toggle-accessibility
…uncement aria-live seems to be Android-only
Contributor
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/app-mobile/components/screens/Note/Note.test.tsx (1)
386-405: Consider tightening the mode-switch selector.
findByLabelText(/Edit|Stop editing/)will also match'Edit'when already in edit mode, so the test does not strictly verify that the label flipped to'Stop editing'after entering edit mode. Since each parametrised case knows itsinitialEditing, you could assert the expected label explicitly:♻️ Suggested refinement
- const toggleButton = await screen.findByLabelText(/Edit|Stop editing/); + const toggleButton = await screen.findByLabelText(initialEditing ? 'Stop editing' : 'Edit');Not blocking — the current assertion via
expectToBeEditingalready covers the behavioural outcome.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/app-mobile/components/screens/Note/Note.test.tsx` around lines 386 - 405, The test uses a loose selector findByLabelText(/Edit|Stop editing/) in the 'should switch modes when toggle button is pressed' case; tighten it by asserting the exact label expected for the toggle after setupNoteWithPanes(panes) and after pressing the button: use findByLabelText('Edit') or findByLabelText('Stop editing') depending on initialEditing, then press the button and assert the opposite exact label and call expectToBeEditing(expectedEditing) as done now to verify behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@packages/app-mobile/components/screens/Note/Note.test.tsx`:
- Around line 386-405: The test uses a loose selector findByLabelText(/Edit|Stop
editing/) in the 'should switch modes when toggle button is pressed' case;
tighten it by asserting the exact label expected for the toggle after
setupNoteWithPanes(panes) and after pressing the button: use
findByLabelText('Edit') or findByLabelText('Stop editing') depending on
initialEditing, then press the button and assert the opposite exact label and
call expectToBeEditing(expectedEditing) as done now to verify behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 2d7dac55-bc0a-4db3-b919-26022e457667
📒 Files selected for processing (4)
packages/app-mobile/components/ScreenHeader/index.tsxpackages/app-mobile/components/screens/Note/Note.test.tsxpackages/app-mobile/components/screens/Note/Note.tsxpackages/app-mobile/components/screens/Note/commands/toggleVisiblePanes.ts
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
When using a screen reader, the view/edit toggle was announced as "toggle view/edit". This could be confusing, as the user lacks information about whether the app is currently in view or edit mode.
Solution
Replace the "toggle view/edit" label with "Edit" and "Stop editing" (depending on whether the user is currently editing the note). When switching between view and edit modes, announce "Viewing" or "Editing".
Testing
iOS
This pull request has been tested on iOS 26 by:
ios-simulator-after.mov
Android
This pull request has been tested on Android by:
android-talkback--toggle-a11y.mov