Skip to content

feat: add searchable country dropdown and fix dropdown UX#1127

Merged
descorp merged 9 commits into
developfrom
feature/country-dropdown
Jun 19, 2026
Merged

feat: add searchable country dropdown and fix dropdown UX#1127
descorp merged 9 commits into
developfrom
feature/country-dropdown

Conversation

@descorp

@descorp descorp commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Replaces the free-text country/currency inputs in the Settings screen with a searchable full-screen dropdown backed by a predefined ISO country list. Also introduces a generic FormDropdown component used across Card, Apple Pay, and Google Pay settings views.

Changes

  • FormDropdown — new generic dropdown component with two modes:
    • Compact (overlay modal) — used for short enum lists (address visibility, shipping type, etc.)
    • Full-screen with search (FormSearchDropdown) — used for long lists (country codes)
  • SettingsView — country field replaced with FormSearchDropdown (full-screen, searchable); currency is now derived automatically from the selected country
  • CardSettingsView — address visibility, KCP visibility, social security switched to FormDropdown
  • ApplePaySettingsView — shipping type switched to FormDropdown
  • GooglePaySettingsView — total price status switched to FormDropdown
  • CountryView + getFlagEmoji — displays selected country with flag emoji in the checkout header
  • PageScrollView — new reusable component encapsulating ScrollView with Styles.page and dynamic safe-area-aware bottom padding; applied to all 5 settings views and PaymentMethodsView
  • Bug fix — inner menu View replaced with Pressable to prevent overlay dismissal when tapping empty space inside the dropdown
  • UX — chevron indicator added to dropdown trigger; row layout in Styles.dropdown

Screenshots

Screenshot_20260618_165048_AdyenExample Screenshot_20260618_165057_AdyenExample

descorp added 3 commits June 18, 2026 15:54
Replace separate Country and Currency text inputs with a single
country dropdown that automatically sets the currency. The dropdown
displays full country names with currency codes (e.g., "Canada - CAD")
and opens in a full-screen modal with a search bar for easy filtering.

- Add COUNTRY_DATA mapping with 37 country-currency pairs in assets
- Enhance FormDropdown with labelExtractor and fullScreen props
- Add search functionality to filter options by name or currency
- Add full-screen modal styles with header and search bar

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a country and currency data helper, replaces the text inputs in the settings view with a new searchable, full-screen dropdown component, and improves layout padding using safe area insets. The review feedback provides several valuable improvements: ensuring cross-platform safe area support by importing SafeAreaView from react-native-safe-area-context, avoiding inline default prop functions to preserve memoization performance, replacing nested TouchableOpacity components with Pressable to prevent gesture conflicts with FlatList, and establishing a minimum bottom padding when safe area insets are zero.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread example/src/components/common/FormDropdown.tsx Outdated
Comment thread example/src/components/common/FormDropdown.tsx Outdated
Comment thread example/src/components/common/FormDropdown.tsx Outdated
Comment thread example/src/components/Checkout/components/PaymentMethodsView.tsx Outdated
@descorp

descorp commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the settings and payment methods views by introducing safe area insets for bottom padding and replacing manual country/currency text inputs with a new searchable dropdown component (FormSearchDropdown). Feedback on these changes suggests wrapping key handlers and list renderers in useCallback within FormSearchDropdown to avoid performance degradation during typing, and adding a base padding offset to insets.bottom in PaymentMethodsView to ensure proper spacing on devices without a bottom safe area.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread example/src/components/Settings/common/FormSearchDropdown.tsx Outdated
Comment thread example/src/components/Checkout/components/PaymentMethodsView.tsx Outdated
@descorp

descorp commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a searchable country dropdown in the settings view, supported by a new country data asset and reusable dropdown components (DropdownTrigger, FormDropdown, and FormSearchDropdown). It also integrates safe area insets for better layout padding on modern devices. The review feedback focuses on performance optimizations, such as memoizing list render functions using useCallback, improving runtime safety by handling potential null or undefined values in label extraction, and enhancing user experience by dismissing the keyboard when scrolling the search results.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread example/src/components/Settings/common/FormDropdown.tsx Outdated
Comment thread example/src/components/Settings/common/FormDropdown.tsx Outdated
Comment thread example/src/components/Settings/common/FormSearchDropdown.tsx
Comment thread example/src/components/Settings/common/FormSearchDropdown.tsx
Comment thread example/src/assets/countries.ts
@descorp

descorp commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a country and currency dataset, refactors multiple settings views to use a new PageScrollView component that respects safe area insets, and replaces the old dropdown component with a modularized FormDropdown and a searchable FormSearchDropdown. Feedback focuses on performance and layout robustness: memoizing inline styles in PageScrollView to avoid unnecessary re-renders, using readonly T[] in dropdown props to support readonly arrays, and replacing a fragile hardcoded spacer in the search modal header with absolute positioning for the Cancel button.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread example/src/components/common/PageScrollView.tsx Outdated
Comment thread example/src/components/Settings/common/FormDropdown.tsx
Comment thread example/src/components/Settings/common/FormSearchDropdown.tsx
Comment thread example/src/components/Settings/common/FormSearchDropdown.tsx
Comment thread example/src/components/common/Styles.ts
@descorp

descorp commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new country and currency dataset, modularizes settings dropdowns with new DropdownTrigger, FormDropdown, and FormSearchDropdown components, and replaces standard ScrollViews with a custom PageScrollView to handle safe area insets. Feedback from the review suggests improving the robustness of country helper functions by normalizing inputs, resolving potential Android scroll interference in FormDropdown by replacing a Pressable with a View, enhancing the search UX with autoFocus and an empty list state in FormSearchDropdown, and adding accessibility attributes to the DropdownTrigger component.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread example/src/assets/countries.ts
Comment thread example/src/components/Settings/common/FormDropdown.tsx
Comment thread example/src/components/Settings/common/FormSearchDropdown.tsx
Comment thread example/src/components/Settings/common/FormSearchDropdown.tsx
Comment thread example/src/components/Settings/common/DropdownTrigger.tsx
@sonarqubecloud

Copy link
Copy Markdown

@descorp descorp merged commit ecb2cba into develop Jun 19, 2026
11 checks passed
@descorp descorp deleted the feature/country-dropdown branch June 19, 2026 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants