-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Cleanup completing a split bill #29568
Conversation
Deploying with Cloudflare Pages
|
@thesahindia Please 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] |
@@ -196,6 +202,7 @@ const defaultProps = { | |||
isScanRequest: false, | |||
shouldShowSmartScanFields: true, | |||
isPolicyExpenseChat: false, | |||
shouldAllowScrollingInputs: false, |
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.
This prop is not used anywhere
/** Whether we should show the amount, date, and merchant fields. */ | ||
shouldShowSmartScanFields: PropTypes.bool, | ||
|
||
/** Whether we should show the amount, date, and merchant fields. */ | ||
isScrollable: PropTypes.bool, |
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 think we can remove this prop and make this component always scrollable.
And instead remove scroll views in MoneyRequestConfirmPage
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 don't think we can do that. It would alter the behavior in the search page where we want the search bar to remain fixed on top.
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.
This component is used only in 2 places - SplitBillDetailsPage, MoneyRequestConfirmationPage
There's no search bar
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 yes sorry. I mistakenly thought the comment was under BaseOptionsSelector
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.
You might have got confused with OptionsSelector that has search input
|
||
const {shouldAllowScrollingChildren} = this.props; | ||
function ScrollWrapper({children}) { | ||
if (!shouldAllowScrollingChildren) { | ||
return children; | ||
} | ||
return ( | ||
<ScrollView contentContainerStyle={[styles.flexGrow1]}> | ||
<ScrollView | ||
horizontal | ||
contentContainerStyle={[styles.flex1, styles.flexColumn]} | ||
> | ||
{children} | ||
</ScrollView> | ||
</ScrollView> | ||
); | ||
} | ||
|
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.
Can we move this out of component lifecycle?
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 sure where, what do you suggest? And what's the issues if we keep it here? thanks!
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 was thinking of static function but I think it's better to make separate component in /components
.
I see double scroll view was used in several places so it can be reused once we make it.
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.
Ended up removing the component all together, I searched in the codebase and could only find the double scroll view used once in MoneyConfirmationList
, let me know what you think!
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.
Fine to me. I found only one occurrence in AddressSearch
App/src/components/AddressSearch/index.js
Lines 266 to 273 in fe282b4
/* | |
* The GooglePlacesAutocomplete component uses a VirtualizedList internally, | |
* and VirtualizedLists cannot be directly nested within other VirtualizedLists of the same orientation. | |
* To work around this, we wrap the GooglePlacesAutocomplete component with a horizontal ScrollView | |
* that has scrolling disabled and would otherwise not be needed | |
*/ | |
<ScrollView | |
horizontal |
please fix lint |
Is ready for review? |
Yup @situchan, thanks! |
Reviewer Checklist
Screenshots/VideosWebweb1.movweb2.movMobile Web - Chromemchrome.movMobile Web - Safarimsafari.movDesktopiOSios.movAndroidandroid.mov |
Co-authored-by: Situ Chandra Shil <[email protected]>
Thanks @situchan for the thorough review! |
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.
thanks for the thorough review @situchan
I am slightly worried about the changes to the BaseOptionsSelection in sense that there might be regressions coming. Lets be on a look out for some potentially weird behaviour in staging.
cc @tgolen this touches the MoneyRequestConfirmationList FYI |
Hope there would be no regressions as affected only when |
Also note for the future, the |
Yep I agree there should not be regressions hopefully, still just ideally we are cautious of this in case some odd issues pop over now and tomorrow |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
@@ -150,6 +150,9 @@ const propTypes = { | |||
/** Whether the money request is a scan request */ | |||
isScanRequest: PropTypes.bool, | |||
|
|||
/** Whether we're editing a split bill */ | |||
isEditingSplitBill: PropTypes.bool, |
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.
For the future, please name the props for the effect they should have inside the component. When only reviewing code inside this component, if you saw the prop isEditingSplitBill
, you would have no idea what that prop should do or how it should be applied. For example, the prop below is called shouldShowSmartScanFields
which is much more explicit and its purpose is understood immediately.
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.
Hey @tgolen - sorry for the late reply! Will keep this in mind, however, I think it's a bit difficult in this component as it handles different IOUs. What would be a better naming here?
🚀 Deployed to staging by https://github.com/mountiny in version: 1.3.85-0 🚀
|
🚀 Deployed to production by https://github.com/francoisl in version: 1.3.85-4 🚀
|
🚀 Deployed to staging by https://github.com/mountiny in version: 1.3.86-0 🚀
|
🚀 Deployed to production by https://github.com/francoisl in version: 1.3.86-5 🚀
|
result.alternateText = lastMessageTextFromReport.length > 0 ? lastMessageText : Localize.translate(preferredLocale, 'report.noActivityYet'); | ||
result.alternateText = lastAction && lastMessageTextFromReport.length > 0 ? lastMessageText : Localize.translate(preferredLocale, 'report.noActivityYet'); |
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.
This seems unintended? The lastAction
check is not needed for this case
Details
Fixed Issues
Polish of
$ https://github.com/Expensify/Expensify/issues/322303
Tests
P2P
Workspace
Offline tests
QA Steps
P2P
Workspace
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
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
(The error that occurs in the beginning is on dev only and is a warning, we have an issue to fix it later and make split commands 1:1:1)
Screen.Recording.2023-10-15.at.21.44.39.mov
MacOS: Desktop