[NoQA] Clean code after finishing SelectionList migration#84880
[NoQA] Clean code after finishing SelectionList migration#84880zfurtak wants to merge 34 commits intoExpensify:mainfrom
SelectionList migration#84880Conversation
…s/@zfurtak/migrate-NewChatPage" This reverts commit 1f133a0.
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
|
|
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
SelectionList migrationSelectionList migration
|
@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] |
| if (!icon) { | ||
| return ( | ||
| <SingleSelectListItem | ||
| // eslint-disable-next-line react/jsx-props-no-spreading |
There was a problem hiding this comment.
❌ CONSISTENCY-5 (docs)
The eslint-disable-next-line react/jsx-props-no-spreading directive lacks a justifying comment explaining why the rule needs to be disabled here.
Add a comment explaining the reason, for example:
// eslint-disable-next-line react/jsx-props-no-spreading -- forwarding all SingleSelectListItem props from the wrapper component
{...props}Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.
|
|
||
| return ( | ||
| <SingleSelectListItem | ||
| // eslint-disable-next-line react/jsx-props-no-spreading |
There was a problem hiding this comment.
❌ CONSISTENCY-5 (docs)
The eslint-disable-next-line react/jsx-props-no-spreading directive lacks a justifying comment explaining why the rule needs to be disabled here.
Add a comment explaining the reason, for example:
// eslint-disable-next-line react/jsx-props-no-spreading -- forwarding all SingleSelectListItem props from the wrapper component
{...props}Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.
| import {act, fireEvent, render, screen, waitFor, within} from '@testing-library/react-native'; | ||
| import React from 'react'; | ||
| import {SectionList} from 'react-native'; | ||
| // eslint-disable-next-line no-restricted-imports |
There was a problem hiding this comment.
❌ CONSISTENCY-5 (docs)
The eslint-disable-next-line no-restricted-imports directive lacks a justifying comment explaining why the restricted import is needed.
Add a comment explaining the reason, for example:
// eslint-disable-next-line no-restricted-imports -- needed to spy on ScrollView.prototype.scrollTo for scroll behavior testing
import {ScrollView} from 'react-native';Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8d34784501
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| <SelectionListWithSections<OptionWithKey> | ||
| ref={selectionListRef} | ||
| ListItem={UserListItem} | ||
| sections={areOptionsInitialized ? sections : CONST.EMPTY_ARRAY} | ||
| textInputValue={searchTerm} | ||
| textInputHint={isOffline ? `${translate('common.youAppearToBeOffline')} ${translate('search.resultsAreLimited')}` : ''} | ||
| onChangeText={setSearchTerm} | ||
| textInputLabel={translate('selectionList.nameEmailOrPhoneNumber')} | ||
| headerMessage={headerMessage} | ||
| sections={areOptionsInitialized ? sections : getEmptyArray<Section<OptionWithKey>>()} | ||
| onSelectRow={selectOption} |
There was a problem hiding this comment.
Pass initial focused item key to new chat list
This migration drops the initial-focus wiring (firstKeyForList/initiallyFocusedOptionKey) when switching to SelectionListWithSections, so focusedIndex starts at -1 and the Enter/Ctrl+Enter handlers in BaseSelectionListWithSections are inactive until the user manually navigates with arrows. In practice, opening New Chat and pressing Enter from the search input no longer selects the top result/starts the 1:1 flow, which is a regression from the previous keyboard behavior.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Currently on staging, opening the new chat page, then pressing Enter from the input doesn't select the top item
src/components/Search/SearchList/ListItem/ExpenseReportListItem.tsx
Outdated
Show resolved
Hide resolved
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-03-16.at.10.30.54.movAndroid: mWeb ChromeScreen.Recording.2026-03-16.at.10.26.51.moviOS: HybridAppScreen.Recording.2026-03-16.at.10.31.56.moviOS: mWeb SafariScreen.Recording.2026-03-16.at.10.25.38.movMacOS: Chrome / SafariScreen.Recording.2026-03-16.at.10.22.39.mov |
|
@zfurtak good job. I left 1 minor comment; once you resolve it, I can approve |
grgia
left a comment
There was a problem hiding this comment.
I've been working on the. ASR fire, would you mind fixing conflicts?
|
Conflicts fixed, just waiting for #84887 to merge |
Explanation of Change
In this PR I:
SelectionListWithSectionsSearch/SearchList/ListItemNote
#84887 must be merged firstly
Fixed Issues
$ #65212
PROPOSAL:
Tests
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand 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: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari