reactjs / reactjs/react.dev

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

Aperta
#7,848 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

bug: unconfirmed
Lingua principale
JavaScript
Stelle
11.8k
Fork
7.9k
Merge medio
1g 11h
PR unite (30g)
11

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia dalla pagina della challenge collegata «Separating Events from Effects» e riproduci il flusso di Reset del playground. Esamina come vengono presentate le opzioni per reimpostare solo lo stato e per modificare e reimpostare, quindi fai in modo che le azioni disponibili e il testo di conferma siano inequivocabili. Il lavoro è completo quando gli utenti possono capire come reimpostare lo stato di React senza reimpostare il codice e comprendere cosa farà ogni opzione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript, react
Ambito
design, documentation, frontend
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
42/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.