Prompt(1/3)
Prompt
Review how my product tells people that something happened, and decide for each message whether it should be a toast, a notification, or neither. Then, if I want it, restyle the toasts and notifications along the lines below. This is about judgment first: diagnose and recommend, and change only what I approve.
This is a change to my product, not a demo. Work inside my code, on my stack, with my components, tokens, corner scale, fonts and copy style. Do not add a dependency, a new state library or a new visual pattern without asking. Every value below is a default to start from.
0. Read the product first
- Find every place that shows a message about an event: toasts and snackbars, alerts and banners, notification lists, inbox or activity panels, badges and counts, inline success and error text, and browser or push notifications.
- For each one, note: what triggers it (the person's own action, another person, the system, a background job), what it says, any buttons, where it appears, how long it stays, and whether it can be found again later.
- Find the components behind them and where they are mounted (one per page, or one for the whole app). Note how they announce themselves to screen readers.
- Tell me in a few lines what you found before going on.
1. What each one is for
- Toast: answers something the person just did, in the place they are working. It is short, it does not interrupt, and it goes away by itself. It comes in three kinds:
a. Status: confirms a result, so the person does not have to go and check. An icon and a few words, no buttons. Example: "Link copied".
b. Action: the action has already been done, and the toast holds the one step that may follow, usually Undo. One line and one button, plus a close. It stays long enough to use the button, with the time left shown.
c. Progress: work that takes a moment. It shows that the work is under way, then turns into the result in the same place, with a button to see it. Example: "Uploading brand-guide.pdf" turns into "Uploaded to Files, Open".
- Notification: news the person did not cause just now, from other people or from the system: a mention, a reply, a payment, a deadline, a security alert, a finished report. It can carry more: a title, a few lines and up to two actions. It is shown on every page, stays until it is opened, handled or closed, and several can be shown at once. It is also kept somewhere the person can find it again (an inbox or a list behind a bell, with a count).
- Neither:
- A form error or a problem with one field: show it next to the field.
- A failure the person has to fix (an upload that failed, a payment that did not go through): keep it on the item, with a way to fix it, until it is fixed. A toast that disappears after a few seconds is not enough.
- An action that cannot be undone: ask before doing it (a confirm next to the button, or a dialog for something with a large impact). A toast after the fact is too late.
- Something only worth seeing when the person looks: a badge, a dot or a change of state in place, with no message at all.
2. Questions that settle a case
- Who caused it? The person, just now: toast. Someone else, the system, or the person a while ago in another place: notification.
- Does the person need to act? No: status toast. One quick step that may follow (Undo, View): action toast. A real decision or a reply: notification. Something that must be fixed: keep it on the item.
- Can the action be undone? Then do it at once and offer Undo in a toast instead of asking first. If it cannot be undone, confirm before, not after.
- How much is there to say? A few words: toast. A sentence or two, a name, an amount, a place: notification.
- Would it matter if the person missed it? No: toast. Yes: notification, kept until handled.
- Is the work still running when the person leaves? If it ends while they are still on the page, a toast is enough. If they have moved to another tab or app, a browser or system notification (with permission) is the only way to reach them; inside the product, it also goes into the notification list.
- Several at once? Toasts: one at a time; a new one replaces the old one, or waits. Notifications: they stack.
3. Report before changing anything
Give me a table first, and do not change code yet. One row per message:
- Where: the screen or component, and what triggers it.
Toast 和 Notification 怎么选?
在网页端,尤其是给操作反馈时,我们常用 Toast 或 Notification 传递信息。两者的使用场景有什么区别?
Toast 用于即时、直接的反馈:展示某个操作的结果,用户知道即可。它可以附带一个按钮(比如撤销),配合倒计时,到时自动消失,避免打扰。耗时的操作,也可以先显示进度,完成后原地变为结果。
如果某件事必须由用户处理,就不适合用 Toast:不可撤销的操作,应在执行前用弹窗确认;需要处理的失败,应留在原处,直到解决。
Notification 常见于操作系统,一些工作台类产品也会使用。它与 Toast 最大的区别在于:内容可以与用户当前的操作无关,由他人或系统主动发出,而不是由用户的操作触发。因此,它适合展示需要用户看到、但不必立刻打断的信息,这也是它与弹窗的区别。Notification 会一直保留,直到用户处理或关闭;多条可以堆叠,也可以附带操作按钮。
附一条 Prompt:它会先读取你的产品,逐条判断每条提示该用 Toast、Notification 还是都不用,列出表格由你决定;确认后,还可以按视频中的效果改造 Toast 和 Notification。完整 Prompt 见评论,可以直接复制。