woocommerce-android icon indicating copy to clipboard operation
woocommerce-android copied to clipboard

[Tablet support M2] Full flow

Open AnirudhBhat opened this issue 2 years ago • 11 comments

Closes: #10568

Description

This PR introduces a nav_host_fragment within the OrderListFragment, facilitating a two-pane layout for tablets. On phones, this layout adjustment will have no impact. The nav_host_fragment is designated to host the Order detail screen.

Note: This PR solely focuses on layout adjustments and does not encompass any business logic for selecting orders or automatically opening the first order by default.

Testing instructions

  1. Run the app on physical tablet or in a tablet emulator
  2. Click on the Orders tab
  3. Ensure you see a 2 pane layout with order list and order detail
  4. Go into split mode and resize the window and ensure the layout moves between 2 pane and single pane layout according to the window size
  5. Run the same app on phone and ensure the behaviour is same as before and there's no change

Images/gif

Screenshot 2024-01-23 at 9 01 26 AM
  • [x] 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.

AnirudhBhat avatar Jan 22 '24 10:01 AnirudhBhat

3 Warnings
:warning: This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.
:warning: Class SelectedOrderTrackerViewModel is missing tests, but unit-tests-exemption label was set to ignore this.
:warning: This PR is assigned to the milestone 17.5. The due date for this milestone has already passed.
Please assign it to a milestone with a later deadline or check whether the release for this milestone has already been finished.
1 Message
:book:

This PR contains changes to Tracks-related logic. Please ensure (author and reviewer) the following are completed:

  • The tracks events must be validated in the Tracks system.
  • Verify the internal Tracks spreadsheet has also been updated.
  • Please consider registering any new events.
  • The PR must be assigned the category: tracks label.

Generated by :no_entry_sign: Danger

dangermattic avatar Jan 22 '24 10:01 dangermattic

📲 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
Commitac50d0efcb65b31683b4ab157e2343bdfaaaa0ec
Direct Downloadwoocommerce-prototype-build-pr10591-ac50d0e.apk

wpmobilebot avatar Jan 22 '24 10:01 wpmobilebot

Warnings
:warning: PR is not assigned to a milestone.

Generated by :no_entry_sign: dangerJS

peril-woocommerce[bot] avatar Feb 07 '24 07:02 peril-woocommerce[bot]

@pachlava The UI test failure in this PR appears to be related to the constructor() : super(R.id.toolbar) in FilterScreen. This issue likely stems from our refactoring, where we transitioned to using fragment-specific toolbars in place of a shared toolbar. cc @samiuelson

AnirudhBhat avatar Feb 14 '24 06:02 AnirudhBhat

@pachlava The UI test failure in this PR appears to be related to the constructor() : super(R.id.toolbar) in FilterScreen. This issue likely stems from our recent refactoring, where we transitioned to using fragment-specific toolbars in place of a shared toolbar.

AnirudhBhat avatar Feb 15 '24 04:02 AnirudhBhat

@AnirudhBhat, as shared in the test charter with more details (pdfdoF-4C0-p2#comment-5822), there are the following navigation scenarios that I believe should be fixed before release:

Issue 1
  1. Open the app, go to Orders, and wait for the first order to load on the right pane
  2. Click back – you'll be redirected to My store
  3. Go to Orders again Observe order is not loading – the pane on the right side displays shimmer animation endlessly.
Issue 2
  1. Open the app in split mode, go to Orders, and wait for the first order to load on the right pane
  2. Adjust Woo app's window size, so that it displays single pane only, the order details screen shuold become visible
  3. Click arrow back on the toolbar Observe there is enless shimmer animation displayed on the screen instead of the orders list screen. We are not able to get back to orders list nor by clicking back arrow navigation or system back press.
Issue 3
  1. Open the app, go to Orders, and wait for the first order to load on the right pane
  2. Click search icon and enter search phrase, e.g. existing order number
  3. Click on the search result to load it in the right-side pane Observe that the order list shows only search results (not the full list of orders) and there is no way to go back to the full orders list. Clicking "back" redirects to My Store instead of going back to full list.

samiuelson avatar Feb 15 '24 12:02 samiuelson

@samiuelson Thanks for the review and testing! Really appreciate it!

I have fixed issue 1 and 3 here: https://github.com/woocommerce/woocommerce-android/pull/10591/commits/f94ef0aaa2502f7b6094bb15cac310a5228d1e50 https://github.com/woocommerce/woocommerce-android/pull/10591/commits/7d16c9903a127cf3e580c9401fb54164d7a968d1

I need additional time to resolve issue 2. Given that it's an edge case, occurring only during the transition from tablet to non-tablet mode, I suggest proceeding with the release. The impact on users is minimal, as navigating to a different tab and returning to the orders tab serves as a workaround. What are your thoughts?

AnirudhBhat avatar Feb 15 '24 13:02 AnirudhBhat

Adding the "do not merge" label until we make a final decision on whether to include it in this week's release or not. cc @malinajirka

samiuelson avatar Feb 16 '24 12:02 samiuelson

Codecov Report

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

Project coverage is 41.20%. Comparing base (ca19633) to head (ac50d0e). Report is 17 commits behind head on trunk.

Files Patch % Lines
...merce/android/ui/orders/list/OrderListViewModel.kt 5.00% 19 Missing :warning:
.../android/ui/orders/details/OrderDetailViewModel.kt 61.11% 5 Missing and 2 partials :warning:
...ui/orders/details/editing/OrderEditingViewModel.kt 25.00% 4 Missing and 2 partials :warning:
...id/ui/orders/list/SelectedOrderTrackerViewModel.kt 0.00% 6 Missing :warning:
...om/woocommerce/android/ui/orders/OrderNavigator.kt 0.00% 5 Missing :warning:
...oid/ui/orders/creation/OrderCreateEditViewModel.kt 63.63% 2 Missing and 2 partials :warning:
...oocommerce/android/ui/main/MainNavigationRouter.kt 0.00% 3 Missing :warning:
...erce/android/ui/orders/list/OrderListItemUIType.kt 0.00% 2 Missing :warning:
...mmerce/android/ui/orders/list/OrderListListener.kt 0.00% 2 Missing :warning:
.../com/woocommerce/android/extensions/ActivityExt.kt 0.00% 1 Missing :warning:
... and 4 more
Additional details and impacted files
@@             Coverage Diff              @@
##              trunk   #10591      +/-   ##
============================================
- Coverage     41.21%   41.20%   -0.02%     
- Complexity     5057     5062       +5     
============================================
  Files          1028     1029       +1     
  Lines         59415    59465      +50     
  Branches       7971     7980       +9     
============================================
+ Hits          24489    24503      +14     
- Misses        32755    32786      +31     
- Partials       2171     2176       +5     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Feb 16 '24 13:02 codecov-commenter

@pachlava @samiuelson Heads up. I have added @Ignore annotation for couple of UI tests that need some fix due to our recent toolbar refactoring. https://github.com/woocommerce/woocommerce-android/pull/10591/commits/b85d5625f592574fadb03273f2e5feb5ba9f510a

AnirudhBhat avatar Feb 16 '24 13:02 AnirudhBhat

Thank you both! We have found some issues today, which we fixed. However, it seems having an additional week for testing will increase our confidence. Moreover, I don't think we should merge a PR with broken tests - that beats their purpose. Let's move the target date to the next week.

malinajirka avatar Feb 16 '24 13:02 malinajirka

Found 1 violations:

The PR caused the following dependency changes:

expand

-+--- org.wordpress:fluxc:2.67.0
-|    +--- org.wordpress:wellsql:2.0.0
-|    |    +--- androidx.annotation:annotation:1.2.0 -> 1.7.0 (*)
-|    |    \--- org.wordpress.wellsql:wellsql-annotations:2.0.0
-|    +--- org.wordpress.fluxc:fluxc-annotations:2.67.0
-|    +--- org.greenrobot:eventbus:3.3.1 (*)
-|    +--- com.squareup.okhttp3:okhttp:4.9.0 -> 4.11.0 (*)
-|    +--- com.android.volley:volley:1.1.1 -> 1.2.0
-|    +--- androidx.paging:paging-runtime:2.1.2
-|    |    +--- androidx.paging:paging-common:2.1.2
-|    |    |    +--- androidx.annotation:annotation:1.0.0 -> 1.7.0 (*)
-|    |    |    \--- androidx.arch.core:core-common:2.0.0 -> 2.2.0 (*)
-|    |    +--- androidx.arch.core:core-runtime:2.0.0 -> 2.2.0 (*)
-|    |    +--- androidx.lifecycle:lifecycle-runtime:2.0.0 -> 2.6.2 (*)
-|    |    +--- androidx.lifecycle:lifecycle-livedata:2.0.0 -> 2.6.2 (*)
-|    |    \--- androidx.recyclerview:recyclerview:1.0.0 -> 1.3.2 (*)
-|    +--- com.goterl:lazysodium-android:5.0.2
-|    +--- net.java.dev.jna:jna:5.5.0
-|    +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.20 -> 1.9.0 (*)
-|    +--- org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.6.20 -> 1.9.22
-|    |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.22 (*)
-|    +--- androidx.appcompat:appcompat:1.0.2 -> 1.6.1 (*)
-|    +--- androidx.recyclerview:recyclerview:1.0.0 -> 1.3.2 (*)
-|    +--- androidx.exifinterface:exifinterface:1.0.0 -> 1.3.6
-|    |    \--- androidx.annotation:annotation:1.2.0 -> 1.7.0 (*)
-|    +--- androidx.security:security-crypto:1.0.0 -> 1.1.0-alpha03
-|    |    +--- androidx.annotation:annotation:1.1.0 -> 1.7.0 (*)
-|    |    +--- com.google.crypto.tink:tink-android:1.5.0
-|    |    \--- androidx.collection:collection:1.1.0 -> 1.2.0 (*)
-|    +--- com.squareup.okhttp3:okhttp-urlconnection:4.9.0
-|    |    +--- com.squareup.okhttp3:okhttp:4.9.0 -> 4.11.0 (*)
-|    |    \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.10 -> 1.9.0 (*)
-|    +--- com.google.code.gson:gson:2.8.5 -> 2.10.1
-|    +--- org.apache.commons:commons-text:1.10.0 (*)
-|    +--- androidx.room:room-runtime:2.4.2 -> 2.5.2 (*)
-|    +--- androidx.room:room-ktx:2.4.2 -> 2.5.2
-|    |    +--- androidx.room:room-common:2.5.2 (*)
-|    |    +--- androidx.room:room-runtime:2.5.2 (*)
-|    |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.7.20 -> 1.9.22 (*)
-|    |    \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4 -> 1.7.3 (*)
-|    +--- com.google.dagger:dagger:2.42 -> 2.50
-|    |    \--- javax.inject:javax.inject:1
-|    +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9 -> 1.7.3 (*)
-|    \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9 -> 1.7.3 (*)
++--- org.wordpress:fluxc:2959-fa5de726746db9abca205b9c433f61bbb4fdb9ae
+|    +--- org.wordpress:wellsql:2.0.0
+|    |    +--- androidx.annotation:annotation:1.2.0 -> 1.7.0 (*)
+|    |    \--- org.wordpress.wellsql:wellsql-annotations:2.0.0
+|    +--- org.wordpress.fluxc:fluxc-annotations:2959-fa5de726746db9abca205b9c433f61bbb4fdb9ae
+|    +--- org.greenrobot:eventbus:3.3.1 (*)
+|    +--- com.squareup.okhttp3:okhttp:4.9.0 -> 4.11.0 (*)
+|    +--- com.android.volley:volley:1.1.1 -> 1.2.0
+|    +--- androidx.paging:paging-runtime:2.1.2
+|    |    +--- androidx.paging:paging-common:2.1.2
+|    |    |    +--- androidx.annotation:annotation:1.0.0 -> 1.7.0 (*)
+|    |    |    \--- androidx.arch.core:core-common:2.0.0 -> 2.2.0 (*)
+|    |    +--- androidx.arch.core:core-runtime:2.0.0 -> 2.2.0 (*)
+|    |    +--- androidx.lifecycle:lifecycle-runtime:2.0.0 -> 2.6.2 (*)
+|    |    +--- androidx.lifecycle:lifecycle-livedata:2.0.0 -> 2.6.2 (*)
+|    |    \--- androidx.recyclerview:recyclerview:1.0.0 -> 1.3.2 (*)
+|    +--- com.goterl:lazysodium-android:5.0.2
+|    +--- net.java.dev.jna:jna:5.5.0
+|    +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.20 -> 1.9.0 (*)
+|    +--- org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.6.20 -> 1.9.22
+|    |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.22 (*)
+|    +--- androidx.appcompat:appcompat:1.0.2 -> 1.6.1 (*)
+|    +--- androidx.recyclerview:recyclerview:1.0.0 -> 1.3.2 (*)
+|    +--- androidx.exifinterface:exifinterface:1.0.0 -> 1.3.6
+|    |    \--- androidx.annotation:annotation:1.2.0 -> 1.7.0 (*)
+|    +--- androidx.security:security-crypto:1.0.0 -> 1.1.0-alpha03
+|    |    +--- androidx.annotation:annotation:1.1.0 -> 1.7.0 (*)
+|    |    +--- com.google.crypto.tink:tink-android:1.5.0
+|    |    \--- androidx.collection:collection:1.1.0 -> 1.2.0 (*)
+|    +--- com.squareup.okhttp3:okhttp-urlconnection:4.9.0
+|    |    +--- com.squareup.okhttp3:okhttp:4.9.0 -> 4.11.0 (*)
+|    |    \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.10 -> 1.9.0 (*)
+|    +--- com.google.code.gson:gson:2.8.5 -> 2.10.1
+|    +--- org.apache.commons:commons-text:1.10.0 (*)
+|    +--- androidx.room:room-runtime:2.4.2 -> 2.5.2 (*)
+|    +--- androidx.room:room-ktx:2.4.2 -> 2.5.2
+|    |    +--- androidx.room:room-common:2.5.2 (*)
+|    |    +--- androidx.room:room-runtime:2.5.2 (*)
+|    |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.7.20 -> 1.9.22 (*)
+|    |    \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4 -> 1.7.3 (*)
+|    +--- com.google.dagger:dagger:2.42 -> 2.50
+|    |    \--- javax.inject:javax.inject:1
+|    +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9 -> 1.7.3 (*)
+|    \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9 -> 1.7.3 (*)
-\--- org.wordpress.fluxc.plugins:woocommerce:2.67.0
-     +--- org.wordpress:wellsql:2.0.0 (*)
-     +--- org.wordpress.fluxc:fluxc-annotations:2.67.0
-     +--- androidx.room:room-ktx:2.4.2 -> 2.5.2 (*)
-     +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.20 -> 1.9.0 (*)
-     +--- org.wordpress:fluxc:2.67.0 (*)
-     +--- com.google.code.gson:gson:2.8.5 -> 2.10.1
-     +--- com.google.dagger:dagger:2.42 -> 2.50 (*)
-     +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9 -> 1.7.3 (*)
-     +--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9 -> 1.7.3 (*)
-     \--- androidx.room:room-runtime:2.4.2 -> 2.5.2 (*)
+\--- org.wordpress.fluxc.plugins:woocommerce:2959-fa5de726746db9abca205b9c433f61bbb4fdb9ae
+     +--- org.wordpress:wellsql:2.0.0 (*)
+     +--- org.wordpress.fluxc:fluxc-annotations:2959-fa5de726746db9abca205b9c433f61bbb4fdb9ae
+     +--- androidx.room:room-ktx:2.4.2 -> 2.5.2 (*)
+     +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.20 -> 1.9.0 (*)
+     +--- org.wordpress:fluxc:2959-fa5de726746db9abca205b9c433f61bbb4fdb9ae (*)
+     +--- com.google.code.gson:gson:2.8.5 -> 2.10.1
+     +--- com.google.dagger:dagger:2.42 -> 2.50 (*)
+     +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9 -> 1.7.3 (*)
+     +--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9 -> 1.7.3 (*)
+     \--- androidx.room:room-runtime:2.4.2 -> 2.5.2 (*)

Please review and act accordingly

<this is a auto generated comment from violation-comments-lib F7F8ASD8123FSDF>

<ACCUMULATED-VIOLATIONS>

wpmobilebot avatar Feb 22 '24 13:02 wpmobilebot