Skip to content

Conversation

@ealeksandrov
Copy link
Contributor

Part of: #8517

Description

This PR adds bulk editing state on Products List.
It replaces navbar content, disables pull-to-refresh, switches table view into multiple selection mode.

Testing

  1. Build and run the app in debug/alpha mode.
  2. On the products list tap the "Bulk Edit" button in the navbar.
  3. Confirm navbar title changes, all buttons are replaced with "Cancel".
  4. Confirm pull-to-refresh is unavailable.
  5. Select a few products from the list.
  6. Confirm title changes, displaying amount of selected items.
  7. Tap "Cancel" in navbar.
  8. Confirm normal navbar title and items are back, pull-to-refresh is enabled.

Video

Simulator.Screen.Recording.mp4

  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@ealeksandrov ealeksandrov added feature: product list Related to the product list. status: feature-flagged Behind a feature flag. Milestone is not strongly held. labels Jan 5, 2023
@ealeksandrov ealeksandrov added this to the 11.8 milestone Jan 5, 2023
@ealeksandrov ealeksandrov requested a review from Ecarrion January 5, 2023 18:09
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Jan 5, 2023

You can test the changes from this Pull Request by:
  • Clicking here or scanning the QR code below to access App Center
  • Then installing the build number pr8563-09db3ad on your iPhone

If you need access to App Center, please ask a maintainer to add you.

}

func configureNavigationBarTitleForEditing() {
let selectedProducts = tableView.indexPathsForSelectedRows?.count ?? 0
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure if we can use tableView.indexPathsForSelectedRows safely. When the table view reloads due to a page being loaded this property gets cleaned.

issue-with-selection.mov

I think we will have to change how we update the table view with new pages or we will have to store these selections on a view model.

What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch! Added ProductsListViewModel to store selection state.

@spencertransier spencertransier modified the milestones: 11.8, 11.9 Jan 7, 2023
@ealeksandrov ealeksandrov requested a review from Ecarrion January 9, 2023 18:33
Copy link
Contributor

@Ecarrion Ecarrion left a comment

Choose a reason for hiding this comment

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

Looks good! I just found one strange glitch where the cell separators disappear if you start selecting from the top of the list.

Feel free to create an issue for it!

Screenshot 2023-01-10 at 9 56 35 AM

Co-authored-by: Ernesto Carrión <[email protected]>
@ealeksandrov
Copy link
Contributor Author

Thanks! Created #8608

@ealeksandrov ealeksandrov merged commit 40e9d26 into trunk Jan 10, 2023
@ealeksandrov ealeksandrov deleted the issue/8517-selection-state branch January 10, 2023 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: product list Related to the product list. status: feature-flagged Behind a feature flag. Milestone is not strongly held.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants