Update CONSTS to direct developers to use role instead of accessibilityRole (#31500)#74
Merged
trevor-coleman merged 16 commits intoNov 20, 2023
Merged
Conversation
…BLITY_ROLE.TEXT` to point to `ROLE.PRESENTATION`
…g button` value by reverting them to `accessibilityRole`
…eprecatd CONST.ACCESSIBLITY_ROLE
…eprecatd CONST.ACCESSIBLITY_ROLE
…eprecatd CONST.ACCESSIBLITY_ROLE
…deprecatd CONST.ACCESSIBLITY_ROLE
…BLITY_ROLE with CONST.ROLE
Member
|
@trevor-coleman looks like the linter isn't happy! And some conflicts |
Member
|
Also we should probably point it at a different branch than |
cdanwards
reviewed
Nov 20, 2023
cdanwards
left a comment
Member
There was a problem hiding this comment.
Love the detail in documentation
Signed-off-by: Trevor Coleman <trevor@trevorcoleman.design>
Author
|
Linter passing -- going to make that new branch now. |
Author
|
@cdanwards -- lints are passing, and this is now against a feature branch. I think she's ready to go. |
Author
Yeah when I do big find-replaces like this I like to document the edge cases to (hopefully) make it easier to review. |
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.
This fixes the issue with ROLE and ACCESSIBLITY_ROLE identified earlier and discussed on Slack.
It makes the following changes:
Changes to
CONST.tsCONST.ACCESSIBILITY_ROLE.TEXTto the value'text'CONST.ACCESSIBLITY_ROLEand all propertiesCONST.ROLEobject with JSDoc commentsFixes to Components
Simple find-replace
The majority of components were fixed using a simple find and replaced that made the following change
Replace:
role={CONST.ACCESSIBILITY_ROLEwithrole={CONST.ROLEFor example:
role={CONST.ACCESSIBILITY_ROLE.BUTTON}would becomerole={CONST.ROLE.BUTTON}Specific Cases
TEXTto meanPRESENTATIONrole={CONST.ACCESSIBILITY_ROLE.TEXT}role={CONST.ROLE.PRESENTATION}IMAGEBUTTONIMAGEBUTTONonly available inaccessibilityRole. Corrected property toaccessibilityRoleand pointed to the right constrole={CONST.ACCESSIBILITY_ROLE.IMAGEBUTTON}accessibilityRole={CONST.ACCESSIBILITY_ROLE.IMAGEBUTTON}ADJUSTABLEadjustableis not available inrolebut is inaccessibilityRole. Reverted the value and updated prop to reflect correct usagerole={CONST.ACCESSIBILITY_ROLE.ADJUSTABLE}role={CONST.ROLE.SLIDER}ACCESSIBILITY_ROLE.IMAGErolevaluerole={CONST.ACCESSIBILITY_ROLE.IMAGE}role={CONST.ROLE.IMG}Note: In the IMAGEBUTTON Case, I thought it was best to preserve the
imagebuttonrole information, and minimize the number of changes, rather than try to decide on a case-by-case basis what an appropriate replacement would be.Details
Fixed Issues
$
PROPOSAL:
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop