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

Show notice to undo product deletion when tapping on "-" and the count is < 1

Open toupper opened this issue 1 year ago • 8 comments

Following this improvement, pdfdoF-2PQ-p2 we delete the product directly if the user taps on the minus button and the count reaches 0. The user might tap on that accidentally and might want to bring the product back. To let them do that, we want to show a notice with the Undo button so they can trigger the action, in a similar fashion as we do in other parts of the app.

toupper avatar May 09 '23 11:05 toupper

Do we have any usual copy/text that we use in these cases?

bozidarsevo avatar Jan 08 '24 10:01 bozidarsevo

@bozidarsevo We use the struct Notice with "Undo" as action title. See here for an example.

toupper avatar Jan 08 '24 10:01 toupper

@bozidarsevo We use the struct Notice with "Undo" as action title. See here for an example.

Would it maybe have more sense to show confirmation alert instead of showing undo option once it is removed?

bozidarsevo avatar Jan 08 '24 11:01 bozidarsevo

Would it maybe have more sense to show confirmation alert instead of showing undo option once it is removed?

That's a good question. We usually use the Undo option pattern so the user only has to do one action. Showing the alert would be more disruptive, as they would always have to do two actions (action + confirmation). Tagging @joe-keenan here so he can add his input.

toupper avatar Jan 08 '24 11:01 toupper

Hey @toupper, and nice to meet you @bozidarsevo.

Sorry about this, but I think there’s been a miscommunication with this issue. As a result of this conversation with @joshheald, I was under the impression we were removing the minus-to-delete-product functionality.

There’s already an obvious button to remove the product, and if you’re tapping the minus icon multiple times in a row then it’s too easy to accidentally remove it. Much easier for everyone if we stop people from being able to make this mistake in the first place, than patch it with an alert/undo notice.

Unless I’m wrong about what what this issue is for. I just saw the creation date, so I could be way off track.

joe-keenan avatar Jan 08 '24 23:01 joe-keenan

Following up, I read the Speedy IPP post (sorry, I didn’t have the shortlink tampermonkey script installed in Arc), and yes, the conversation Josh and I had is in reference to the same component, so this issue isn’t relevant any more.

But when someone taps the remove button, I think it’s still worth adding the undo notice, for exactly the reasons you give, César. The button is quite obvious, and only accessible after expanding the card, so it’s not likely to be tapped accidentally.

A confirmation makes more sense in an accidental-tap situation, like if we kept the minus-to-delete functionality – so I think you were right to suggest it, Bozidar.

Some more context:

We’ve now moved the count stepper inside the expanded product card, so having the minus icon remove the product won’t give us the same speed improvement that it did before. While this change also makes it harder to access the stepper after adding a product, I’ve included designs for adding the stepper inside the product selector in my recent tablet improvement work.

I also plan to recommend adding a swipe-to-remove action the to the product cards, but it’s just an idea in my head at this point.

joe-keenan avatar Jan 09 '24 00:01 joe-keenan

Would something like this work?

Simulator Screen Recording - iPhone 15 Pro - 2024-01-09 at 10 31 47

I added an undo notice when item is removed, I was thinking having it for remove button that is next to the amount of items, and for the button that has "remove product from order" maybe we could have a confirmation. We can go with undo notice for both cases to make it simpler, what do you think?

Also, I was thinking of having specific notice text in the notice, here I just reused "Order status updated", can we use something like "Product removed from the order"?

bozidarsevo avatar Jan 09 '24 09:01 bozidarsevo

Sorry @bozidarsevo, I didn't know this issue existed.

During a HACK week, I experimented with this and prototyped the same thing that you've done in the video – see this thread for our discussions: {p1701966962814919/1698242168.356949-slack-C6H8C3G23}

While it looks nice in a demo, I found that it wasn't reliable if you start being less gentle with it. It may have been made a little more resilient by some other changes we've made since then, but I suspect the underlying issue is still there.

The unreliability comes from the way we sync changes to the order product rows, which results in a PUT to /orders/{id} for (almost) every change to the order, in real time. These can clash, which is normally resolvable, but if you end up removing and re-adding a product to the order, it gets a new line ID and can sometimes result in having the same product in the order twice.

I'm happy to remove the x button in the stepper, which has been on my to-do list for a while.

As @joe-keenan suggests, I think we could add an Undo notice when the Remove product from order button is tapped – perhaps open a new issue for that? It will still probably be possible to break it, but you'd really have to try, as you don't have the issue of fast repetitive input, as with the stepper.

joshheald avatar Jan 09 '24 10:01 joshheald