Skip to content

Restore origin/destination swap in trip search - #689

Merged
GonzaloGM merged 7 commits into
masterfrom
invert-origin-destination
Sep 22, 2026
Merged

GonzaloGM merged 7 commits into
masterfrom
invert-origin-destination

Conversation

@GonzaloGM

Copy link
Copy Markdown
Contributor

Summary

  • Restores the swap control between origin and destination in trip search (home and search mode), which was broken after the search UI redesign left the button outside its positioned wrapper.
  • Adds swapSearchLocations helper with unit tests and view/CSS tests so swap markup, positioning, and behavior are covered.
  • Centralizes responsive swap icon styles in trips-search.css and adds i18n label invertirOrigenDestino.

Why tests were passing without the button

Existing SearchTrip.view.test.js coverage 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.js
  • npm run lint
  • npm run build
  • Backend composer test (no backend changes)
  • Manually verify swap button is visible on desktop /trips between origin and destination
  • Manually verify swap button on mobile search mode (Busco conductores/pasajeros) and that values invert correctly

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.
@GonzaloGM GonzaloGM changed the title feat(web): restore origin/destination swap in trip search Restore origin/destination swap in trip search Sep 22, 2026
@GonzaloGM
GonzaloGM merged commit 27eb957 into master Sep 22, 2026
@GonzaloGM
GonzaloGM deleted the invert-origin-destination branch September 22, 2026 15:01
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.

1 participant