dobtco / dvl-core

Base styles for the DOBT View Layer.
https://design.dobt.co/
1 stars 1 forks source link

add delete confirmation #101

Closed ajb closed 9 years ago

ajb commented 9 years ago

cf https://github.com/dobtco/screendoor-v2/issues/1841

img

There's a couple of use cases where I'm not sure how to implement this properly... this is definitely better for most use cases, but maybe we should keep the modal for some use cases? Here's where I'm stuck:

img

img

It seems like we might need to preserve the ability to show a small bit of text along with the confirmation buttons.

ajb commented 9 years ago

A: fuck off, hound.

B: If it helps, here's an idea I just committed:

img

jrubenoff commented 9 years ago

Cool. Made some tweaks to clarify that this should always stem off an icon, rather than a text button.

This component isn't really meant for destructive use cases outside of deletion. So, for now we can keep the modal around when changing the rating type.

For the formbuilder, we could customize it like this:

delete_field

For actions that are destructive enough to warrant extra text, we should put the confirmation on a whole separate page.

ajb commented 9 years ago

Alright, I can get into this, but it's also just another semi-redundant component that we're adding to our library, having to maintain, increasing the size of our CSS/JS, etc.

jrubenoff commented 9 years ago

just another semi-redundant component

Which? Can you explain?

ajb commented 9 years ago

If we continue down this path, here's how we'll be dealing with deletion and other dangerous actions:

  1. A confirmation modal
  2. A confirmation popover (this new component)
  3. A separate confirmation page
  4. An "undo" link after deletion (http://take.ms/RTin7)

Currently, we're only using 1 and 4. I realize that not every problem has a one-size-fits-all approach, but 4 seems like a lot.

On Thu, Jun 4, 2015 at 12:32 PM, Josh Rubenoff notifications@github.com wrote:

just another semi-redundant component

Which? Can you explain?

— Reply to this email directly or view it on GitHub https://github.com/dobtco/dvl-core/pull/101#issuecomment-108958543.

Adam Becker (951) 9-BECKER @AdamJacobBecker

jrubenoff commented 9 years ago

Yeah, I'm fine with that.

Goals

The Solutions

Clicking a minus icon: this popover appears, with secondary buttons added as needed (like "Hide this field").

Clicking a 'Delete' button: The item deletes immediately, and we show a flash with an Undo button.

When deleting something major: take the user a separate page, so we can sufficiently explain what they're about to do.

Non-obvious destructive actions: A modal, for now. We're not changing this yet, but when we do, it will be a new component. In the case of changing a rating type, we need to explain that this is a destructive action, so a flash wouldn't work. Moving the delete confirmation to a separate page would be too disruptive, and there's no clear place for a popover to stem from.

ajb commented 9 years ago

Closing this PR, as it seems like this is Screendoor-specific and not something that belongs in dvl-core. We can work on it in https://github.com/dobtco/screendoor-v2/issues/1841.