From 273ac01d54c4f5c54beee7949546e60ba154001e Mon Sep 17 00:00:00 2001 From: dwindown Date: Sun, 9 Nov 2025 17:10:07 +0700 Subject: [PATCH] feat: Phase 1 - Improve shipping zone UI (remove redundancy) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Implemented modern, Shopify-inspired shipping interface improvements. Changes: ✅ Removed redundant "Settings" button from zone cards ✅ Added subtle Edit icon button for zone management ✅ Enhanced modal to be informational (not just toggles) ✅ Removed duplicate toggles from modal (use inline toggles instead) ✅ Added zone order display with context ✅ Show Active/Inactive badges instead of toggles in modal ✅ Better visual hierarchy and spacing ✅ Improved mobile drawer layout ✅ Changed "Close" to "Done" (better UX) ✅ Changed "Advanced Settings" to "Edit in WooCommerce" Modal Now Shows: - Zone name and regions in header - Zone order with explanation - All shipping methods with: * Method name and icon * Cost display * Active/Inactive status badge * Description (if available) - Link to edit in WooCommerce User Flow: 1. See zones with inline toggles (quick enable/disable) 2. Click Edit icon → View zone details 3. See all methods and their status 4. Click "Edit in WooCommerce" for advanced settings Result: Clean, modern UI with no redundancy ✅ --- admin-spa/src/routes/Settings/Shipping.tsx | 191 ++++++++++++--------- 1 file changed, 109 insertions(+), 82 deletions(-) diff --git a/admin-spa/src/routes/Settings/Shipping.tsx b/admin-spa/src/routes/Settings/Shipping.tsx index ea49c12..25b093d 100644 --- a/admin-spa/src/routes/Settings/Shipping.tsx +++ b/admin-spa/src/routes/Settings/Shipping.tsx @@ -119,7 +119,7 @@ export default function ShippingPage() { key={zone.id} className="border rounded-lg p-3 md:p-4 hover:border-primary/50 transition-colors" > -
+
@@ -127,27 +127,23 @@ export default function ShippingPage() {

{zone.name}

- Regions: {zone.regions} + {zone.regions}

- Rates: {zone.rates.length} shipping rate{zone.rates.length !== 1 ? 's' : ''} + {zone.rates.length} {zone.rates.length === 1 ? 'method' : 'methods'}

-
- -
+
{/* Shipping Rates */} @@ -224,62 +220,81 @@ export default function ShippingPage() { {selectedZone && ( isDesktop ? ( - + - {selectedZone.name} {__('Settings')} + {selectedZone.name} +

+ {selectedZone.regions} +

-

- {__('Configure shipping zone and methods. For advanced settings, use WooCommerce.')} -

-
-
-

{__('Zone Information')}

-

- {__('Name')}: {selectedZone.name} -

-

- {__('Regions')}: {selectedZone.regions} -

+
+ {/* Zone Summary */} +
+
+
+

{__('Zone Order')}

+

{__('Priority in shipping calculations')}

+
+ {selectedZone.order} +
+ + {/* Shipping Methods */}
-

{__('Shipping Methods')}

-
+
+

{__('Shipping Methods')}

+ + {selectedZone.rates?.length} {selectedZone.rates?.length === 1 ? 'method' : 'methods'} + +
+
{selectedZone.rates?.map((rate: any) => ( -
-
- {rate.name} - { - handleToggle(selectedZone.id, rate.instance_id, checked); - }} - disabled={togglingMethod === `${selectedZone.id}-${rate.instance_id}`} - /> +
+
+
+
+ + +
+
+ + {__('Cost')}: + + + {rate.description && ( + + )} +
+
+
+ + {rate.enabled ? __('Active') : __('Inactive')} + +
-

- {__('Price')}: -

))}
-
+
@@ -288,42 +303,54 @@ export default function ShippingPage() { - {selectedZone.name} {__('Settings')} + {selectedZone.name} +

+ {selectedZone.regions} +

-

- {__('Configure shipping zone and methods. For advanced settings, use WooCommerce.')} -

-
-
-

{__('Zone Information')}

-

- {__('Name')}: {selectedZone.name} -

-

- {__('Regions')}: {selectedZone.regions} -

+
+ {/* Zone Summary */} +
+
+
+

{__('Zone Order')}

+

{__('Priority in shipping calculations')}

+
+ {selectedZone.order} +
+ + {/* Shipping Methods */}
-

{__('Shipping Methods')}

-
+
+

{__('Shipping Methods')}

+ + {selectedZone.rates?.length} {selectedZone.rates?.length === 1 ? 'method' : 'methods'} + +
+
{selectedZone.rates?.map((rate: any) => (
-
- {rate.name} - { - handleToggle(selectedZone.id, rate.instance_id, checked); - }} - disabled={togglingMethod === `${selectedZone.id}-${rate.instance_id}`} - /> +
+
+
+ + +
+
+ {__('Cost')}:{' '} + +
+
+ + {rate.enabled ? __('Active') : __('Inactive')} +
-

- {__('Price')}: -

))}
@@ -338,11 +365,11 @@ export default function ShippingPage() { > - {__('Advanced Settings in WooCommerce')} + {__('Edit in WooCommerce')}