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

Danger pattern guidance #113

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from
23 changes: 23 additions & 0 deletions content/ui-patterns/danger.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: Destructive (danger) sequences
---

When users are making a destructive change to their GitHub account, we need to make sure they have a clear understanding of what is about to happen. Many times these changes are reversible, but may have irreversible side effects (making a repository public). Other times, they're not reversible at all (deleting an organization). Either way, we need to ensure that we've done everything we can to make sure there are no gaps in communication that may cause unintended effects so that we don't lose trust with users.

There are a couple types of data that will need to be modified through our UI. Some of these types are not critical and require no particularly special treatment. These non-critical destructive flows include deleting a comment, issue, pull request, or discussion.
Copy link
Member

Choose a reason for hiding this comment

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

Some notes here:

  • Could be: "There are some types of data" (instead of "a couple")
  • I'm not sure I follow the first sentence though. Would it be easier to determine that this paragraph deals with non-critical destructive flows, and the follow paragraph deals with critical destructive flows if the order of sentences were reversed: "Non-critical destructive flows include deleting a comment, issue, pull request, or discussion. These types of data need to be modified through the UI [still not sure what this means exactly], most aren't critical and require no special treatment."

Copy link
Author

Choose a reason for hiding this comment

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

Ah - initially, that was going to lead directly into: "critical and non-critical", which is where "a couple" came from.

I'll fix that. Thanks Yaili!


For critical destructive flows (including modifying user access, deleting repositories, making private data public, etc.), there are 3 basic treatments we can apply that will ensure that the full effects of a change are clear to our users and that we minimize loss of trust.

[Example image 1 goes here]()

1. We should highlight all destructive flows visually.
- Any actions that will delete significant user data must use the `btn-danger` class.
- All page sections that will trigger a destructive sequences should be highlighted with `border-red` and an `alert` icon to build an accessible, intuitive pattern of recognition. When people see those details, they should know to tread carefully. Ideally, these will be centralized into a `Danger Zone` section.

[Example image 2 goes here]()

2. We should force users into a second confirmation to ensure that they understand which data will be destroyed, the steps to revert those changes (if reversible), and that they have rights to destroy that data with an explicit statement, and/or password-protection.

[Example code goes here]

3. We should follow the [audit logging rules](https://githubber.com/article/technology/dotcom/audit-logs/adding-new-events) and log all destruction events for the support team to help them with cases where something has gone wrong.