UX: Prevent last child from being deleted?

オープン
#125 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
静か
技術スタック
javascript
領域
frontend

調査の方向性

ファイル、テスト、エントリーポイントは指定されていません。提案されたデータ層の不変条件を、ノード配列を空にするユーザー操作を禁止することと比較し、そのうえで期待する動作を定義し、最後の子を削除してもユーザーから見てリストノードが空のままになることを検証してください。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
TypeScript
スター
1.8k
フォーク
148
平均マージ
2時間 47分
マージ済み PR(30日)
13

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

michael/editable のほかの issue

michael/editable の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。