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

Modal dialog button colors? #24285

Closed
wxiaoguang opened this issue Apr 23, 2023 · 15 comments
Closed

Modal dialog button colors? #24285

wxiaoguang opened this issue Apr 23, 2023 · 15 comments
Labels
type/feature Completely new functionality. Can only be merged if feature freeze is not active. type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Apr 23, 2023

Feature Description

Which style should be used?

1

image

2

image

3

image

4

image

5

image

(5: only text is different from 4)

@wxiaoguang wxiaoguang added type/proposal The new feature has not been accepted yet but needs to be discussed first. type/feature Completely new functionality. Can only be merged if feature freeze is not active. labels Apr 23, 2023
@KN4CK3R
Copy link
Member

KN4CK3R commented Apr 23, 2023

2 or 5 for me.

Style of 2 with text of 5.

@wxiaoguang
Copy link
Contributor Author

2 or 4 for me.

Added 5 , at the moment, all default texts are Yes/No or Confirm/Cancel.

@wxiaoguang
Copy link
Contributor Author

Maybe we can always use style 5 from now on. Actually it has already been used widely in Gitea's UI. At the moment, some old dialogs are style 1, which don't look good to me 😁

I will come back to collect more opinions tomorrow.

@delvh
Copy link
Member

delvh commented Apr 23, 2023

I think I prefer 2, simply as it isn't as confusing.
With the current red-green coloring, I always have to remember whether I should assign red to yes (-> destructive action), or to no (-> canceling the action)…
The only question is how does it look on arc-green?

@wxiaoguang
Copy link
Contributor Author

wxiaoguang commented Apr 23, 2023

The only question is how does it look on arc-green?

Good question, the "primary" button is green on arc-green .....

image

image

But we can have BLUE:

image

@delvh
Copy link
Member

delvh commented Apr 23, 2023

Then it looks like I hoped for.
Then 2 is my final choice.

@wxiaoguang
Copy link
Contributor Author

wxiaoguang commented Apr 23, 2023

When rewriting the old code ( Improve some modal action buttons #24289 ), I also found that there are "yellow" buttons in code 🤣

I guess it might be better than "blue" for "destructive action"

And I added a devtest page for the modal buttons, welcome to try ~~~ And it's pretty easy to switch the button styles with PR #24289

image

@panekj
Copy link

panekj commented Apr 23, 2023

1 - No, colours make the buttons text a little bit unreadable in that contrast
2 - Out of all presented options, yes, but still having a "Default button colour" for destructive actions is not that great choice.
3 - Kind of yes, the red colour for "confirming" a destructive action fits here, the green one not so much. It also can confuse end user as to what they want to achieve green -> yes, red -> no.
4,5 - Like 3 but worse.

6(?) option
Don't introduce a UI where user can make mistake/accident to perform the wrong action.
GitHub solves with presenting only a single button in modal and a clickable link to close the modal
image

@wxiaoguang
Copy link
Contributor Author

wxiaoguang commented Apr 23, 2023

Don't introduce a UI where user can make mistake/accident to perform the wrong action.
GitHub solves with presenting only a single button in modal and a clickable link to close the modal

Gitea also does so on critical operations like GitHub, with extra confirmation.

This issue/PR are mainly for "general" deletion confirmation.

image

But for the "single deletion" button, I am not sure.

At the moment, this is not only for application token , but a lot of other places (eg: delete file) also need such dialog.


Update: then maybe Gitea needs 4 kinds of confirmations?

  1. For really critical operations like above , eg: delete repository (supported)
  2. For general critical operations, like option 6 in comment above, eg: delete a token (No support yet added a sample in #24289)
  3. For non-critical operations, eg: delete a file, yellow/blue button? (supported by #24289)
  4. General yes/no operation, green yes/confirm? (already)

@wxiaoguang
Copy link
Contributor Author

I managed to add a GitHub-like "danger" button in #24289

I guess we can start using it in some cases.

image

@silverwind
Copy link
Member

silverwind commented Apr 23, 2023

I would follow these rules:

  • Delete buttons always filled red indicating the danger
  • Confirm button always filled primary indicating the primary action
  • All other buttons just basic outlined buttons without color, same style as repo page buttons

@BySempron
Copy link

I like 1. Keep color based decision but less intrusive like 3, 4 or 5

silverwind added a commit that referenced this issue Apr 24, 2023
Follow #24097 and #24285

And add a devtest page for modal action button testing.
http://localhost:3000/devtest/fomantic-modal

Now the `modal_actions_confirm.tmpl` could support: green / blue /
yellow positive buttons, the negative button is "secondary".

ps: this PR is only a small improvement, there are still a lot of
buttons not having proper colors. In the future these buttons could be
improved by this approach.

These buttons could also be improved according to the conclusion of
#24285 in the future.



![image](https://user-images.githubusercontent.com/2114189/233847773-a6d6b29b-7b5c-490e-8425-40dfd0ad2529.png)


And add GitHub-like single danger button (context:
#24285 (comment))


![image](https://user-images.githubusercontent.com/2114189/233891566-055d7611-894d-4d5a-baf5-f6369180bf8d.png)

---------

Co-authored-by: silverwind <me@silverwind.io>
@wxiaoguang
Copy link
Contributor Author

Thank you all for the suggestions! #24289 summarized the suggestions, and the current approach is:

  1. Always show "negative" button as secondary button (no color)
  2. Developers could use green/blue/yellow for the positive button, for different cases.
  3. Developers could also use a single red button for dangerous operations, just like GitHub.

I think this issue could be closed, let's do more improvements (new issue/PR) in the future.

@yp05327
Copy link
Contributor

yp05327 commented Apr 25, 2023

Maybe #20212 is related to this discussion?

@wxiaoguang
Copy link
Contributor Author

Yes, but some colors are still inconsistent at the moment.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/feature Completely new functionality. Can only be merged if feature freeze is not active. type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

No branches or pull requests

7 participants