Repository navigation
[Payment due @ZhenjaHorbach] [Dynamic Forms] Deprecate Push Rows - #106984
Conversation
|
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
# Conflicts: # src/CONST/SENTRY_LABEL.ts # src/components/MoneyRequestConfirmationList/sections/AmountField.tsx # src/components/MoneyRequestConfirmationList/sections/DescriptionField.tsx # tests/unit/components/MoneyRequestConfirmationList/ReportFieldDropdownRow.test.tsx
|
While checking the behavior of the new dropdown, I encountered a problem with resizing a window shown below: 1.Wallet.-.High.memory.usage.-.2.5.GB.-.Google.Chrome.Te.2026-11-17.at.16.03.10.mov |
mikolajpochec
left a comment
There was a problem hiding this comment.
Good job! Leaving a few comments
| const [searchValue, setSearchValue, matchingOptions, searchQuery] = useSearchResults(options, (option, searchInput) => { | ||
| if (option.searchValue === undefined) { | ||
| return tokenizedSearch([option], searchInput, () => [option.text]).length > 0; | ||
| } | ||
| // A query of only punctuation sanitizes to nothing and matches no option, as in the country selector | ||
| const sanitizedInput = StringUtils.sanitizeString(searchInput); | ||
| return !!sanitizedInput && option.searchValue.includes(sanitizedInput); | ||
| }); | ||
|
|
||
| // An option whose own value was typed, such as the country code `US`, goes first, as the country selector lists it | ||
| const sanitizedQuery = StringUtils.sanitizeString(searchQuery); | ||
| const isTypedValue = (option: {value: string; searchValue?: string}) => option.searchValue !== undefined && !!sanitizedQuery && option.value.toLowerCase() === sanitizedQuery; | ||
| const filteredOptions = [...matchingOptions.filter(isTypedValue), ...matchingOptions.filter((option) => !isTypedValue(option))]; |
There was a problem hiding this comment.
NAB
Typing "bar" lists Antigua & Barbuda before Barbados, while the old country picker showed Barbados first. This list only moves an exact code match to the top, but searchOptions also ranks names that start with the query (and accents). countryMultiselect already uses searchOptions, so both country fields would sort the same.
Could we use searchOptions(searchQuery, options) when options have a searchValue?
| const applyValues = (appliedValues: string[]) => { | ||
| if (haveSameValues(appliedValues, offeredSelectedValues)) { | ||
| return; | ||
| } |
There was a problem hiding this comment.
NAB
If a multiselect ever gets dependsOn (DynamicFormMultiChoiceField picks it from DynamicFormChoiceField), a held value that drops out of the options stays in the form. Applying without changes returns early here, so the hidden value is still submitted. This also contradicts the "applying drops it" comment in MultiValueSelectionList. No such field today (industryCategories has a fixed list), so fine to leave, just flagging for later.
| * button, as the attendees row applies its selection. A field that asks the server for new requirements therefore asks | ||
| * once per Apply rather than once per checked option. | ||
| */ | ||
| function MultiChoiceDropdownAdapter({items, label, title, value, onInputChange, errorText = '', disabled = false, forwardedFSClass, ref}: MultiChoiceDropdownAdapterProps) { |
There was a problem hiding this comment.
Before: open a required multiselect, close it without picking anything, and the "required" error shows right away. Now the error shows only after pressing Submit. Is that on purpose?
|
@grgia @joekaufmanexpensify @ZhenjaHorbach feel free to run adhoc builds on this PR and test it out, let me know what you think! |
Thanks for reporting this! I managed to reproduce this issue, but it seems to be present on main branch as well, so I think it would be good to fix it in a separate PR :) |
| includePaddingTop={false} | ||
| enableEdgeToEdgeBottomSafeAreaPadding | ||
| testID="DynamicFormFullPageList" | ||
| shouldEnableKeyboardAvoidingView={false} |
There was a problem hiding this comment.
Minor comment
We use shouldEnableKeyboardAvoidingView={false} here, while on main the multiselect's PushRowModal kept keyboard avoiding on
With a searchable multiselect on the full page, I suppose the keyboard covers the Apply footer on iOS
There was a problem hiding this comment.
Good catch! addressed
| }; | ||
|
|
||
| return ( | ||
| <DynamicFormDropdownField |
There was a problem hiding this comment.
Should we add accessibilityLabel here also?
There was a problem hiding this comment.
No need here: without accessibilityLabel the row reads its own name and value, and the name is the field’s own label. The currency adapter takes one only because its label is the generic “Currency” next to an amount, so it adds which amount it belongs to.
| label={label} | ||
| value={displayValue} | ||
| title={title} | ||
| errorText={errorText} |
There was a problem hiding this comment.
Should we add accessibilityLabel here also?
There was a problem hiding this comment.
Same as above: the row already reads the field’s label and the picked options :)
| footerContent={ | ||
| <Button | ||
| variant={CONST.BUTTON_VARIANT.SUCCESS} | ||
| onPress={applyValues} | ||
| size={CONST.BUTTON_SIZE.MEDIUM} | ||
| sentryLabel={applyButtonSentryLabel} | ||
| > | ||
| <Button.KeyboardShortcut /> | ||
| <Button.Text>{translate('common.apply')}</Button.Text> | ||
| </Button> | ||
| } |
There was a problem hiding this comment.
On a phone with a home indicator, the Apply button on the full page list will probably sit right at the bottom edge of the screen, under the indicator. I have not checked this on a device.
The full page uses edge-to-edge mode, so the modal does not add the bottom inset, and the SelectionList footer does not add it by default either. Maybe this list could take an addBottomSafeAreaPadding prop, and renderFullPageList could pass it, like CurrencyDropdownAdapter already does?
There was a problem hiding this comment.
Good catch, added addBottomSafeAreaPadding to MultiValueSelectionList and passed it from renderFullPageList in MultiChoiceDropdownAdapter.
| <ValueSelectionList | ||
| items={items} | ||
| selectedItem={selectedItem} | ||
| isVisible={isVisible} | ||
| onItemSelected={(item) => { | ||
| onItemSelected?.(item); | ||
| onClose(); | ||
| }} | ||
| addBottomSafeAreaPadding={false} | ||
| /> |
There was a problem hiding this comment.
On a phone, a field with 12 or more options will probably open its bottom sheet with the keyboard already up, so the keyboard covers most of the list. I have not checked this on a device.
ValueSelectionList, MultiValueSelectionList and CurrencySelectionList do not set disableAutoFocus, so the search input takes focus as soon as the list opens. The category, tag and tax popovers turn this off on touch screens with canFocusInputOnScreenFocus() (CategoryPicker/index.tsx:252). Could we do the same here?
There was a problem hiding this comment.
Agreed, added shouldAutoFocusSearchInput to the three lists, and the popovers pass canFocusInputOnScreenFocus() like the category/tag/tax pickers.
| /** | ||
| * Whether the fields render inside a modal, such as the list entry editor. A dropdown's container draws below every | ||
| * modal, so a dropdown inside one opens its list on a full page over the modal instead. | ||
| */ | ||
| const DynamicFormModalContext = createContext(false); |
There was a problem hiding this comment.
This works today, but the next modal that shows form fields can easily get a dropdown that opens behind the modal. The user would press the row and see nothing, with no error and no failing test.
BaseModal already tells its children that they are inside a modal through ModalContext, and ScreenWrapperContainer reads it the same way. This second context needs a provider added by hand in every modal. Could we remove it and read !useContext(ModalContext).default in DynamicFormDropdownField instead?
There was a problem hiding this comment.
Makes sense, removed DynamicFormModalContext and the field now reads !useContext(ModalContext).default
|
🚧 joekaufmanexpensify has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
joekaufmanexpensify
left a comment
There was a problem hiding this comment.
Working well for me 👍
This one has been addressed! Screen.Recording.2026-11-20.at.11.56.02.mov |
|
@WojtekBoman could you send a list of which issues you fixed and which you plan to address as follow ups from the above thread |
grgia
left a comment
There was a problem hiding this comment.
LGTM. Let's track the follow ups / decisions made in this PR before merging
|
🚧 grgia has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
|
Follow-ups
|
This also happens on main, e.g. the Report dropdown when creating an expense (video attached). It comes from how our list component renders its first rows, not from this PR :) main-report-dropdown-android-slowmo-4x.mp4 |
|
@grgia Here's the comment describing all followups that we should address after merging this PR :) I think we should be ready to go ahead with this one 🫡 |
|
🚧 grgia has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/grgia in version: 9.5.53-0 🚀
|
|
No help site update needed — this PR changes existing form fields to dropdowns without introducing a new workflow, removing beta gating, or making any existing article sentence incorrect. |
|
This PR failing in offline mode because of the issue #107820 |
|
Deploy Blocker #107857 was identified to be related to this PR. |
|
🚀 Deployed to production by https://github.com/arosiclair in version: 9.5.53-3 🚀
Bundle Size Analysis (Sentry): |
|
Follow-ups update:
That covers all the follow-ups from this PR cc: @grgia @ZhenjaHorbach |
Explanation of Change
Renders DynamicForm select, country, currency and multiselect fields as the expense form's bordered dropdown rows instead of push rows. Moves
ExpenseFieldRow/ExpenseFieldDropdownto sharedDropdownFieldRow/DropdownField, adds dropdown adapters, popover pickers, and a full-page list fallback for no room or inside a modal.Fixed Issues
$ https://github.com/Expensify/Expensify/issues/700999
PROPOSAL:
Tests
Go to Settings > Wallet > Add bank account and pick a country handled by Wise (e.g. United Kingdom)
Continue to a page with a select field (e.g. account type) and a country field
Verify that each field shows as a bordered row with the field name as placeholder, like the expense form's category row
Press the select row and verify that a dropdown opens anchored to the row; pick an option and verify that it closes and the row shows the picked value
Press the country row, type an ISO code (e.g.
GB) into search and verify that the matching country is listed; pick it and verify that the row updatesVerify that no errors appear in the JS console
In the same flow, reach a page with a currency field (or an amount field with its currency)
Press the currency row and verify that a dropdown opens with a searchable currency list; pick one and verify that the row shows it
Reach a page with a multiselect field, press it, select two options, press Apply
Verify that the row lists both picks, and that closing without Apply leaves the previous value
Verify that no errors appear in the JS console
On a narrow layout (mobile or a narrow browser window), open a page with a required select field
Press Next without answering and verify that the row shows the error under it and gets focus
Press the row and verify that the list opens (sheet, or a full page when there is no room) and picking a value clears the error
In a list field (e.g. add an entry to a repeated section), press a select row inside the entry modal and verify that the list opens on a full page over the modal, not hidden behind it
Expense form: create a manual expense and verify that the amount, description, category, tag and report rows still look and open as before
Verify that no errors appear in the JS console
Offline tests
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)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.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