-
Notifications
You must be signed in to change notification settings - Fork 3k
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
17017 migrate RadioButtonWithLabel to PressableWithFeedback #18847
17017 migrate RadioButtonWithLabel to PressableWithFeedback #18847
Conversation
23d187a
to
9ecda35
Compare
@abdulrahuman5196 @dangrous One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Will start on this. |
This comment was marked as outdated.
This comment was marked as outdated.
@robertKozik Added some questions on the implementation. It would be better to add some more information in the PR details section since the linked issue also doesn't have much information, so that it will be useful for future references. |
Hi, I did mock the questions page and tested out the changes Current behaviour in main: Screen.Recording.2023-05-16.at.9.08.54.PM.movBehaviour with the new code change: Screen.Recording.2023-05-16.at.9.14.46.PM.movI have few concerns
Screen.Recording.2023-05-16.at.9.28.21.PM.mov
![]() @robertKozik @dangrous I understand this PR is only concerned about the migration but would be good to understand the thoughts on the above issues. Are we fine with the behaviour?/ Do we need to fix it part of this PR or Do as a followup action. |
@abdulrahuman5196 Both behaviour are easy to change, or remove. It comes from the implementation of That's why your third point occurred, different dimming is applied on the presses. I agree with you that no visible changes should be introduced with the migration so I'll remove the hover dimming, press dimming is present on production so I'll left it. Your last concern comes from the styling used on the view, as it styling the view with |
@robertKozik Great. Then lets go with not changing/regressing any behaviour now. Have migration changes in the same way. |
@abdulrahuman5196 I've disabled the hover dimming and removed doubling styles (this was unintentional). However I'll be able to test it once more in about an hour or so. |
@robertKozik Sure. Kindly update once you have done testing. I will continue testing tomorrow morning from my end. |
Alright, I've filled out details PR section and change the video from web to indicate no hover effect |
@robertKozik one other difference I see is in the long press case. In main the option gets selected only when we release the press, but in the new code its gets selected after a while without release but the press dim is only gone after press release. New implementation Screen.Recording.2023-05-17.at.12.33.52.AM.movCurrent implementation Screen.Recording.2023-05-17.at.12.33.02.AM.mov |
…onLongPress is passed
cef0bd3
to
0a8c83e
Compare
I needed to rebase with main, but now options are selected when user releases the button. Also I have implemented the custom prop test in order to remove the |
@robertKozik I tried in desktop and all seems to work fine. Can you take care of the above request alone - #18847 (comment)? So that I can start testing in other platforms and complete the reviewer's checklist? |
Reviewer Checklist
Screenshots/VideosWebScreen.Recording.2023-05-19.at.2.32.38.AM.movMobile Web - Chromeaz_recorder_20230519_023408.mp4Mobile Web - SafariUntitled.movDesktopdesktop.moviOSios.movAndroidaz_recorder_20230519_022740.mp4 |
58f19d0
to
67321ee
Compare
Note: I see some console errors and issues with ideology page but none of those are required for this PR. I will file bugs in slack for those. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dangrous All yours. I have completed reviewers checklist.
But could only verify by mocking the flow same as the author since it requires wallet flow. Kindly help and verify from your end on actual wallet flow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two quick changes.
However, seeing it in action, I dislike how we make this work, and I'm wondering if we can sneak some improvements in here. To note - none of these are because of this code, it's pre existing decisions.
- Is press dimming required for accessibility? If not, I think we should remove it - it's weird that the text dims but not the checkbox, and in usual usage if you're just tapping you only see it as a flash. I'd also be okay if we apply the dimming to the whole item (including the box) but I don't think that's possible within this component.
- I think we should remove the checks from the options that aren't currently checked. I will sync with design to see if we can do that (very easy fix)
It's totally fine to just make a separate issue for those updates, and push this forward as a straight migration. If you'd prefer that to keep scope of this issue down, just let me know!
function requiredPropsCheck(props) { | ||
if (props.accessible !== true || (props.accessibilityLabel !== undefined && typeof props.accessibilityLabel === 'string')) { | ||
return; | ||
} | ||
return new Error(`Provide a valid string for accessibilityLabel prop when accessible is true`); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function requiredPropsCheck(props) { | |
if (props.accessible !== true || (props.accessibilityLabel !== undefined && typeof props.accessibilityLabel === 'string')) { | |
return; | |
} | |
return new Error(`Provide a valid string for accessibilityLabel prop when accessible is true`); | |
} | |
function requiredPropsCheck(props) { | |
if (props.accessible === true && (props.accessibilityLabel === undefined || typeof props.accessibilityLabel !== 'string')) { | |
return new Error(`Provide a valid string for accessibilityLabel prop when accessible is true`); | |
} | |
} |
Makes this shorter and a little easier to understand (also follows the pattern of those other ones I found
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The one problem is that if we have only one statement lint gives us error: Prefer an early return to a conditionally-wrapped function body
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well that's annoying. Okay, fine to keep as is!
Update - I think it makes the most sense to ignore the design changes I want to make and handle that separately. I'll make another issue for that. Just handle the requested changes, and we should be good to go! And reading back in the comments I see you both talked about some of these issues I had as well (such as press dimming), so I'm glad we're pretty much on the same page. I think we can clean up the design of this significantly |
Co-authored-by: Daniel Gale-Rosen <[email protected]>
Sure, generally the migration to PressableWithFeedback/PressableWithoutFeedback will be great platform to implement such a standardisation of the press/hover behaviours. Let me know if we want to update the |
Reviewer Checklist
Screenshots/VideosWebScreen.Recording.2023-05-19.at.11.33.15.PM.movMobile Web - Chromeaz_recorder_20230519_233900.mp4Mobile Web - SafariScreenRecording.movDesktopScreen.Recording.2023-05-19.at.11.28.08.PM.moviOSScreen.Recording.2023-05-19.at.11.31.04.PM.movAndroidaz_recorder_20230519_234859.mp4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did another reviewer's checklist and all are good. Approving.
We should be good to merge, if this was verified from real page from your end as well.
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/dangrous in version: 1.3.17-0 🚀
|
@robertKozik @dangrous Is there an easy way to navigate to this page in Staging? |
@mvtglobally can y'all do the Wallet Activation flow? If not, let me know and I can test quickly |
@dangrous isnt it behind the KYC wall? I don't think we were able to do it in the past, but if you can share a way it would be great |
I mean it sort of IS the KYC wall? I think you're right though, I can check this out shortly |
@dangrous are we ok to check it off? |
Yes! |
🚀 Deployed to production by https://github.com/chiragsalian in version: 1.3.17-5 🚀
|
@@ -38,6 +39,8 @@ const defaultProps = { | |||
errorText: '', | |||
}; | |||
|
|||
const PressableWithFeedback = Pressables.PressableWithFeedback; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a good import. It should have been a named import and used directly on JSX.
hoverDimmingValue={1} | ||
pressDimmingValue={0.2} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
About this, we disabled the hover dimming and I see that same is being applied on another PR but if we don't want to have that anywhere (currently app has none), then why is it not set to 1
as default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah that's a good point - @roryabraham do you have any thoughts? Any reason not to update this at some point?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can agree with that. As this should be more focused on migration rather than changing the visuals (as this would likely need some design decisions) 1
as default suits this approach
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Asked on slack https://expensify.slack.com/archives/C01GTK53T8Q/p1685741951521769
Details
This PR migrates
RadioButtonWithLabel
toPressableWithFeedback
. BeforeRedioButtonWithLabel
was using theTouchableOpacity
which will be deprecated in next version ofreact-native-web
. In addition to migration,accessibility
prop is now set tofalse
to be in line with already presetfocusable={false}
. In terms of visuals, nothing should get changed.Fixed Issues
$ #17017
PROPOSAL: #17017
Tests
For local testing I needed to mock the question
Offline tests
Same as Test steps
QA Steps
Same as Test steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Web
Screen.Recording.2023-05-16.at.20.15.43.mov
Mobile Web - Chrome
android.-.web.mov
Mobile Web - Safari
iOS.-.web.mov
Desktop
Desktop.-.native.mov
iOS
iOS.-.native.mov
Android
android.-.native.mov