UX: Prevent last child from being deleted?

Aperta
#125 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Tranquilla
Stack tecnologico
javascript
Ambito
frontend

Direzione di ricerca

Non vengono indicati file, test o punti di ingresso. Confronta l’invariante proposto del livello dati con il divieto delle azioni dell’utente che svuotano un array di nodi, quindi definisci il comportamento desiderato e verifica che l’eliminazione dell’ultimo elemento figlio lasci comunque il nodo elenco vuoto per l’utente.

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

Descrizione

E.g. take a list node. When you delete the last child, it's no longer clear to the user they are working with a list node. If I could prevent the deletion of the last remaining node (instead keep just an empty one) this would probably feel better to the user.

Implementation ideas:

  • allow_empty definition for node_array prop
    • when true then each time a node_array is manipulated it in the ops, it will auto-fill an empty default
    • e.g. if you created a list node with an empty list_items array it would auto fill.
    • or alternatively: throw when that invariant is violated before commiting a transaction
  • another approach would be not to touch the data layer (empty node_arrays are allowed) but just forbid the actions that could make it empty (user input) e.g. when you have the node cursor after the last item and press backspace, or when the last item is an empty text element and you have the text cursor there and press backspace (this would also lead to an empty list.list_items)

Downsides:

  • Creates some special edge cases data-model wise

Priority: Low, lets see if users really struggle with this.

Lingua principale
TypeScript
Stelle
1.8k
Fork
148
Merge medio
2h 47m
PR unite (30g)
13

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Nessun modello di pull request
  • Nessuna 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.

Altre issue di michael/editable

Tutte le issue di michael/editable

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.