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

WRQ-11247: Added fontScale prop for large text mode scale values #3217

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

Conversation

mmyelyn
Copy link

@mmyelyn mmyelyn commented Mar 4, 2024

Checklist

  • I have read and understand the contribution guide
  • A CHANGELOG entry is included
  • At least one test case is included for this feature or bug fix
  • Documentation was added or is not needed
  • This is an API breaking change

Issue Resolved / Feature Added

There is a requirement for large text mode for a11y.
I have modified the app (including sampler) to review the screen when large text is applied.

Resolution

Modified to update the base font size when the fontScale prop changes.

Additional Considerations

Links

WRQ-11247

Comments

Enact-DCO-1.0-Signed-off-by: Hyelyn Kim ([email protected])

@CLAassistant
Copy link

CLAassistant commented Mar 4, 2024

CLA assistant check
All committers have signed the CLA.

@mmyelyn mmyelyn marked this pull request as draft March 4, 2024 07:46
Copy link

codecov bot commented Mar 4, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 82.34%. Comparing base (18333f7) to head (7d442c5).

Files Patch % Lines
packages/ui/resolution/ResolutionDecorator.js 60.00% 3 Missing and 1 partial ⚠️
packages/ui/resolution/resolution.js 75.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3217      +/-   ##
===========================================
- Coverage    82.36%   82.34%   -0.03%     
===========================================
  Files          156      156              
  Lines         7209     7221      +12     
  Branches      1907     1908       +1     
===========================================
+ Hits          5938     5946       +8     
- Misses         999     1002       +3     
- Partials       272      273       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Enact-DCO-1.0-Signed-off-by: Hyelyn Kim ([email protected])
- Added fontScale to defaultConfig of ResolutionDecorator
- Deleted fontScale to prevent it from being passed to Wrapped.

Enact-DCO-1.0-Signed-off-by: Hyelyn Kim ([email protected])
@juwonjeong
Copy link
Contributor

@mmyelyn, font scale does not work with http://SERVERIP:8080/?path=/story/about-a-tour-of-sampler--a-tour-of-sampler&globals=font+scale:1.6. Could you please check it?

- Moved fontScale to defaultProps from defaultConfig
- Modified it so that fontScale is  applied on initial entry

Enact-DCO-1.0-Signed-off-by: Hyelyn Kim ([email protected])
@mmyelyn
Copy link
Author

mmyelyn commented Mar 15, 2024

@mmyelyn, font scale does not work with http://SERVERIP:8080/?path=/story/about-a-tour-of-sampler--a-tour-of-sampler&globals=font+scale:1.6. Could you please check it?

This is because fontScale was not passed when updating the base font in init. In the process of fixing, i modified fontScale to be managed as an internal resolution variable. So, the fontScale parameter that was passed to the calculate function has been deleted.

@juwonjeong
Copy link
Contributor

I think it is better to apply 4b93d18 commit to not change the original init function, but I need the merger's opinion.

Comment on lines 102 to 105
/**
* Font Scale for large text mode.
* Use this value to set the scale of the font.
* This is the value that will be multiplied by pxPerRem, which is determined by resolution.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/**
* Font Scale for large text mode.
* Use this value to set the scale of the font.
* This is the value that will be multiplied by pxPerRem, which is determined by resolution.
/**
* Font scale value for the large text mode.
* Use this value to set the scale of the font.
* This is the value that will be multiplied by pxPerRem, which is determined by the resolution.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think large text mode word may be confused with the original large text mode that is set in ThemeDecorator.

Copy link
Author

Choose a reason for hiding this comment

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

I used it because the currently used term is large text mode. It may be confused with large text in ThemeDecorator, but since there is currently no fixed name, it would be a good idea to change it after the name is fixed. This is a draft and will not be merged.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree. I think we need to set a proper name for this mode when merging it. I will approve it since this is a draft PR.

packages/ui/resolution/resolution.js Outdated Show resolved Hide resolved
- Moved updateFontScale to constructor

Enact-DCO-1.0-Signed-off-by: Hyelyn Kim ([email protected])
Copy link
Contributor

@juwonjeong juwonjeong left a comment

Choose a reason for hiding this comment

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

LGTM

regardless of the base font.

Enact-DCO-1.0-Signed-off-by: Hyelyn Kim ([email protected])
- FontScale must be updated before the scale function is called

Enact-DCO-1.0-Signed-off-by: Hyelyn Kim ([email protected])
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.

3 participants