做产品 PMaker
空格的键盘
点完什么都没发生
提交 按钮没变化
用户不知道点没点上
于是又点了一次,提交了两遍
三层反馈
提交中… 按钮立刻变态
✓ 已提交 撤销
刚提交
列表里也能看到结果

按钮立刻变、结果有提示、数据也真的变了。三层缺一层,用户就会怀疑自己有没有点上。

Every Action Needs Feedback

The user clicks and something on the screen has to change. With no change, their default assumption is that the click didn't register.

What you will run into
  • 用户连点三次提交,后台收到三条重复数据
  • 点了之后过两秒才有反应,中间那两秒他以为坏了
  • 操作成功了,但页面上看不出哪里变了

Three Layers of Feedback

层什么时候出现它回答的问题
即时反馈 手指抬起的瞬间 我点上了吗。按钮变色、变成加载态、涟漪效果
结果反馈 操作完成时 成功了还是失败了。轻提示、状态标签、错误信息
状态反馈 操作完成之后一直存在 现在是什么状态。列表里的数据真的变了、标记变了
For operations of uncertain duration, at least make the progress bar move. A stuck progress bar creates more anxiety than no progress bar at all.

Pick the Form by Duration

0.1 秒以内 直接给结果,不用加载态 加了反而闪一下,更难受 0.1 到 1 秒 按钮变加载态就够 局部反馈,别遮住整页 超过 1 秒 骨架屏或进度条,让他知道还要多久 超过 10 秒要允许后台运行,别把人困在这一页
For operations of uncertain duration, at least make the progress bar move. A stuck progress bar creates more anxiety than no progress bar at all.

Optimistic Updates

Some operations don't need to wait for the server: likes, bookmarks, todo checkboxes. Handle them as success in the UI first; if the request fails, roll back and show a hint.

Note for the AI

CLAUDE.md · Feedback rules
## 操作反馈

任何会触发请求的操作,都要实现三层反馈:
1. 即时:点击瞬间按钮进入 loading 态并禁用,防止重复提交。
2. 结果:成功或失败都要有明确提示。失败的提示要包含
   原因和下一步(见提示语规范)。
3. 状态:操作完成后,页面上相关的数据必须同步更新,
   不能只弹提示不刷新列表。

按耗时选形式:
- < 0.1s 不显示加载态
- 0.1~1s 局部加载态(按钮内),不要遮罩整页
- > 1s 骨架屏或进度条
- > 10s 允许后台运行,给出可离开的入口

乐观更新只用于点赞、收藏、勾选这类轻操作,
且失败时必须回滚并提示。涉及金额、删除、
不可逆的操作一律等待服务端结果。