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

feat(a11y): dynamic text size with custom header #6187

Draft
wants to merge 53 commits into
base: develop
Choose a base branch
from

Conversation

OtavioStasiak
Copy link
Contributor

@OtavioStasiak OtavioStasiak commented Feb 28, 2025

Proposed changes

When the text size is increased in the device settings (Android and iOS), the layout of the Button, FormTextInput, and Header breaks, causing text to be cut off in inputs or button titles to be truncated. This issue occurred because these components had a fixed height.

This PR resolves the problem by replacing the fixed height with padding. Additionally:

The header does not break when scaling the font.
All instances of ROW_HEIGHT and ROW_HEIGHT_CONDENSED now use the appropriate hook, as pixelRatio.getFontScale was not updating correctly on Android.
Icons now scale properly with fontScale.
A bug on Android that prevented the roomItem height from updating has been fixed.

Issue(s)

closes #6146
https://rocketchat.atlassian.net/browse/MA-168

How to test or reproduce

Screenshots

iPad 1x (Portrait)

Input and Buttons

Before After
Before After

RoomsListView

Before After
Before After

RoomsListView Search

Before After
Before After

RoomView

Before After
Before After

ProfileView (Header with Drawer button)

Before After
Before After

PreferencesView (Header with Go Back)

Before After
Before After

ShareListView

Before After
Before After

ShareListView Search

Before After
Before After

ShareView

Before After
Before After

AttachmentView

Before After
Before After

iPad 2x (Portrait)

Input and Buttons

Before After
Before After

RoomsListView

Before After
Before After

RoomsListView Search

Before After
Before After

RoomView

Before After
Before After

ProfileView (Header with Drawer button)

Before After
Before After

PreferencesView (Header with Go Back)

Before After
Before After

ShareListView

Before After
Before After

ShareListView Search

Before After
Before After

ShareView

Before After
Before After

AttachmentView

Before After
Before After

iPad 1x (Landscape)

Input and Buttons

Before After
Simulator Screenshot - iPad (10th generation) - 2025-03-05 at 19 01 31 Simulator Screenshot - iPad (10th generation) - 2025-03-06 at 11 13 00

RoomsListView

Before After
Simulator Screenshot - iPad (10th generation) - 2025-03-05 at 19 00 59 Simulator Screenshot - iPad (10th generation) - 2025-03-06 at 11 12 51

RoomsListView Search

Before After
Simulator Screenshot - iPad (10th generation) - 2025-03-05 at 19 01 08 Simulator Screenshot - iPad (10th generation) - 2025-03-06 at 11 13 11

RoomView

Before After
Simulator Screenshot - iPad (10th generation) - 2025-03-05 at 19 01 17 Simulator Screenshot - iPad (10th generation) - 2025-03-06 at 11 13 20

ProfileView (Header with Drawer button)

Before After
Simulator Screenshot - iPad (10th generation) - 2025-03-05 at 19 01 39 Simulator Screenshot - iPad (10th generation) - 2025-03-06 at 11 13 03

PreferencesView (Header with Go Back)

Before After
Simulator Screenshot - iPad (10th generation) - 2025-03-05 at 19 01 50 Simulator Screenshot - iPad (10th generation) - 2025-03-06 at 11 13 28

ShareListView

Before After
Simulator Screenshot - iPad (10th generation) - 2025-03-05 at 19 03 09 Simulator Screenshot - iPad (10th generation) - 2025-03-06 at 11 14 45

ShareListView Search

Before After
Simulator Screenshot - iPad (10th generation) - 2025-03-05 at 19 03 18 Simulator Screenshot - iPad (10th generation) - 2025-03-06 at 11 14 51

ShareView

Before After
Simulator Screenshot - iPad (10th generation) - 2025-03-05 at 19 03 27 Simulator Screenshot - iPad (10th generation) - 2025-03-06 at 11 14 57

AttachmentView

