Skip to content

[Woo Pos] Compose navigation template #11512

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

Conversation

kidinov
Copy link
Contributor

@kidinov kidinov commented May 14, 2024

Closes: #11495

Description

The PR:

  • Adds compose navigation dependency
  • Adds template/poc on how to use it

@samiuelson @backwardstruck @jd-alexander 👋

That's more like a proposal on the approach, so feel free to propose any changes to this

Testing instructions

  • More -> POS

Images/gif

05-15--14-44.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.

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented May 14, 2024

📲 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
FlavorJalapeno
Build TypeDebug
Commit1a5983d
Direct Downloadwoocommerce-prototype-build-pr11512-1a5983d.apk

@codecov-commenter
Copy link

codecov-commenter commented May 14, 2024

Codecov Report

Attention: Patch coverage is 0% with 38 lines in your changes are missing coverage. Please review.

Project coverage is 40.80%. Comparing base (7ab8918) to head (f19c30d).

Files Patch % Lines
...ndroid/ui/woopos/root/navigation/WooPosRootHost.kt 0.00% 13 Missing ⚠️
...d/ui/woopos/root/navigation/WooPosMainFlowGraph.kt 0.00% 9 Missing ⚠️
...oid/ui/woopos/checkout/WooPosCheckoutNavigation.kt 0.00% 4 Missing ⚠️
...pos/root/navigation/WooPosNavigationTransitions.kt 0.00% 4 Missing ⚠️
...rce/android/ui/woopos/cart/WooPosCartNavigation.kt 0.00% 2 Missing ⚠️
...erce/android/ui/woopos/cart/WooPosCartViewModel.kt 0.00% 2 Missing ⚠️
...roid/ui/woopos/checkout/WooPosCheckoutViewModel.kt 0.00% 2 Missing ⚠️
...ocommerce/android/ui/woopos/root/WooPosActivity.kt 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##              trunk   #11512      +/-   ##
============================================
- Coverage     40.82%   40.80%   -0.03%     
  Complexity     5180     5180              
============================================
  Files          1070     1077       +7     
  Lines         62327    62358      +31     
  Branches       8502     8506       +4     
============================================
  Hits          25444    25444              
- Misses        34595    34626      +31     
  Partials       2288     2288              

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

@kidinov kidinov marked this pull request as draft May 14, 2024 14:01
kidinov added 3 commits May 15, 2024 11:35
…ency-setup-template-for-recording-the-navigation-graph-read-firstly-about-good-practices
@kidinov kidinov modified the milestones: 18.7, 18.8 May 15, 2024
@kidinov kidinov marked this pull request as ready for review May 15, 2024 12:48
fun WooPosRootHost() {
val rootController = rememberNavController()

NavHost(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need to keep in mind that now even if it's just 1 screen, we still need to separate parts of the screen in easily reusable components (so probably products and cart will have their own VM, screen etc) so if potential phone support will come we can use another NavHost here and reuse the same screens

Copy link
Contributor

Choose a reason for hiding this comment

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

That makes sense. Good point. Also kind of makes those classes simpler since they will be focused on doing one thing.

@wpmobilebot
Copy link
Collaborator

Found 1 violations:

The PR caused the following dependency changes:

expand

++--- androidx.navigation:navigation-compose -> 2.7.7 (*)
+\--- androidx.hilt:hilt-navigation-compose:1.1.0
+     +--- androidx.compose.runtime:runtime:1.0.1 -> 1.6.5 (*)
+     +--- androidx.compose.ui:ui:1.0.1 -> 1.6.5 (*)
+     +--- androidx.hilt:hilt-navigation:1.1.0 (*)
+     +--- androidx.lifecycle:lifecycle-viewmodel-compose:2.6.1 -> 2.6.2 (*)
+     +--- androidx.navigation:navigation-compose:2.5.1 -> 2.7.7 (*)
+     \--- org.jetbrains.kotlin:kotlin-stdlib:1.8.22 -> 1.9.22 (*)

Please review and act accordingly

Copy link
Contributor

@backwardstruck backwardstruck left a comment

Choose a reason for hiding this comment

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

I don't have any suggestions. Glad we are using Compose Navigation!

fun WooPosRootHost() {
val rootController = rememberNavController()

NavHost(
Copy link
Contributor

Choose a reason for hiding this comment

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

That makes sense. Good point. Also kind of makes those classes simpler since they will be focused on doing one thing.

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!

@kidinov kidinov merged commit 293506d into trunk May 16, 2024
14 checks passed
@kidinov kidinov deleted the 11495-woo-pos-add-compose-navigation-dependency-setup-template-for-recording-the-navigation-graph-read-firstly-about-good-practices branch May 16, 2024 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Woo POS] Add Compose navigation dependency. Setup template for recording the navigation graph (read firstly about good practices)
5 participants