什么时候模态对话真的有必要?

时间:2022-04-05 10:38:38

Modal dialogs are evil, but I keep reading "You should remove modal dialogs when possible"

模态对话框是邪恶的,但我一直在阅读“你应该尽可能删除模态对话框”

When isn't it possible to remove modal dialogs? I mean, what are some truly modal tasks that force us to use evil modal dialogs?

什么时候不能删除模态对话框?我的意思是,什么是真正的模态任务迫使我们使用邪恶的模态对话?

The most common given example is the "Do you want to Save?" I think this is the problem of the concept of having the user hit Save instead of remembering that user input is sacred. If you just saved automatically with the ability to "undo" or have revisions, then you don't ever need ask the user if they want to save.

最常见的例子是“你想节省吗?”我认为这是让用户点击保存而不是记住用户输入是神圣的概念问题。如果您刚刚自动保存并具有“撤消”功能或进行修订,那么您无需询问用户是否要保存。

  • "Are you sure you want to delete?" Undelete
  • “你确定你要删除?”取消删除

  • "Are you sure you want to quit?" Why would you ask that? Are you that vain?
  • “你确定你要退出吗?”你为什么要问这个?你是徒劳的吗?

Why do we ever need modal dialogs?

为什么我们需要模态对话框?

EDIT

Webs app don't count in my books, unless they write their own UI windowing system within the browser. Web apps don't have the same tools set as desktop apps.

除非他们在浏览器中编写自己的UI窗口系统,否则Web应用程序不会计入我的书中。 Web应用程序没有与桌面应用程序相同的工具集。

EDIT 2

My question is slightly different than the one labeled as duplicate. I feel that there is no case that modal dialogs are the best solution. The referred question assumes there is such a case.

我的问题与标记为重复的问题略有不同。我觉得模态对话框不是最好的解决方案。提到的问题假定存在这种情况。

Duplicate of: When Is Modal UI acceptable?

3 个解决方案

#1


6  

Use Cases for Modal Dialogs

  • blocking the application flow until information required to continue is entered, as for example a password in a login process.
  • 阻止应用程序流,直到输入继续所需的信息,例如登录过程中的密码。

  • collecting application configuration options in a centralized dialog. In such cases, typically the changes are applied upon closing the dialog, and access to the application is disabled while the edits are being made.
  • 在集中式对话框中收集应用程序配置选项在这种情况下,通常在关闭对话框时应用更改,并且在进行编辑时禁用对应用程序的访问。

  • warning that the effects of the current action are not reversible. This is a frequent interaction pattern for modal dialogs, but it is also criticised by usability experts as being ineffective for its intended use (protection against errors in destructive actions) and for which better alternatives exist.
  • 警告当前行动的影响是不可逆的。这是模态对话的频繁交互模式,但可用性专家也批评它对其预期用途(防止破坏性行为中的错误)无效,并且存在更好的替代方案。

(Source: Wikipedia)

When I use them

In instances where stopping them from doing something stupid is absolutely mandatory. My company has a web app where Users sometimes leave the page before finishing their work. We prompt them with a Modal (the standard onbeforeunload JavaScript function) if they haven't saved their work.

在阻止他们做蠢事的情况下绝对是强制性的。我的公司有一个Web应用程序,用户有时会在完成工作之前离开页面。如果他们没有保存他们的工作,我们使用Modal(标准onbeforeunload JavaScript函数)提示他们。

Otherwise, I don't use Modals if I can help it, I hate it when an app steals focus from what I'm doing.

否则,如果我可以帮助它,我不会使用Modals,我讨厌当应用程序从我正在做的事情中窃取焦点时。

Edit: We don't save their work automatically for them when they leave the page. We do at other times, but not when they leave the page, hence the Modal. I did write could that could go in and save their work when they left the page, but it wouldn't be a 'great' idea to implement it, especially if they accidentally deleted their work and didn't want it to automatically save.

编辑:我们不会在他们离开页面时自动为他们保存工作。我们在其他时间做,但不是在他们离开页面时,因此莫达尔。我写的可以在他们离开页面时进入并保存他们的工作,但实现它并不是一个“好”的想法,特别是如果他们不小心删除了他们的工作并且不希望它自动保存。

#2


1  

The only thing more sacred than user input is any file I known about. You should never modify any file that an implementation detail unless I have told you to. Thus boxes like "do you want to save?" at exit are a must because I may want to not save.