Before After
Simulator Screenshot - iPad (10th generation) - 2025-03-05 at 19 00 33 Simulator Screenshot - iPad (10th generation) - 2025-03-06 at 11 14 17

iPad 2x (Landscape)

Input and Buttons

Before After
Simulator Screenshot - iPad (10th generation) - 2025-03-05 at 19 10 30 Simulator Screenshot - iPad (10th generation) - 2025-03-06 at 11 51 47

RoomsListView

Before After
Simulator Screenshot - iPad (10th generation) - 2025-03-05 at 19 09 21 Simulator Screenshot - iPad (10th generation) - 2025-03-06 at 11 51 09

RoomsListView Search

Before After
Simulator Screenshot - iPad (10th generation) - 2025-03-05 at 19 09 34 Simulator Screenshot - iPad (10th generation) - 2025-03-06 at 11 51 15

RoomView

Before After
Simulator Screenshot - iPad (10th generation) - 2025-03-05 at 19 09 46 Simulator Screenshot - iPad (10th generation) - 2025-03-06 at 11 51 24

ProfileView (Header with Drawer button)

Before After
Simulator Screenshot - iPad (10th generation) - 2025-03-05 at 19 09 59 Simulator Screenshot - iPad (10th generation) - 2025-03-06 at 11 51 33

PreferencesView (Header with Go Back)

Before After
Simulator Screenshot - iPad (10th generation) - 2025-03-05 at 19 10 11 Simulator Screenshot - iPad (10th generation) - 2025-03-06 at 11 51 41

ShareListView

Before After
Simulator Screenshot - iPad (10th generation) - 2025-03-05 at 19 13 58 Simulator Screenshot - iPad (10th generation) - 2025-03-06 at 11 53 59

ShareListView Search

Before After
Simulator Screenshot - iPad (10th generation) - 2025-03-05 at 19 14 05 Simulator Screenshot - iPad (10th generation) - 2025-03-06 at 11 54 27

ShareView

Before After
Simulator Screenshot - iPad (10th generation) - 2025-03-05 at 19 14 13 Simulator Screenshot - iPad (10th generation) - 2025-03-06 at 11 54 39

AttachmentView

Simulator Screenshot - iPad (10th generation) - 2025-03-05 at 19 13 36
Simulator Screenshot - iPad (10th generation) - 2025-03-06 at 11 51 58

iPhone 1x (Portrait)

Input and Buttons

Before After
Before After

RoomsListView

Before After
Before After

RoomsListView Search

Before After
Before After

RoomView

Before After
Before After

ProfileView (Header with Drawer button)

Before After
Before After

PreferencesView (Header with Go Back)

Before After
Before After

ShareListView

Before After
Before After

ShareListView Search

Before After
Before After

ShareView

Before After
Before After

AttachmentView

Before After
Before After

iPhone 2x (Portrait)

Input and Buttons

Before After
Before After

RoomsListView

Before After
Before After

RoomsListView Search

Before After
Before After

RoomView

Before After
Before After

ProfileView (Header with Drawer button)

Before After
Before After

PreferencesView (Header with Go Back)

Before After
Before After

ShareListView

Before After
Before After

ShareListView Search

Before After
Before After

ShareView

Before After
Before After

AttachmentView

Before After
Before After

iPhone 1x (Landscape)

Input and Buttons

Before After
Simulator Screenshot - iPhone 15 - 2025-03-05 at 18 27 35 Simulator Screenshot - iPhone 15 - 2025-03-05 at 23 22 24

RoomsListView

Before After
Simulator Screenshot - iPhone 15 - 2025-03-05 at 18 28 00 Simulator Screenshot - iPhone 15 - 2025-03-05 at 23 20 07

RoomsListView Search

Before After
Simulator Screenshot - iPhone 15 - 2025-03-05 at 18 28 11 Simulator Screenshot - iPhone 15 - 2025-03-05 at 23 20 14

RoomView

