Skip to content

feat: explicit Clear button to unselect pickup point - #30

Merged
hiagolcm merged 6 commits into
mainfrom
feature/pickup-point-clear-button
Jul 8, 2026
Merged

feat: explicit Clear button to unselect pickup point#30
hiagolcm merged 6 commits into
mainfrom
feature/pickup-point-clear-button

Conversation

@hiagolcm

@hiagolcm hiagolcm commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

Workspace
Jira

Replaces the implicit "click the selected pickup to unselect" behavior with an explicit Clear button.

Screen.Recording.2026-06-24.at.23.41.34.mov

Spec

Spec (SDD Lite): vtex-apps/is-io-specs#10 — https://github.com/vtex-apps/is-io-specs/pull/10

Test plan

  • PickupList unit tests: no-op on re-select, auto-select on first pick, Clear visibility (allowed/not-allowed/no-selection), Clear triggers unselect, Update + Clear coexist.
  • ShippingMethodSelector passes canUnselect = !required.
  • PickupPointSelector passes canUnselect = true.
  • yarn lint (0 errors) and yarn test green.

Made with Cursor

@vtex-io-ci-cd

vtex-io-ci-cd Bot commented Jun 25, 2026

Copy link
Copy Markdown

Hi! I'm VTEX IO CI/CD Bot and I'll be helping you to publish your app! 🤖

Please select which version do you want to release:

  • Patch (backwards-compatible bug fixes)

  • Minor (backwards-compatible functionality)

  • Major (incompatible API changes)

And then you just need to merge your PR when you are ready! There is no need to create a release commit/tag.

  • No thanks, I would rather do it manually 😞

@vtex-io-docs-bot

vtex-io-docs-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown

Beep boop 🤖

I noticed you didn't make any changes at the docs/ folder

  • There's nothing new to document 🤔
  • I'll do it later 😞

In order to keep track, I'll create an issue if you decide now is not a good time

  • I just updated 🎉🎉

@riccoutinho riccoutinho left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The usability worked great!

One thing that is worth mentioning is that when scrolling to the bottom of a long list, the floating buttons lack padding.

Image

Comment thread react/components/PickupSelection/PickupList.tsx
Comment thread react/components/PickupSelection/PickupList.tsx Outdated
hiagolcm and others added 5 commits July 1, 2026 12:24
Co-authored-by: Cursor <cursoragent@cursor.com>
Clicking the already-selected pickup point is now a no-op. Unselecting is
done via an explicit Clear button shown at the bottom of the list (beside
Update when a different point is highlighted), gated on canUnselect so it
only appears where unselecting is permitted (non-required shipping-method
selector). Threads canUnselect through PickupSelection/PickupList and adds
the clearButtonContainer CSS handle and pickupPointList.clearButton.label
message in all locales.

Co-authored-by: Cursor <cursoragent@cursor.com>
- pickup-point-selector hardcodes canUnselect=true (no required prop)
- Clear button uses the secondary Button variation and renders directly
  (no wrapper div), matching the Open Beta Figma design
- add PickupPointSelector canUnselect wiring test

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Add clearButton and updateButton CSS handles so merchants can style the
Clear and Update buttons independently on the pickup point list.

Introduce onClearPickup handler that dispatches RESET_FULFILLMENT_METHOD
instead of re-dispatching UPDATE_PICKUP when clearing. This skips the BFF
availability check since clearing only broadens availability, resulting
in a faster clear path with the same session cleanup.

Co-authored-by: Cursor <cursoragent@cursor.com>
@hiagolcm
hiagolcm force-pushed the feature/pickup-point-clear-button branch from b1aa674 to e5181e0 Compare July 1, 2026 15:26
@hiagolcm

hiagolcm commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator Author

One thing that is worth mentioning is that when scrolling to the bottom of a long list, the floating buttons lack padding.

Good catch @riccoutinho. Fixed

image

Fix the pickup-point-selector modal staying open after a pickup is
selected or cleared. The soft-refresh feature (1.2.0) removed the
location.reload() that used to tear the modal down; ShippingMethodSelector
was updated with an auto-close effect on fulfillmentSelectionAppliedId,
but PickupPointSelector was missed. Mirror the same effect here so the
modal closes on UPDATE_PICKUP and RESET_FULFILLMENT_METHOD.

Also add bottom padding to the pickup point list when the floating
Clear / Update button bar is visible so the last item is scrollable
fully above the buttons.

Co-authored-by: Cursor <cursoragent@cursor.com>
@hiagolcm
hiagolcm requested a review from iago1501 July 1, 2026 15:55
@hiagolcm
hiagolcm merged commit e928ee1 into main Jul 8, 2026
7 checks passed
@vtex-io-ci-cd

vtex-io-ci-cd Bot commented Jul 8, 2026

Copy link
Copy Markdown

Your PR has been merged! App is being published. 🚀
Version 1.2.0 → 1.3.0

After the publishing process has been completed (check #vtex-io-releases) and doing A/B tests with the new version, you can deploy your release by running:

vtex deploy vtex.delivery-promise-components@1.3.0

After that your app will be updated on all accounts.

For more information on the deployment process check the docs. 📖

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.

3 participants