Reapply "Merge pull request #81869 from software-mansion-labs/@zfurtak/migrate-NewChatPage"#84887
Conversation
…s/@zfurtak/migrate-NewChatPage" This reverts commit 1f133a0.
|
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
|
|
|
@codex review |
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.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 958f304190
ℹ️ 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".
| import SelectionList from '@components/SelectionListWithSections'; | ||
| import type {ListItem, SelectionListHandle} from '@components/SelectionListWithSections/types'; | ||
| import UserListItem from '@components/SelectionListWithSections/UserListItem'; | ||
| import UserListItem from '@components/SelectionList/ListItem/UserListItem'; |
There was a problem hiding this comment.
Restore screen-reader access to Add-to-group button
This migration switches New Chat to the shared SelectionList UserListItem, but that variant does not apply the accessible-grouping override that the previous SelectionListWithSections/UserListItem used when a rightHandSideComponent is present. On rows that show the Add to group control, screen readers can end up treating the whole row as one focus target, making the nested action difficult or impossible to activate independently.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Tested it, working on it.
| <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 an initial focused item key for keyboard Enter flow
The new list invocation no longer provides an initial focused item key, so the selection list starts with focusedIndex = -1. In BaseSelectionListWithSections, the Enter shortcut is active only when focusedIndex >= 0, which means keyboard users opening New Chat can no longer press Enter immediately to select/open the first result until they first move focus with arrows or change search text.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
This was covered in original PR. https://github.com/Expensify/App/pull/81869/changes#r2823010458
|
@codex review |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 226877f53f
ℹ️ 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".
| if (!accessible) { | ||
| return { | ||
| role: CONST.ROLE.PRESENTATION, | ||
| tabIndex: -1, |
There was a problem hiding this comment.
Handle undefined accessible as enabled
getAccessibilityProps() now branches on if (!accessible), but accessible is optional and most BaseListItem callers do not pass it. In those common cases (accessible is undefined), this path forces role to presentation, tabIndex to -1, and accessible to false, which removes row accessibility labels and keyboard tab focusability across selection lists. This should only happen when accessible is explicitly false.
Useful? React with 👍 / 👎.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d2a78630e5
ℹ️ 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".
| const shouldUseIconPolicyID = !item.reportID && !item.accountID && !item.policyID; | ||
| const policyID = isThereOnlyWorkspaceIcon && shouldUseIconPolicyID ? String(item.icons?.at(0)?.id) : item.policyID; | ||
|
|
||
| const shouldDisableAccessibleGrouping = !!rightHandSideComponent && !canSelectMultiple; |
There was a problem hiding this comment.
Gate accessibility ungrouping on rendered right-side control
shouldDisableAccessibleGrouping now keys off !!rightHandSideComponent, which is always true when a callback is provided, even when that callback returns null for a given row (e.g., NewChatPage rows for self-DM or excluded emails). That means those rows still get accessible={false} on the main pressable without an actual sibling action to justify ungrouping, so per-row accessibility semantics regress compared with the previous behavior that checked the rendered right component.
Useful? React with 👍 / 👎.
| <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.
Restore initial focused item for keyboard-first New Chat flow
This migration removed the initial-focus key wiring, so the list starts with focusedIndex = -1 and the Enter shortcut is inactive until the user manually changes focus. Before this change, NewChatPage set the first option key explicitly, allowing keyboard users to open/select the top result immediately with Enter; that behavior is now lost on initial render.
Useful? React with 👍 / 👎.
|
@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] |
| Log.warn('SelectionListWithSections: error scrolling to index', {error}); | ||
| } | ||
| }; | ||
| const scrollToIndex = useCallback( |
There was a problem hiding this comment.
❌ CLEAN-REACT-PATTERNS-0 (docs)
React Compiler is enabled in this codebase and automatically memoizes closures based on their captured variables. Wrapping scrollToIndex in useCallback is redundant and may interfere with the compiler's optimization model.
Remove the useCallback wrapper and use a plain function:
const scrollToIndex = (index: number) => {
if (index < 0 || index >= flattenedData.length || !listRef.current) {
return;
}
// ...
};Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.
There was a problem hiding this comment.
It was added previously when linter was providing a warning, but now it can be removed since compiler does memoize this function correctly.
|
PR doesn’t need product input as a migration PR. Unassigning and unsubscribing myself. |
|
@dukenv0307 I've addressed bot's comments. I had to add some additional changes to mock files as described in description. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-03-18.at.16.51.38.movAndroid: mWeb ChromeScreen.Recording.2026-03-18.at.16.46.38.moviOS: HybridAppScreen.Recording.2026-03-18.at.16.48.08.moviOS: mWeb SafariScreen.Recording.2026-03-18.at.16.44.50.movMacOS: Chrome / SafariScreen.Recording.2026-03-18.at.16.43.09.mov |
patches/@shopify/flash-list/@shopify+flash-list+2.2.0+002+skip-layout-when-hidden.patch
Outdated
Show resolved
Hide resolved
|
🚧 @mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ 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/mountiny in version: 9.3.42-0 🚀
Bundle Size Analysis (Sentry): |
cc: @IuliiaHerets |
|
Deploy Blocker #86089 was identified to be related to this PR. |
|
🚀 Deployed to production by https://github.com/grgia in version: 9.3.42-3 🚀
|
Explanation of Change
Aside from reapplying the original PR, a patch to FlashList is introduced that solves the issue that blocked the deploy of the original PR.
Refactor done:
Fixed Issues
$ #65658
PROPOSAL:
Tests
Offline tests
QA Steps
Same as tests
Offline tests
QA Steps
Same as tests
// TODO: These must be filled out, or the issue title must include "[No QA]."
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: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Flash.List.Big.size.mp4