唯一比用户输入更神圣的是我所知道的任何文件。除非我告诉你,否则你永远不应该修改任何实现细节的文件。这样的盒子就像“你想保存吗?”在出口是必须的,因为我可能不想保存。

#3


0  

Imagine an application which needs to open a dialog for some actions. Now imagine that these would be non-modal dialogs: while one dialog is open, you could change the selection or even worse - invoke a different command which itself opens another dialog. Now imagine the these dialogs would be modal: then you would have to close the dialog to proceed - you can't get in the state where the selection changes under a dialog or where two commands are waiting for input.

想象一下,一个应用程序需要为某些操作打开一个对话框。现在想象一下这些是非模态对话框:当一个对话框打开时,你可以改变选择甚至更糟 - 调用一个不同的命令,它自己打开另一个对话框。现在想象一下这些对话框是模态的:然后你必须关闭对话框才能继续 - 你不能进入选择在一个对话框下改变的状态或两个命令等待输入的状态。

#1


6  

Use Cases for Modal Dialogs

  • blocking the application flow until information required to continue is entered, as for example a password in a login process.
  • 阻止应用程序流,直到输入继续所需的信息,例如登录过程中的密码。

  • collecting application configuration options in a centralized dialog. In such cases, typically the changes are applied upon closing the dialog, and access to the application is disabled while the edits are being made.
  • 在集中式对话框中收集应用程序配置选项在这种情况下,通常在关闭对话框时应用更改,并且在进行编辑时禁用对应用程序的访问。

  • warning that the effects of the current action are not reversible. This is a frequent interaction pattern for modal dialogs, but it is also criticised by usability experts as being ineffective for its intended use (protection against errors in destructive actions) and for which better alternatives exist.
  • 警告当前行动的影响是不可逆的。这是模态对话的频繁交互模式,但可用性专家也批评它对其预期用途(防止破坏性行为中的错误)无效,并且存在更好的替代方案。

(Source: Wikipedia)

When I use them

In instances where stopping them from doing something stupid is absolutely mandatory. My company has a web app where Users sometimes leave the page before finishing their work. We prompt them with a Modal (the standard onbeforeunload JavaScript function) if they haven't saved their work.

在阻止他们做蠢事的情况下绝对是强制性的。我的公司有一个Web应用程序,用户有时会在完成工作之前离开页面。如果他们没有保存他们的工作,我们使用Modal(标准onbeforeunload JavaScript函数)提示他们。

Otherwise, I don't use Modals if I can help it, I hate it when an app steals focus from what I'm doing.

否则,如果我可以帮助它,我不会使用Modals,我讨厌当应用程序从我正在做的事情中窃取焦点时。

Edit: We don't save their work automatically for them when they leave the page. We do at other times, but not when they leave the page, hence the Modal. I did write could that could go in and save their work when they left the page, but it wouldn't be a 'great' idea to implement it, especially if they accidentally deleted their work and didn't want it to automatically save.

编辑:我们不会在他们离开页面时自动为他们保存工作。我们在其他时间做,但不是在他们离开页面时,因此莫达尔。我写的可以在他们离开页面时进入并保存他们的工作,但实现它并不是一个“好”的想法,特别是如果他们不小心删除了他们的工作并且不希望它自动保存。

#2


1  

The only thing more sacred than user input is any file I known about. You should never modify any file that an implementation detail unless I have told you to. Thus boxes like "do you want to save?" at exit are a must because I may want to not save.

唯一比用户输入更神圣的是我所知道的任何文件。除非我告诉你,否则你永远不应该修改任何实现细节的文件。这样的盒子就像“你想保存吗?”在出口是必须的,因为我可能不想保存。

#3


0  

Imagine an application which needs to open a dialog for some actions. Now imagine that these would be non-modal dialogs: while one dialog is open, you could change the selection or even worse - invoke a different command which itself opens another dialog. Now imagine the these dialogs would be modal: then you would have to close the dialog to proceed - you can't get in the state where the selection changes under a dialog or where two commands are waiting for input.

想象一下,一个应用程序需要为某些操作打开一个对话框。现在想象一下这些是非模态对话框:当一个对话框打开时,你可以改变选择甚至更糟 - 调用一个不同的命令,它自己打开另一个对话框。现在想象一下这些对话框是模态的:然后你必须关闭对话框才能继续 - 你不能进入选择在一个对话框下改变的状态或两个命令等待输入的状态。