Skip to content
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

Reorder cards #10937

Merged
merged 5 commits into from
Feb 29, 2024
Merged

Reorder cards #10937

merged 5 commits into from
Feb 29, 2024

Conversation

atorresveiga
Copy link
Contributor

@atorresveiga atorresveiga commented Feb 27, 2024

Part of: #10703

Why

As part of Expanded Analytics Hub milestone 2, we plan to add support for customizing the cards we display on the Analytic Hub screen.

Description

This PR adds support for reordering the analytics cards. It does that by adding drag-and-drop support for the compose lazy list and updating the order of cards on the ViewModel. Because we already were persisting the list on the device, not further changes were required.

Testing instructions

TC1

  1. Open the app
  2. Tap on See more
  3. Tap on the pencil icon to edit the screen configuration
  4. Reorder the screen by dragging and dropping cards using the handle icon (=)
  5. Check that the list order changes
  6. Tap on save to persist the order
  7. Tap on the pencil icon again to open the Customize Analytics screen
  8. Check that the order matches the same order as in step 6

Images/gif

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

@atorresveiga atorresveiga added type: task An internally driven task. feature: analytics In-app store analytics labels Feb 27, 2024
@atorresveiga atorresveiga added this to the 17.6 milestone Feb 27, 2024
@dangermattic
Copy link
Collaborator

dangermattic commented Feb 27, 2024

4 Warnings
⚠️ This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.
⚠️ Class ShowDividers is missing tests, but unit-tests-exemption label was set to ignore this.
⚠️ Class DragDropState is missing tests, but unit-tests-exemption label was set to ignore this.
⚠️ This PR is assigned to the milestone 17.6. This milestone is due in less than 2 days.
Please make sure to get it merged by then or assign it to a milestone with a later deadline.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Feb 27, 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
Commit26fdafb
Direct Downloadwoocommerce-prototype-build-pr10937-26fdafb.apk

@codecov-commenter
Copy link

Codecov Report

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

Project coverage is 41.27%. Comparing base (55be942) to head (f39423e).

Files Patch % Lines
...commerce/android/ui/compose/LazyListDragAndDrop.kt 0.00% 113 Missing ⚠️
...tics/hub/settings/AnalyticsHubSettingsViewModel.kt 66.66% 0 Missing and 2 partials ⚠️
...nalytics/hub/settings/AnalyticsHubSettingScreen.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                                 Coverage Diff                                 @@
##             issue/10702-hide-cards-based-on-configuration   #10937      +/-   ##
===================================================================================
- Coverage                                            41.34%   41.27%   -0.08%     
- Complexity                                            5054     5055       +1     
===================================================================================
  Files                                                 1028     1030       +2     
  Lines                                                58860    58980     +120     
  Branches                                              7854     7878      +24     
===================================================================================
+ Hits                                                 24337    24342       +5     
- Misses                                               32357    32470     +113     
- Partials                                              2166     2168       +2     

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

Copy link
Contributor

@ThomazFB ThomazFB left a comment

Choose a reason for hiding this comment

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

Amazing improvement, @atorresveiga 👏 The Analytics Hub is becoming such an impressive feature 🥲 Looks good!

Base automatically changed from issue/10702-hide-cards-based-on-configuration to trunk February 29, 2024 23:28
@atorresveiga atorresveiga merged commit c8ed082 into trunk Feb 29, 2024
13 of 15 checks passed
@atorresveiga atorresveiga deleted the issue/10703-reorder-cards branch February 29, 2024 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: analytics In-app store analytics type: task An internally driven task. unit-tests-exemption
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants