Skip to content

Conversation

@kidinov
Copy link
Contributor

@kidinov kidinov commented Dec 4, 2025

Description

Makes WooPosSpacing.value automatically return adaptive padding based on screen size, eliminating the need for manual .toAdaptivePadding() calls throughout the codebase.

Changes:

  • Modified WooPosSpacing enum to have a composable getter that automatically applies adaptive scaling
  • Added new spacing values: XXSmall (2dp), XXLarge (40dp), XXXLarge (48dp), Huge (80dp), Gigantic (104dp)
  • Migrated all raw Dp spacing usages to use WooPosSpacing values
  • Removed redundant .toAdaptivePadding() calls and cleaned up unused imports

Note: Some spacing values are mapped to the closest available enum value (e.g., 56dp → 48dp, 96dp → 80dp), so minor visual differences may be visible compared to before.

Test Steps

  1. Open Woo POS on different tablet sizes (small, medium, large)
  2. Navigate through various screens (items list, cart, totals, payment success/failed, settings)
  3. Verify spacing looks appropriate and scales with screen size
  4. Check that UI elements are properly spaced on smaller tablets
image image image image
  • 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.

Changed WooPosSpacing enum so that .value is now a composable getter
that automatically applies toAdaptivePadding(). This makes all spacing
adaptive by default without requiring manual calls.

For ConstraintLayout usages, extracted margin values before the
constrainAs lambda since it's not a composable context.
Since WooPosSpacing.value is now adaptive by default, removed redundant
.toAdaptivePadding() calls on WooPosSpacing values and cleaned up
unused imports across WooPos screens.
@dangermattic
Copy link
Collaborator

dangermattic commented Dec 4, 2025

1 Warning
⚠️ This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.

Generated by 🚫 Danger

@kidinov kidinov changed the title [Woo POS] Make WooPosSpacing automatically adaptive [HACK][Woo POS] Make WooPosSpacing automatically adaptive Dec 4, 2025
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Dec 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 NameWooCommerce-Wear Android
Platform⌚️ Wear OS
FlavorJalapeno
Build TypeDebug
Commite5ef710
Direct Downloadwoocommerce-wear-prototype-build-pr15060-e5ef710.apk

@kidinov kidinov requested a review from samiuelson December 4, 2025 11:16
@kidinov kidinov added this to the 23.9 milestone Dec 4, 2025
@kidinov kidinov marked this pull request as ready for review December 4, 2025 11:16
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Dec 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 NameWooCommerce Android
Platform📱 Mobile
FlavorJalapeno
Build TypeDebug
Commite5ef710
Direct Downloadwoocommerce-prototype-build-pr15060-e5ef710.apk

@codecov-commenter
Copy link

codecov-commenter commented Dec 4, 2025

Codecov Report

❌ Patch coverage is 0% with 102 lines in your changes missing coverage. Please review.
✅ Project coverage is 38.66%. Comparing base (d62c547) to head (e5ef710).

Files with missing lines Patch % Lines
.../woopos/scanningsetup/WooPosScanningSetupDialog.kt 0.00% 44 Missing ⚠️
...i/woopos/home/toolbar/WooPosHomeFloatingToolbar.kt 0.00% 14 Missing ⚠️
...oopos/common/composeui/designsystem/WooPosSizes.kt 0.00% 8 Missing ⚠️
...ce/android/ui/woopos/orders/WooPosOrdersDetails.kt 0.00% 8 Missing ⚠️
...android/ui/woopos/home/items/WooPosItemsToolbar.kt 0.00% 5 Missing ⚠️
...omposeui/component/WooPosExitConfirmationDialog.kt 0.00% 4 Missing ⚠️
...ce/android/ui/woopos/home/items/WooPosItemsList.kt 0.00% 4 Missing ⚠️
...poseui/component/WooPosPaginationErrorIndicator.kt 0.00% 3 Missing ⚠️
...n/composeui/component/WooPosRecentSearchesChips.kt 0.00% 3 Missing ⚠️
...woopos/common/composeui/component/WooPosButtons.kt 0.00% 2 Missing ⚠️
... and 6 more
Additional details and impacted files
@@             Coverage Diff              @@
##              trunk   #15060      +/-   ##
============================================
- Coverage     38.66%   38.66%   -0.01%     
+ Complexity    10362    10361       -1     
============================================
  Files          2168     2168              
  Lines        123004   123015      +11     
  Branches      16977    16978       +1     
============================================
- Hits          47561    47560       -1     
- Misses        70638    70649      +11     
- Partials       4805     4806       +1     

☔ 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.

# Conflicts:
#	WooCommerce/src/main/kotlin/com/woocommerce/android/ui/woopos/orders/WooPosOrdersDetails.kt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants