Skip to content

Conversation

@irfano
Copy link
Contributor

@irfano irfano commented Sep 4, 2025

Part of WOOMOB-12

Description

This makes the selected hazmat box tappable. When tapped, it opens the hazmat screen, just like the "Are you shipping dangerous good or hazardous materials?" sentence above.

Steps to reproduce

  1. Go to Orders.
  2. Select an order that is eligible for creating shipping labels.
  3. Tap the "Create shipping label" button.
  4. Tap the "Are you shipping dangerous good or hazardous materials?" row.
  5. Check the "Contains hazardous materials" checkbox.
  6. Tap the "Select Category" button.
  7. Select a category.
  8. Tap the selected category shown in the gray box.

The tests that have been performed

Steps above.

Images/gif

Screenshot_20250905_021450
  • I have considered if this change warrants release notes and have added them to RELEASE-NOTES.txt if necessary. Use the "[Internal]" label for non-user-facing changes.

@irfano irfano added this to the 23.3 milestone Sep 4, 2025
@irfano irfano added feature: shipping labels Related to creating, ordering, or printing shipping labels. Enhancement labels Sep 4, 2025
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Sep 4, 2025

📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
App Name WooCommerce-Wear Android
Platform⌚️ Wear OS
FlavorJalapeno
Build TypeDebug
Commitba5afe7
Direct Downloadwoocommerce-wear-prototype-build-pr14576-ba5afe7.apk

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Sep 4, 2025

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

App Name WooCommerce Android
Platform📱 Mobile
FlavorJalapeno
Build TypeDebug
Commitba5afe7
Direct Downloadwoocommerce-prototype-build-pr14576-ba5afe7.apk

@codecov-commenter
Copy link

codecov-commenter commented Sep 4, 2025

Codecov Report

❌ Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 38.31%. Comparing base (986909c) to head (ba5afe7).
⚠️ Report is 6 commits behind head on trunk.

Files with missing lines Patch % Lines
...rs/wooshippinglabels/hazmat/HazmatSelectionCard.kt 0.00% 5 Missing ⚠️
...d/ui/orders/wooshippinglabels/hazmat/HazmatCard.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##              trunk   #14576      +/-   ##
============================================
- Coverage     38.31%   38.31%   -0.01%     
  Complexity     9659     9659              
============================================
  Files          2056     2056              
  Lines        114953   114955       +2     
  Branches      15252    15254       +2     
============================================
- Hits          44044    44042       -2     
- Misses        66881    66885       +4     
  Partials       4028     4028              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@hichamboushaba hichamboushaba left a comment

Choose a reason for hiding this comment

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

Looks good, thanks @irfano.

Comment on lines 25 to 26
onClick: OnClick? = null,
modifier: Modifier = Modifier
Copy link
Member

Choose a reason for hiding this comment

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

np, Modifier should be the first optional parameter, The IDE is also showing a warning about it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done: 3c1f1a1

Box(
modifier = Modifier
.fillMaxWidth()
.then(if (onClick == null) Modifier else Modifier.clickable { onClick() })
Copy link
Member

Choose a reason for hiding this comment

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

np, I would suggest changing the modifiers a bit to improve the click ripple effect, the following patch achieves a better effect:

patch
Index: WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/wooshippinglabels/hazmat/HazmatSelectionCard.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/wooshippinglabels/hazmat/HazmatSelectionCard.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/wooshippinglabels/hazmat/HazmatSelectionCard.kt
--- a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/wooshippinglabels/hazmat/HazmatSelectionCard.kt	(revision 95f3732633abe38fc6ec987e84d512a469a741a8)
+++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/wooshippinglabels/hazmat/HazmatSelectionCard.kt	(date 1757341157252)
@@ -12,6 +12,7 @@
 import androidx.compose.material3.Text
 import androidx.compose.runtime.Composable
 import androidx.compose.ui.Modifier
+import androidx.compose.ui.draw.clip
 import androidx.compose.ui.res.colorResource
 import androidx.compose.ui.res.dimensionResource
 import androidx.compose.ui.res.stringResource
@@ -30,11 +31,9 @@
         Box(
             modifier = Modifier
                 .fillMaxWidth()
+                .clip(RoundedCornerShape(dimensionResource(R.dimen.corner_radius_large)))
                 .then(if (onClick == null) Modifier else Modifier.clickable { onClick() })
-                .background(
-                    color = colorResource(R.color.light_colored_button_background),
-                    shape = RoundedCornerShape(dimensionResource(R.dimen.corner_radius_large))
-                )
+                .background(color = colorResource(R.color.light_colored_button_background))
                 .padding(16.dp)
         ) {
             Text(
Before After
Image Image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice catch, thank you! Applied your patch: 30982e1

@irfano irfano enabled auto-merge September 8, 2025 17:02
@irfano irfano merged commit 2ec9bef into trunk Sep 8, 2025
18 checks passed
@irfano irfano deleted the issue/WOOMOB-12-make-selected-hazmat-box-tappable branch September 8, 2025 17:47
- [*] Automatically populate the weight field in the create shipment flow [https://github.com/woocommerce/woocommerce-android/pull/14525]
- [*] [Shipping Labels] Fixed displaying incorrect hazardous material option for purchased labels [https://github.com/woocommerce/woocommerce-android/pull/14571]
- [*] Shipping Labels: Updated the disabled button text on the package selection screen [https://github.com/woocommerce/woocommerce-android/pull/14558]
- [*] Enhance the shipping label creation screen by making the selected hazardous box tappable [https://github.com/woocommerce/woocommerce-android/pull/14576]
Copy link
Member

Choose a reason for hiding this comment

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

@irfano it seems we both missed this and the release note was included in 23.2 (as noted by Huong here p1757419135627609/1757414420.859729-slack-C03L1NF1EA3).

Can you create a small PR to fix the release notes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh yes 🤦🏻‍♂️. I've opened a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement feature: shipping labels Related to creating, ordering, or printing shipping labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants