woocommerce-ios
woocommerce-ios copied to clipboard
[Split shipments] Hide disabled merge and remove shipments options
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:
- Hide "Merge all unfulfilled shipments" button when there are only 2 unfulfilled shipments
- Remove the ellipsis button when there are no remove / merge options available
- Hide remove / merge options instead of showing them as disabled in the removal options
Technical Implementation Details
- Introduced a new
@PublishedpropertyremovableShipmentsthat automatically updates based on the current state of shipments - Refactored
isMergeAllUnfulfilledAvailable()to returnfalsewhen there are 2 or fewer unfulfilled shipments - Modified
isShipmentDeleteOptionAvailable()to handle the case of single unfulfilled shipment more elegantly
Steps to reproduce
- Open an order with multiple items
- Navigate to the shipping label creation flow
- 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.txtif necessary.
📲 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 Name | WooCommerce iOS Prototype | |
| Build Number | 30548 | |
| Version | PR #15760 | |
| Bundle ID | com.automattic.alpha.woocommerce | |
| Commit | fc26a59320dbc319402b6b1040975c6b7176fd52 | |
| Installation URL | 373cnb71qp2sg |