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

Mobile: Fixes #11276: Fix new note button is pushed offscreen on certain Android devices #11323

Conversation

personalizedrefrigerator
Copy link
Collaborator

@personalizedrefrigerator personalizedrefrigerator commented Nov 6, 2024

Summary

This pull request fixes a regression — on certain Android devices, the "+" button for creating new notes was pushed partially or completely offscreen. This seems to have been introduced in Joplin v3.0.1 by #10123.

Fixes #11276.
Fixes #11315.

Note

Currently, this pull request targets release-3.1.

Details

React Native Paper's <FAB.Group> renders an invisible <View> that covers most/all of Joplin's UI. This view is present even when the FAB.Group is collapsed.

To allow users to continue to interact with the application while the view is visible, react-native-paper uses pointerEvents={'box-none'} when the FAB.Group is collapsed. Unfortunately, this breaks TalkBack on Android's "tap to navigate" feature, which significantly impacts users that rely on TalkBack to use the app.

Starting from Joplin v3.0.1, the <View> added by React Native is made smaller by adding margins above and to the left. These margins are determined by the screen size and an offset. Even with this solution, a small portion of the screen still blocks TalkBack's tap-to-navigate. As reported in #11276, this workaround also pushed the new note/new to-do buttons offscren.

This commit changes how the FAB.Group's invisible <View> is resized. Previously it was done with margins. Now, it's done with the top/left absolute positioning properties.

Note: If this upstream pull request is merged, it should be possible to remove the workaround entirely.

Screen recording

Testing plan

TalkBack regression testing

Android 13:

  1. Verify that the new note menu can be opened and closed by clicking on the "+" button.
  2. Enable TalkBack.
  3. Tap the "new note" button.
  4. Verify that it receives focus.
  5. Tap on a note in the note list (far away from the "+" button).
  6. Verify that it receives focus.
  7. Open the note.
  8. Verify that the edit button can be focused by Talkback.
  9. Verify that tapping on the titlebar focuses it.
  10. Focus the edit button, then double-tap.
  11. Verify that edit mode is open.
out.webm

Note: Observe that the "New note" and "New to-do" buttons can be focused by TalkBack even when the menu is collapsed. See this upstream pull request for a possible fix.

Verifying that the new note button isn't pushed offscreen

Android 14 emulator in 3-button navigation mode:

  1. Open the notes list in portrait mode (such that the three navigation buttons are at the bottom of the screen).
  2. Verify that the new note button is completely on-screen.

Note

On the Android 14 emulator, before this PR, the "+" button was not completely pushed offscreen (about 3/4ths of the button visible).

Comment on lines +86 to +87
top: undefined,
left: undefined,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This overrides the top: 0 and left: 0 in the default view styles.

@personalizedrefrigerator personalizedrefrigerator changed the base branch from dev to release-3.1 November 7, 2024 14:47
@personalizedrefrigerator personalizedrefrigerator marked this pull request as draft November 7, 2024 14:47
…n certain Android devices

This commit adjusts an accessibility bug workaround from
(laurent22#10123), which was first present in Android v3.0.1.

**Background**:
React Native Paper's FAB.Group by default renders an invisible <View> that covers most/all
of Joplin's UI when the FAB.Group is collapsed. This breaks TalkBack on Android's "tap to
navigate" feature, which significantly impacts users that rely on TalkBack's ability to use
the app.
Starting from Joplin v3.0.1, the <View> added by React Native is made smaller by Joplin by
adding margins above and to the left. These margins are determined by the screen size and an
offset. This solution isn't perfect because it means that a small portion of the screen still
blocks TalkBack's tap-to-navigate. As reported in laurent22#11276, this workaround also pushed the new
note/new to-do buttons offscren.

**The change**
This commit changes how the FAB.Group's invisible <View> is resized. Previously it was done
with margins. Now, it's done with the top/left absolute positioning properties.

**Note**
If [this upstream pull request](callstack/react-native-paper#4514) is
merged, it should be possible to remove the workaround entirely.

**Remaining steps**
More testing is required before a pull request can be opened. For now, (in part because this is
not a regression from v3.0), I plan to target release-3.2, rather than
release-3.1, to avoid introducing additional regressions in the 3.1 version of the app.

Should fix laurent22#11276, laurent22#11315.
@personalizedrefrigerator personalizedrefrigerator marked this pull request as ready for review November 7, 2024 20:20
@laurent22 laurent22 merged commit 9fb104e into laurent22:release-3.1 Nov 8, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New item button hidden when using 3-button navigation mode Plus Icon disappeared
2 participants