reactjs / reactjs/react.dev

[Bug]: "Reset state" on the playgrounds UX is confusing

未关闭
#7,848 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

bug: unconfirmed
主要语言
JavaScript
星标
11.8k
派生
7.9k
平均合并
1 天 11 小时
30 天内合并 PR
11

描述

Summary

If you want to reset the React state of a playground, but not the code, it's very unclear how to do so.
The only way I found is clicking on "Reset", which triggers a popup saying "Reset all your edits too?" and then pressing "Cancel". This will successfully reset the state but not the code. However there are two issues with that:

  1. It's not clear at all that this is the proper way to do so. Should there be two buttons instead?
  2. UX itself is counter-intuitive:
    a. The question is "Reset all your edits too?", which is a yes/no question, but the options are "Ok" or "Cancel"
    b. Normally if you press "Cancel" on a confirmation modal, it should cancel the original action altogether, but here is applies the action partially (reset the state but not the edits)
Page

https://react.dev/learn/separating-events-from-effects#challenges

Details

No response

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从链接的「Separating Events from Effects」challenge 页面开始,复现 playground 的 Reset 流程。检查仅重置 state 和编辑后重置这两个选项的呈现方式,然后让可用操作和确认文案变得明确无歧义。完成标准是:用户能够判断如何在不重置代码的情况下重置 React state,并理解每个选项会执行什么操作。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript, react
领域
design, documentation, frontend
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
42/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。