Before After
simulator_screenshot_57398036-C41F-4CDC-B0B5-41C27430799E ![Simulator Screenshot - iPhone 15 - 2025-03-05 at 23 22 04]((https://github.com/user-attachments/assets/7363a7dd-1834-4809-8e38-704e123f3bf0)

ProfileView (Header with Drawer button)

Before After
Simulator Screenshot - iPhone 15 - 2025-03-05 at 18 27 47 Simulator Screenshot - iPhone 15 - 2025-03-05 at 23 22 16

PreferencesView (Header with Go Back)

Before After
Simulator Screenshot - iPhone 15 - 2025-03-05 at 18 28 51 Simulator Screenshot - iPhone 15 - 2025-03-05 at 23 22 30

ShareListView

Before After
Simulator Screenshot - iPhone 15 - 2025-03-05 at 18 29 11 Simulator Screenshot - iPhone 15 - 2025-03-05 at 23 23 09

ShareListView Search

Before After
Simulator Screenshot - iPhone 15 - 2025-03-05 at 18 29 20 Simulator Screenshot - iPhone 15 - 2025-03-05 at 23 23 09

ShareView

Before After
Simulator Screenshot - iPhone 15 - 2025-03-05 at 18 29 28 Simulator Screenshot - iPhone 15 - 2025-03-05 at 23 23 24

AttachmentView

Before After
Simulator Screenshot - iPhone 15 - 2025-03-05 at 18 27 00 Simulator Screenshot - iPhone 15 - 2025-03-05 at 23 20 46

iPhone 2x (Landscape)

Input and Buttons

Before After
Simulator Screenshot - iPhone 15 - 2025-03-05 at 18 38 42 Simulator Screenshot - iPhone 15 - 2025-03-05 at 23 26 12

RoomsListView

Before After
Simulator Screenshot - iPhone 15 - 2025-03-05 at 18 36 12 Simulator Screenshot - iPhone 15 - 2025-03-05 at 23 25 27

RoomsListView Search

Before After
Simulator Screenshot - iPhone 15 - 2025-03-05 at 18 36 26 Simulator Screenshot - iPhone 15 - 2025-03-05 at 23 25 42

RoomView

Before After
Simulator Screenshot - iPhone 15 - 2025-03-05 at 18 36 38 Simulator Screenshot - iPhone 15 - 2025-03-05 at 23 25 51

ProfileView (Header with Drawer button)

Before After
Simulator Screenshot - iPhone 15 - 2025-03-05 at 18 38 21 Simulator Screenshot - iPhone 15 - 2025-03-05 at 23 26 02

PreferencesView (Header with Go Back)

Before After
Simulator Screenshot - iPhone 15 - 2025-03-05 at 18 38 28 Simulator Screenshot - iPhone 15 - 2025-03-05 at 23 26 24

ShareListView

Before After
Simulator Screenshot - iPhone 15 - 2025-03-05 at 18 39 36 Simulator Screenshot - iPhone 15 - 2025-03-05 at 23 26 56

ShareListView Search

Before After
Simulator Screenshot - iPhone 15 - 2025-03-05 at 18 39 40 Simulator Screenshot - iPhone 15 - 2025-03-05 at 23 27 01

ShareView

Before After
Simulator Screenshot - iPhone 15 - 2025-03-05 at 18 39 45 Simulator Screenshot - iPhone 15 - 2025-03-05 at 23 27 08

AttachmentView

Before After
Simulator Screenshot - iPhone 15 - 2025-03-05 at 18 40 21 Simulator Screenshot - iPhone 15 - 2025-03-05 at 23 26 36

Android 1x (Portrait)

Input and Buttons

Before After
Screenshot 2025-03-05 at 19 49 21 Screenshot 2025-03-06 at 15 21 18

RoomsListView

Before After
Screenshot 2025-03-05 at 19 48 03 Screenshot 2025-03-06 at 15 20 03

RoomsListView Search

Before After
Screenshot 2025-03-05 at 19 48 26 Screenshot 2025-03-06 at 15 20 25

RoomView

Before After
Screenshot 2025-03-05 at 19 48 42 Screenshot 2025-03-06 at 15 29 56

ProfileView (Header with Drawer button)

Before After
Screenshot 2025-03-05 at 19 48 59 Screenshot 2025-03-06 at 15 21 10

PreferencesView (Header with Go Back)

Before After
Screenshot 2025-03-05 at 19 49 08 Screenshot 2025-03-06 at 15 30 29

ShareListView

Before After
Screenshot 2025-03-05 at 19 50 53 Screenshot 2025-03-06 at 15 33 02

ShareListView Search

Before After
Screenshot 2025-03-05 at 19 51 04 Screenshot 2025-03-06 at 15 33 20

ShareView

Before After
Screenshot 2025-03-05 at 19 51 14 Screenshot 2025-03-06 at 15 33 36

AttachmentView

Before After
Screenshot 2025-03-05 at 19 49 52 Screenshot 2025-03-06 at 15 30 54

Android 2x (Portrait)

Input and Buttons

Before After
Before After

RoomsListView

Before After
Before After

RoomsListView Search

Before After
Before After

RoomView

Before After
Before After

ProfileView (Header with Drawer button)

Before After
Before After

PreferencesView (Header with Go Back)

Before After
Before After

ShareListView

Before After
Before After

ShareListView Search

Before After
Before After

ShareView

Before After
Before After

AttachmentView

Before After
Before After

Android 1x (Landscape)

Input and Buttons

Before After
Before After

RoomsListView

Before After
Before After

RoomsListView Search

Before After
Before After

RoomView

Before After
Before After

ProfileView (Header with Drawer button)

Before After
Before After

PreferencesView (Header with Go Back)

Before After
Before After

ShareListView

Before After
Before After

ShareListView Search

Before After
Before After

ShareView

Before After
Before After

AttachmentView

Before After
Before After

Android 2x (Landscape)

Input and Buttons

Screenshot 2025-03-05 at 20 03 14
Screenshot 2025-03-06 at 16 37 46

RoomsListView

Screenshot 2025-03-05 at 20 02 24
Screenshot 2025-03-06 at 16 36 14

RoomsListView Search

Screenshot 2025-03-05 at 20 02 41
Screenshot 2025-03-06 at 16 36 38

RoomView

Screenshot 2025-03-05 at 20 02 53
Screenshot 2025-03-06 at 16 37 05

ProfileView (Header with Drawer button)

Screenshot 2025-03-05 at 20 03 05
Screenshot 2025-03-06 at 16 37 22

PreferencesView (Header with Go Back)

Screenshot 2025-03-05 at 20 03 26
Screenshot 2025-03-06 at 16 38 06

ShareListView

Screenshot 2025-03-05 at 20 05 22
Screenshot 2025-03-06 at 16 39 14

ShareListView Search

Screenshot 2025-03-05 at 20 05 44
Screenshot 2025-03-06 at 16 39 34

ShareView

Screenshot 2025-03-05 at 20 05 29
Screenshot 2025-03-06 at 16 39 48

AttachmentView

Screenshot 2025-03-05 at 20 03 41
Screenshot 2025-03-06 at 16 38 29

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves a current function)
  • New feature (non-breaking change which adds functionality)
  • Documentation update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if applicable)
  • I have added necessary documentation (if applicable)
  • Any dependent changes have been merged and published in downstream modules

Further comments

OtavioStasiak and others added 30 commits January 24, 2025 19:47
@diegolmello diegolmello mentioned this pull request Mar 5, 2025
10 tasks
@OtavioStasiak OtavioStasiak changed the title test(a11y): dynamic text size with custom header feat(a11y): dynamic text size with custom header Mar 6, 2025
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.

bug: Image Name Overlaps Save to Gallery Icon in Image Viewer
2 participants