Make NewChatConfirmPage use new SelectionList#74982
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
| const isItemDisabled = isDisabled || (!!item?.isDisabled && !isItemSelected(item)); | ||
|
|
||
| if (isItemSelected(item)) { | ||
| if (isItemSelected(item) && (canSelectMultiple || acc.selectedOptions.length === 0)) { |
There was a problem hiding this comment.
Ok, so if we pass data with multiple selected items (and no canSelectMultiple), we'll end up with the first of them selected, right?
If so it might be worth mentioning somewhere 🤔
There was a problem hiding this comment.
Tbh this situation is really unlikely to happen, because the ListItem blocks from choosing more, it's just an extra safety check, so I could even delete it
|
@dukenv0307 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] |
| onConfirm={createGroup} | ||
| shouldHideListOnInitialRender={false} | ||
| canSelectMultiple | ||
| confirmButtonOptions={{ |
There was a problem hiding this comment.
❌ PERF-4 (docs)
Objects passed as props should be memoized to prevent unnecessary re-renders. Creating a new object literal on every render causes React to treat the prop as changed even when the actual data hasn't changed.
Suggested fix:
const confirmButtonOptions = useMemo(() => ({
showButton: !!selectedOptions.length,
text: translate('newChatPage.startGroup'),
onConfirm: createGroup,
}), [selectedOptions.length, translate, createGroup]);
// Then pass it to SelectionList:
<SelectionList
confirmButtonOptions={confirmButtonOptions}
// ... other props
/>| text: translate('newChatPage.startGroup'), | ||
| onConfirm: createGroup, | ||
| }} | ||
| customListHeader={ |
There was a problem hiding this comment.
❌ PERF-4 (docs)
JSX elements passed as props should be memoized to prevent unnecessary re-renders. Creating new JSX elements and style arrays on every render causes React to treat the prop as changed.
Suggested fix:
const customListHeader = useMemo(
() => (
<View style={[styles.mt8, styles.mb4, styles.justifyContentCenter]}>
<Text style={[styles.ph5, styles.textLabelSupporting]}>{translate('common.members')}</Text>
</View>
),
[styles, translate],
);
// Then pass it to SelectionList:
<SelectionList
customListHeader={customListHeader}
// ... other props
/>|
No product change, removing myself and unsubscribing |
| onSelectAll: () => void; | ||
|
|
||
| /** Whether to show 'Select all' button */ | ||
| shouldShowSelectAllButton: boolean; |
There was a problem hiding this comment.
Why don't we use onSelectAll to decide to show the select all button?
There was a problem hiding this comment.
Take a look below what is passed in the BaseSelectionList. Because of that we can't base the button on onSelectAll cause it is always present. This is related also to your second question :)
const handleSelectAll = useCallback(() => {
onSelectAll?.();
if (shouldShowTextInput && shouldPreventDefaultFocusOnSelectRow && innerTextInputRef.current) {
innerTextInputRef.current.focus();
}
}, [onSelectAll, shouldShowTextInput, shouldPreventDefaultFocusOnSelectRow]);
...
<ListHeader
dataDetails={dataDetails}
aboveListHeaderMessage={textInputOptions?.headerMessage}
customListHeader={customListHeader}
canSelectMultiple={canSelectMultiple}
onSelectAll={handleSelectAll}|
|
||
| /** Function called when the select all button is pressed */ | ||
| onSelectAll?: () => void; | ||
| onSelectAll: () => void; |
There was a problem hiding this comment.
I think it should be optional. Pls correct me if I'm wrong
|
@zfurtak Can you please merge main? I think the failed tests are not related to our PR |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2025-11-19.at.23.34.03.movAndroid: mWeb ChromeScreen.Recording.2025-11-19.at.23.31.51.moviOS: HybridAppScreen.Recording.2025-11-19.at.23.34.38.moviOS: mWeb SafariScreen.Recording.2025-11-19.at.23.31.22.movMacOS: Chrome / SafariScreen.Recording.2025-11-19.at.23.30.07.movMacOS: DesktopScreen.Recording.2025-11-19.at.23.35.04.mov |
|
✋ 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/grgia in version: 9.2.62-0 🚀
|
|
🚀 Deployed to production by https://github.com/marcaaron in version: 9.2.62-5 🚀
|
Explanation of Change
Fixed Issues
$ #72970
PROPOSAL:
Tests
Start chatNextOffline tests
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.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.mp4
Android: mWeb Chrome
iOS: Native
ios.mov
iOS: mWeb Safari
MacOS: Chrome / Safari
web.mov
MacOS: Desktop