woocommerce-ios icon indicating copy to clipboard operation
woocommerce-ios copied to clipboard

[Split shipments] Hide disabled merge and remove shipments options

Open RafaelKayumov opened this issue 5 months ago • 1 comments

Part of: WOOMOB-582

Description

This PR improves the user experience in the Split Shipments view by refining the visibility and behavior of shipment management options. The changes ensure that users only see relevant actions based on the current state of their shipments.

Key improvements:

  1. Hide "Merge all unfulfilled shipments" button when there are only 2 unfulfilled shipments
  2. Remove the ellipsis button when there are no remove / merge options available
  3. Hide remove / merge options instead of showing them as disabled in the removal options

Technical Implementation Details

  • Introduced a new @Published property removableShipments that automatically updates based on the current state of shipments
  • Refactored isMergeAllUnfulfilledAvailable() to return false when there are 2 or fewer unfulfilled shipments
  • Modified isShipmentDeleteOptionAvailable() to handle the case of single unfulfilled shipment more elegantly

Steps to reproduce

  1. Open an order with multiple items
  2. Navigate to the shipping label creation flow
  3. Test the following scenarios:
    • Order has >2 of unfulfilled shipments. Ellipsis menu shows all unfulfilled shipments as deletable. “Merge all unfulfilled shipments” is available. Tapping on a deletion option presents a sheet that offer to choose the remaining unfulfilled shipments except the one being deleted.

    • Order has 2 of unfulfilled shipments. Ellipsis menu shows all 2 shipments as deletable. “Merge all unfulfilled shipments” is not displayed. Tapping on a deletion option presents a sheet that offer to choose the remaining unfulfilled shipment. It should be just 1 available option.

    • Order has just one unfulfilled shipment. The ellipsis button should not appear.

In other words - there should be no disabled options presented. If an option isn’t available - we hide it.

Repeat the steps above for orders with and without fulfilled shipments. The presence or absence of the fulfilled shipment should not affect the experiment since the fulfilled shipments don’t participate in splitting remaining shipments.

Demo

https://github.com/user-attachments/assets/3fdeefb9-c6a5-4bb9-9e1b-e950dbe4ae23


  • [ ] I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

RafaelKayumov avatar Jun 16 '25 20:06 RafaelKayumov

App Icon📲 You can test the changes from this Pull Request in WooCommerce iOS Prototype by scanning the QR code below to install the corresponding build.

App NameWooCommerce iOS Prototype
Build Number30548
VersionPR #15760
Bundle IDcom.automattic.alpha.woocommerce
Commitfc26a59320dbc319402b6b1040975c6b7176fd52
Installation URL373cnb71qp2sg
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

wpmobilebot avatar Jun 16 '25 21:06 wpmobilebot