Restore origin/destination swap in trip search - #689
Merged
Merged
Conversation
Cover swap button markup, positioning, and swapSearchLocations helper so regressions are caught after the search UI redesign removed visible swap.
Anchor the swap control inside the origin field wrapper and reuse a shared swapSearchLocations helper so desktop positioning and swapping work again.
Move responsive swap icon rules into trips-search.css so SearchTrip markup and shared search styles stay aligned.
Shrink the desktop Fecha input and widen field gaps so the origin/destination swap control no longer overlaps the destination field.
Use a flex item between the fields instead of absolute positioning inside origin, which overlapped the input clear button.
Center the swap control vertically with desktop inputs using tighter side margins, reduce row gap, and center the icon horizontally on mobile.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
swapSearchLocationshelper with unit tests and view/CSS tests so swap markup, positioning, and behavior are covered.trips-search.cssand adds i18n labelinvertirOrigenDestino.Why tests were passing without the button
Existing
SearchTrip.view.test.jscoverage only asserted advanced filters and mobile submit behavior. The swap markup remained in the component, but it was not tested and desktop CSS (position: absolute) no longer worked because the button was a sibling of the origin field instead of inside the positioned wrapper.Test plan
npm run test:unit -- --run src/utils/swapSearchLocations.test.js src/components/sections/SearchTrip.view.test.jsnpm run lintnpm run buildcomposer test(no backend changes)/tripsbetween origin and destination