feat: add horizontal slide animation to region selector#24911
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
Implement carousel-style horizontal slide animation when drilling down from countries to states in the region selector bottom sheet. Changes: - Replace conditional rendering with side-by-side horizontal container pattern - Use single translateX animation value instead of separate values per list - Both FlatLists always mounted for instant bidirectional animation - Container slides left (-screenWidth) for state view, returns to origin for country view - 300ms animation duration with Easing.out for smooth transitions Technical improvements: - Avoid absolute positioning issues that broke FlatList rendering - Use overflow hidden on outer container to clip off-screen content - Explicit height constraints ensure proper rendering - Animation runs on UI thread via react-native-reanimated for 60fps performance Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…tion Update component snapshots to reflect the new side-by-side container structure used for horizontal slide animation. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
699c1f5 to
29089fa
Compare
| @@ -1,11546 +0,0 @@ | |||
| // Jest Snapshot v1, https://goo.gl/fbAQLP | |||
There was a problem hiding this comment.
Removing snapshot as I don't think it adds any value here
| it('renders the modal with region list', () => { | ||
| const { toJSON } = render(RegionSelectorModal); | ||
| expect(toJSON()).toMatchSnapshot(); | ||
| const { getByText, getByPlaceholderText } = render(RegionSelectorModal); | ||
|
|
||
| // Then all regions should be visible | ||
| expect(getByText('Portugal')).toBeOnTheScreen(); | ||
| expect(getByText('France')).toBeOnTheScreen(); | ||
| expect(getByText('Spain')).toBeOnTheScreen(); | ||
| expect(getByText('United States of America')).toBeOnTheScreen(); | ||
|
|
||
| // And the search field should be present | ||
| expect(getByPlaceholderText('Search by country')).toBeOnTheScreen(); | ||
| }); |
There was a problem hiding this comment.
The tests for this component weren't asserting for what the tests were describing but instead just checking snapshots matched!?
There was a problem hiding this comment.
FWIW I think the snapshots are a valid way to test the UI here. Your assertions are fine too but the snapshots should cover it.
96ccdf8 to
e680c29
Compare
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsThe changes are localized to the
These are UI/UX improvements that don't change the core functionality of region selection. The changes are well-contained within the RegionSelectorModal component and its styles. The
The risk is low because:
|
|



Description
Implements a smooth horizontal slide animation for the region selector bottom sheet when drilling down from countries to states and navigating back. This improves the user experience by providing visual feedback that clearly communicates the hierarchical navigation relationship.
What is the reason for the change?
The region selector lacked animation when transitioning between country and state views, making the navigation feel abrupt and unclear to users.
What is the improvement/solution?
translateXvalueEasing.outprovides smooth, polished transitionsChangelog
CHANGELOG entry: Added smooth slide animation when selecting regions with states in buy/sell flows
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/MDP-300
Manual testing steps
```gherkin
Feature: Region selector slide animation
Scenario: user drills down from country to state
Given the app is on the Buy or Sell screen
And the region selector bottom sheet is opened
Scenario: user navigates back from state to country view
Given the region selector is showing the state list
Scenario: user searches in both views
Given the region selector is open
Scenario: animation performs smoothly
Given the region selector is open
```
Screenshots/Recordings
Before
No animation - region list would instantly switch between country and state views without visual transition.
region.animation.before720.mov
After
Smooth 300ms horizontal slide animation provides clear visual feedback for drill-down navigation.
region.animation.after72-.mov
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Introduces a side-by-side list layout with animated horizontal transitions for clearer navigation between country and state selection.
react-native-reanimatedwithtranslateXandwithTimingto slide between views; addslistContainerOuter/Inner,listPanel, and updatedliststylesFlatListpanels simultaneously (countryListRef,stateListRef) and animates the container instead of conditionally rendering viewscountryFuseData/stateFuseDatawith respectivecountrySearchResults/stateSearchResults; maintains recommended-first sorting when no querystateData,activeView,regionInTransit), updates back/close behavior, and keeps scroll-to-top on search changesWritten by Cursor Bugbot for commit e680c29. This will update automatically on new commits. Configure here.