-
Notifications
You must be signed in to change notification settings - Fork 131
[Woo POS][Coupons] Coupons search #14101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
[Woo POS][Coupons] Coupons search #14101
Conversation
Generated by 🚫 Danger |
📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
|
📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request introduces coupon search functionality to the Woo POS app by adding new string resources, analytics updates, new view models/screens, and navigation changes.
- Added new string resources and error messages for coupon search
- Renamed and updated analytics event properties for consistency
- Added new view models, composables, and data source support for searching coupons
- Updated toolbar and screen navigation logic to integrate the coupon search UI
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
WooCommerce/src/main/res/values/strings.xml | Introduces new localized strings for coupon search UI messages and error prompts. |
WooCommerce/src/main/kotlin/com/woocommerce/android/ui/woopos/util/analytics/WooPosAnalyticsEvent.kt | Renames the analytics event property from totalProductsCount to totalItemsCount. |
WooCommerce/src/main/kotlin/com/woocommerce/android/ui/woopos/home/items/search/WooPosCouponsSearchScreen.kt | Creates a new composable screen for coupon search with a placeholder implementation. |
WooCommerce/src/main/kotlin/com/woocommerce/android/ui/woopos/home/items/coupons/search/… | Adds view state, view model, UI events, and data source for handling coupon search. |
WooCommerce/src/main/kotlin/com/woocommerce/android/ui/woopos/home/items/WooPosItemsViewState.kt | Adjusts search state and visibility flags for coupon and product lists. |
WooCommerce/src/main/kotlin/com/woocommerce/android/ui/woopos/home/items/WooPosItemsToolbar.kt | Updates toolbar layout paddings and search state handling for coupons. |
WooCommerce/src/main/kotlin/com/woocommerce/android/ui/woopos/home/items/WooPosItemsSearchHelper.kt | Modifies search helper to select the appropriate search hint based on the list type. |
WooCommerce/src/main/kotlin/com/woocommerce/android/ui/woopos/home/items/WooPosItemsScreen.kt | Enhances navigation logic to include a separate screen state for coupon search. |
...lin/com/woocommerce/android/ui/woopos/home/items/coupons/search/WooPosCouponsSearchScreen.kt
Show resolved
Hide resolved
Row( | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.padding(start = WooPosSpacing.Medium.value.toAdaptivePadding()), | ||
.padding(start = WooPosSpacing.Medium.value.toAdaptivePadding(), end = 64.dp), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider extracting the hard-coded value '64.dp' into a design system constant to maintain consistent spacing across the app.
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This custom end padding is needed to uncover the search icon; Previously, the search icon was hidden behind "+" icon. To make it cleaner, we'd need to refactor the WooPosSearchInput
component, which needs to fill the whole width of the toolbar and show the search icon on its right end internally.
@@ -14,14 +14,15 @@ sealed class WooPosItemsViewState( | |||
) : WooPosItemsViewState( | |||
tabs = tabs, | |||
search = search, | |||
isAddCouponVisible = true, | |||
isAddCouponVisible = false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Please confirm that setting 'isAddCouponVisible' to false for the ProductList is intentional. If so, consider adding a comment to clarify why the add coupon button is hidden for this view.
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously the sarch button was behind the "+" button; now we are showing both buttons next to each other.
modifier: Modifier = Modifier, | ||
onUIEvent: (WooPosCouponsSearchUiEvent) -> Unit | ||
) { | ||
// TODO: implement recent coupon searches row |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBD in next PR: #14101
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a coupons search feature for Woo POS, enhancing the UI and analytics reporting for coupon-related actions.
- Adds localized strings for coupon search screens and error states.
- Updates analytics events and UI view states to support coupon search.
- Introduces new screens, view models, and data sources for handling coupon search functionality.
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
res/values/strings.xml | Added string resources for coupon search titles, empty states, and error messages. |
ui/woopos/util/analytics/WooPosAnalyticsEvent.kt | Renamed parameter from totalProductsCount to totalItemsCount for generalized reporting. |
ui/woopos/home/items/coupons/search/* | Introduced view state, view model, UI events, and composables for coupon search. |
ui/woopos/home/items/WooPosItemsViewState.kt & WooPosItemsViewModel.kt | Adjusted coupon list state configuration, including visibility of coupon creation action. |
ui/woopos/home/items/WooPosItemsToolbar.kt | Updated toolbar layout with additional end padding and minor spacing adjustments. |
ui/woopos/home/items/WooPosItemsSearchHelper.kt & WooPosItemsScreen.kt | Modified search helper and screen navigation logic to support coupon search state. |
Comments suppressed due to low confidence (1)
WooCommerce/src/main/res/values/strings.xml:4427
- The error description for coupon search still reuses the generic products error text. Consider adding a dedicated coupons error description for improved clarity and consistency on the coupons search screen.
<string name="woopos_search_items_error_description">Please try again.</string>
Coupons Search in Woo POS
Description
This PR adds coupons search feature in Woo POS.
💡 I added a "do not merge" label to wait for the follow-up PRs to be merged into this PR first, to ship the feature as a whole.
Next PRs:
Steps to reproduce
N/A
Testing information
The tests that have been performed
Above
Images/gif
Screen_recording_20250523_154316.mp4
RELEASE-NOTES.txt
if necessary. Use the "[Internal]" label for non-user-facing changes.