Skip to content

[WOOMOB-1023][Woo POS][Settings] Implement 2-pane layout with Android-style UI design #14459

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

Merged

Conversation

kidinov
Copy link
Contributor

@kidinov kidinov commented Aug 12, 2025

WOOMOB-1023

Description

Implements a 2-pane settings layout for Woo POS following Android settings design. Categories are shown on the left, details on the right. Added visual feedback, animations, and Store category.

Focus more on the architecture then the implementation as the UI most likely is going to be changed

Steps to reproduce

  1. Open Woo POS settings
  2. Switch between Hardware and Store categories
  3. Navigate to Hardware subcategories
  4. Test back navigation

Testing information

  • Category selection shows visual feedback
  • Smooth animations between screens
  • Ripple effects on menu items
  • Toolbar animations work properly

The tests that have been performed

  • Manual testing on tablet layout
  • Navigation between all categories
  • Animation and visual feedback testing
08-12--14-29.mp4
  • 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.

@dangermattic
Copy link
Collaborator

dangermattic commented Aug 12, 2025

4 Warnings
⚠️ This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.
⚠️ Class WooPosSettingsViewModel is missing tests, but unit-tests-exemption label was set to ignore this.
⚠️ Class WooPosSettingsCategoriesViewModel is missing tests, but unit-tests-exemption label was set to ignore this.
⚠️ Class WooPosHardwareSettingsViewModel is missing tests, but unit-tests-exemption label was set to ignore this.

Generated by 🚫 Danger

@kidinov kidinov added this to the 23.1 milestone Aug 12, 2025
@kidinov kidinov requested a review from samiuelson August 12, 2025 12:34
@kidinov kidinov marked this pull request as ready for review August 12, 2025 12:35
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Aug 12, 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
Commit60c66f9
Direct Downloadwoocommerce-wear-prototype-build-pr14459-60c66f9.apk

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Aug 12, 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
Commit60c66f9
Direct Downloadwoocommerce-prototype-build-pr14459-60c66f9.apk

@samiuelson samiuelson self-assigned this Aug 12, 2025
@codecov-commenter
Copy link

codecov-commenter commented Aug 12, 2025

Codecov Report

❌ Patch coverage is 0% with 107 lines in your changes missing coverage. Please review.
✅ Project coverage is 37.95%. Comparing base (1aaee1e) to head (60c66f9).

Files with missing lines Patch % Lines
...woopos/common/composeui/component/WooPosToolbar.kt 0.00% 25 Missing ⚠️
.../android/ui/woopos/settings/WooPosSettingsState.kt 0.00% 23 Missing ⚠️
...roid/ui/woopos/settings/WooPosSettingsViewModel.kt 0.00% 19 Missing ⚠️
...ttings/categories/WooPosSettingsCategoriesState.kt 0.00% 19 Missing ⚠️
...gs/details/hardware/WooPosHardwareSettingsState.kt 0.00% 15 Missing ⚠️
...gs/categories/WooPosSettingsCategoriesViewModel.kt 0.00% 3 Missing ⚠️
...etails/hardware/WooPosHardwareSettingsViewModel.kt 0.00% 3 Missing ⚠️
Additional details and impacted files
@@                                            Coverage Diff                                            @@
##             woomob-1022-woo-possettings-prepare-infrastructure-for-the-settings   #14459      +/-   ##
=========================================================================================================
- Coverage                                                                  37.98%   37.95%   -0.03%     
- Complexity                                                                  9209     9210       +1     
=========================================================================================================
  Files                                                                       1994     1999       +5     
  Lines                                                                     112571   112663      +92     
  Branches                                                                   14852    14860       +8     
=========================================================================================================
+ Hits                                                                       42761    42764       +3     
- Misses                                                                     65902    65992      +90     
+ Partials                                                                    3908     3907       -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.

@samiuelson samiuelson requested a review from Copilot August 13, 2025 10:06
Copilot

This comment was marked as outdated.

@samiuelson samiuelson requested a review from Copilot August 13, 2025 10:31
Copy link
Contributor

@Copilot Copilot AI left a 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 implements a 2-pane settings layout for Woo POS with Android-style UI design, featuring categories on the left and details on the right. The implementation follows a hierarchical navigation structure with visual feedback and animations.

  • Restructured settings architecture to support 2-pane layout with category navigation
  • Added Hardware and Store categories with subcategory navigation support
  • Implemented smooth animations, ripple effects, and visual feedback for user interactions

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
strings.xml Added string resources for new settings categories and subcategories
WooPosHardwareSettingsViewModel.kt Created ViewModel for hardware settings with state management
WooPosHardwareSettingsState.kt Defined data models for hardware settings items with icons and labels
WooPosHardwareSettingsScreen.kt Implemented hardware settings UI with clickable menu items and ripple effects
WooPosSettingsDetailPaneScreen.kt Created detail pane with animated transitions and toolbar navigation
WooPosSettingsCategoriesViewModel.kt Created ViewModel for category selection management
WooPosSettingsCategoriesState.kt Defined category data models and enum structure
WooPosSettingsCategoriesPaneScreen.kt Implemented category selection UI with visual selection feedback
WooPosSettingsViewModel.kt Enhanced main ViewModel with navigation state management
WooPosSettingsState.kt Defined navigation state and destination hierarchy
WooPosSettingsScreen.kt Restructured main screen to support 2-pane layout with category and detail views

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.


data class WooPosSettingsState(
val selectedCategory: WooPosSettingsCategory = WooPosSettingsCategory.HARDWARE,
val currentDestination: WooPosSettingsDetailDestination = selectedCategory.rootDestination
Copy link
Preview

Copilot AI Aug 13, 2025

Choose a reason for hiding this comment

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

The default value for currentDestination references selectedCategory.rootDestination, but selectedCategory is also being initialized in the same constructor. This creates a circular dependency where currentDestination depends on selectedCategory's rootDestination, but selectedCategory is initialized with a default value at the same time. This should be explicitly set to WooPosSettingsCategory.HARDWARE.rootDestination to avoid potential initialization issues.

Suggested change
val currentDestination: WooPosSettingsDetailDestination = selectedCategory.rootDestination
val currentDestination: WooPosSettingsDetailDestination = WooPosSettingsCategory.HARDWARE.rootDestination

Copilot uses AI. Check for mistakes.

Copy link
Contributor

@samiuelson samiuelson left a comment

Choose a reason for hiding this comment

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

LGTM! I added a few non-blocking comments.

Comment on lines 70 to 71
interactionSource = remember { MutableInteractionSource() },
indication = ripple()
Copy link
Contributor

Choose a reason for hiding this comment

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

interactionSource = remember { MutableInteractionSource() },
indication = ripple()

💡 n.p.: aren't these params redundant in clickable? I can't see any difference with or without them on my device.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed. Addressed here - 8bd41fb

}

@Composable
private fun DetailPaneToolbar(
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 What do you think about adapting and reusing WooPosToolbar here instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree! Implemented here

6550edd

Base automatically changed from woomob-1022-woo-possettings-prepare-infrastructure-for-the-settings to trunk August 14, 2025 07:13
@kidinov kidinov merged commit 261ca27 into trunk Aug 14, 2025
18 checks passed
@kidinov kidinov deleted the woomob-1023-woo-possettings-2-pane-layout-based-on-the-wireframes branch August 14, 2025 07:54
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