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

Fix Black Screen Transition Issue by Reusing didScreenTransitionEnd in MoneyRequestParticipantsSelector #32665

Merged
merged 54 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
9eafd1f
Add 'didScreenTransitionEnd' prop to MoneyRequestParticipantsSelector
brunovjk Dec 7, 2023
a5ed7d8
Integrate 'didScreenTransitionEnd' prop in MoneyRequestParticipantsPage
brunovjk Dec 7, 2023
19d6d68
Conditionally update chatOptions on screen transition end
brunovjk Dec 7, 2023
55d9a41
Merge branch 'Expensify:main' into fix/31779
brunovjk Dec 14, 2023
ef06c1f
Revert "Conditionally update chatOptions on screen
brunovjk Dec 14, 2023
1108784
Revert "Integrate 'didScreenTransitionEnd' prop in MoneyRequestPartic…
brunovjk Dec 14, 2023
c69ecfd
Revert "Add 'didScreenTransitionEnd' prop to MoneyRequestParticipants…
brunovjk Dec 14, 2023
dc1f87f
Integrate 'didScreenTransitionEnd' prop in IOURequestStepParticipants
brunovjk Dec 14, 2023
9cd0ab5
Add 'didScreenTransitionEnd' prop to MoneyRequestParticipantsSelector
brunovjk Dec 14, 2023
a6a36f8
Conditionally update 'chatOptions' on screen transition end
brunovjk Dec 14, 2023
cb61682
Use early return
brunovjk Dec 15, 2023
7ab9d2e
Merge branch 'Expensify:main' into fix/31779
brunovjk Dec 19, 2023
a1b01da
Merge branch 'Expensify:main' into fix/31779
brunovjk Dec 21, 2023
4f25fa7
Enhance 'OptionsListSkeletonView' for quicker display using Dimensions.
brunovjk Dec 22, 2023
fefd084
Revert "Enhance 'OptionsListSkeletonView' for quicker display using D…
brunovjk Dec 23, 2023
271ace6
Optimize OptionsListSkeletonView component
brunovjk Dec 23, 2023
029fa85
Merge branch 'Expensify:main' into fix/31779
brunovjk Dec 27, 2023
99dd07a
Revert "Optimize OptionsListSkeletonView component"
brunovjk Dec 27, 2023
3986a81
Merge branch 'Expensify:main' into fix/31779
brunovjk Dec 29, 2023
2270062
Merge branch 'Expensify:main' into fix/31779
brunovjk Jan 5, 2024
bfb12bb
Merge branch 'Expensify:main' into fix/31779
brunovjk Jan 10, 2024
ed2ffb4
Move 'isOptionsDataReady' to an 'useState'
brunovjk Jan 10, 2024
475fff1
Merge branch 'main' into fix/31779
brunovjk Jan 14, 2024
37dc816
Pass 'didScreenTransitionEnd' from 'StepParticipants.StepScreenWrappe…
brunovjk Jan 14, 2024
8af2b8d
Handle OptionsListUtils logic after screen transition
brunovjk Jan 14, 2024
a2611cc
Implement 'isLoadingNewOptions' to 'BaseSelectionList'
brunovjk Jan 15, 2024
301df39
Adjust 'SelectionList' props
brunovjk Jan 15, 2024
6d15a87
Fill MoneyRequestReferralProgramCTA icon
brunovjk Jan 15, 2024
82c8354
Merge branch 'Expensify:main' into fix/31779
brunovjk Jan 15, 2024
078b4ce
Revert "Fill MoneyRequestReferralProgramCTA icon"
brunovjk Jan 15, 2024
87f5cf5
Use debounce text input value
brunovjk Jan 15, 2024
97f1c9a
applying all the same changes in 'pages/iou/steps/MoneyRequstParticip…
brunovjk Jan 15, 2024
23762b2
Merge branch 'main' into fix/31779
brunovjk Jan 15, 2024
8d08f71
Resolve conflict over 'ReferralProgramCTA'
brunovjk Jan 15, 2024
2ecf126
Merge branch 'Expensify:main' into fix/31779
brunovjk Jan 16, 2024
d0c8b4a
Merge branch 'Expensify:main' into fix/31779
brunovjk Jan 17, 2024
8859d21
Changes requested by reviewer
brunovjk Jan 17, 2024
2bb870a
Merge branch 'main' into fix/31779
brunovjk Jan 17, 2024
5948764
Merge branch 'Expensify:main' into fix/31779
brunovjk Jan 17, 2024
1b98d99
Merge branch 'Expensify:main' into fix/31779
brunovjk Jan 18, 2024
7f01b8d
Revert Migrate 'SelectionList'
brunovjk Jan 18, 2024
1a94efa
Resolve conflict over Migrate 'SelectionList'
brunovjk Jan 18, 2024
0d6b7a5
Resolve conflict over Migrate 'SelectionList'
brunovjk Jan 18, 2024
8c0eee2
Run prettier
brunovjk Jan 18, 2024
e9184c0
Merge branch 'Expensify:main' into fix/31779
brunovjk Jan 19, 2024
5540838
Isolate reuse 'didScreenTransitionEnd' to address the screen transiti…
brunovjk Jan 19, 2024
c235a06
remove redundance
brunovjk Jan 19, 2024
d8df1ee
Merge branch 'Expensify:main' into fix/31779
brunovjk Jan 25, 2024
a5caca2
fix lint
brunovjk Jan 25, 2024
c53276d
fix lint: Removed unused variables and props
brunovjk Jan 25, 2024
1ca1e51
Merge branch 'Expensify:main' into fix/31779
brunovjk Jan 25, 2024
30d53b6
Merge branch 'Expensify:main' into fix/31779
brunovjk Jan 25, 2024
536bb07
Merge branch 'Expensify:main' into fix/31779
brunovjk Jan 26, 2024
6c649a3
Merge branch 'Expensify:main' into fix/31779
brunovjk Jan 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import useThemeStyles from '@hooks/useThemeStyles';
import * as Report from '@libs/actions/Report';
import * as DeviceCapabilities from '@libs/DeviceCapabilities';
import * as OptionsListUtils from '@libs/OptionsListUtils';
import * as ReportUtils from '@libs/ReportUtils';
import reportPropTypes from '@pages/reportPropTypes';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
Expand Down Expand Up @@ -54,16 +55,16 @@ const propTypes = {
/** The request type, ie. manual, scan, distance */
iouRequestType: PropTypes.oneOf(_.values(CONST.IOU.REQUEST_TYPE)).isRequired,

/** Whether we are searching for reports in the server */
isSearchingForReports: PropTypes.bool,
/** Whether the parent screen transition has ended */
didScreenTransitionEnd: PropTypes.bool,
};

const defaultProps = {
participants: [],
safeAreaPaddingBottomStyle: {},
reports: {},
betas: [],
isSearchingForReports: false,
didScreenTransitionEnd: false,
};

function MoneyTemporaryForRefactorRequestParticipantsSelector({
Expand All @@ -75,7 +76,7 @@ function MoneyTemporaryForRefactorRequestParticipantsSelector({
safeAreaPaddingBottomStyle,
iouType,
iouRequestType,
isSearchingForReports,
didScreenTransitionEnd,
}) {
const {translate} = useLocalize();
const styles = useThemeStyles();
Expand All @@ -95,6 +96,9 @@ function MoneyTemporaryForRefactorRequestParticipantsSelector({
*/
const [sections, newChatOptions] = useMemo(() => {
const newSections = [];
if (!didScreenTransitionEnd) {
return [newSections, {}];
}
let indexOffset = 0;

const chatOptions = OptionsListUtils.getFilteredOptions(
Expand Down Expand Up @@ -169,7 +173,7 @@ function MoneyTemporaryForRefactorRequestParticipantsSelector({
}

return [newSections, chatOptions];
}, [reports, personalDetails, betas, searchTerm, participants, iouType, iouRequestType, maxParticipantsReached, translate]);
}, [didScreenTransitionEnd, reports, personalDetails, betas, searchTerm, participants, iouType, iouRequestType, maxParticipantsReached, translate]);

/**
* Adds a single participant to the request
Expand Down Expand Up @@ -328,11 +332,13 @@ function MoneyTemporaryForRefactorRequestParticipantsSelector({
[addParticipantToSelection, isAllowedToSplit, styles, translate],
);

const isOptionsDataReady = useMemo(() => ReportUtils.isReportDataReady() && OptionsListUtils.isPersonalDetailsReady(personalDetails), [personalDetails]);

return (
<View style={[styles.flex1, styles.w100, participants.length > 0 ? safeAreaPaddingBottomStyle : {}]}>
<SelectionList
onConfirm={handleConfirmSelection}
sections={sections}
sections={didScreenTransitionEnd && isOptionsDataReady ? sections : CONST.EMPTY_ARRAY}
textInputValue={searchTerm}
textInputLabel={translate('optionsSelector.nameEmailOrPhoneNumber')}
textInputHint={offlineMessage}
Expand All @@ -341,7 +347,7 @@ function MoneyTemporaryForRefactorRequestParticipantsSelector({
onSelectRow={addSingleParticipant}
footerContent={footerContent}
headerMessage={headerMessage}
showLoadingPlaceholder={isSearchingForReports}
showLoadingPlaceholder={!(didScreenTransitionEnd && isOptionsDataReady)}
rightHandSideComponent={itemRightSideComponent}
/>
</View>
Expand All @@ -359,8 +365,4 @@ export default withOnyx({
betas: {
key: ONYXKEYS.BETAS,
},
isSearchingForReports: {
key: ONYXKEYS.IS_SEARCHING_FOR_REPORTS,
initWithStoredValues: false,
},
})(MoneyTemporaryForRefactorRequestParticipantsSelector);
17 changes: 10 additions & 7 deletions src/pages/iou/request/step/IOURequestStepParticipants.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,16 @@ function IOURequestStepParticipants({
testID={IOURequestStepParticipants.displayName}
includeSafeAreaPaddingBottom
>
<MoneyRequestParticipantsSelector
participants={participants}
onParticipantsAdded={addParticipant}
onFinish={goToNextStep}
iouType={iouType}
iouRequestType={iouRequestType}
/>
{({didScreenTransitionEnd}) => (
brunovjk marked this conversation as resolved.
Show resolved Hide resolved
<MoneyRequestParticipantsSelector
participants={participants}
onParticipantsAdded={addParticipant}
onFinish={goToNextStep}
iouType={iouType}
iouRequestType={iouRequestType}
didScreenTransitionEnd={didScreenTransitionEnd}
/>
)}
</StepScreenWrapper>
);
}
Expand Down
Loading