GraphiteEditor / GraphiteEditor/Graphite

Prevent the layer tree from allowing layer drag group formation of incompatible types

オープン
#2,219 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
Paper Cut
主要言語
Rust
スター
27.2k
フォーク
1.3k
平均マージ
20時間 5分
マージ済み PR(30日)
57

説明

We display a grayed out expansion arrow for empty layers. This also means other layers can be dragged into that layer, becoming a child.

![Image](https://github.com/user-attachments/assets/ab098d1f-950e-4c6a-949c-e2cf4b224b7f)

That's because we want to indicate to users that this potentially could have a child. If it gains a child, it would become a group and the expansion arrow would get un-grayed out. Or, it can become a content layer fed by a chain starting with a generator node, in which case it can't gain a child.

But there is confusing behavior with the Path node, since it isn't a generator node. That is, it takes an optional primary input. Since now it becomes possible to attach a child layer to the start of that chain (feeding into the Path node), we display the grayed out expansion arrow. However, the user won't ever be dragging one layer (which outputs group data) into the layer (since the Path node takes vector data).

However, if it's just a Transform node feeding into the otherwise empty layer, that chain has no content. It still makes perfect sense to drag another layer into this layer to turn it into a group (which is transformed by the Transform node).

So there are two situations here:
- The layer's left input at the start of the node chain accepts group input (such as no chain, or the Transform node, or the Flatten Vector Elements node). Keep the current behavior with the grayed out expansion arrow and ability to drag layers into it.
- The Path node doesn't (currently) accept group data. Upon dragging another layer into the vector data layer, this becomes a type error (but this will change with #1822, negating this specific example, but there will be other examples this concept should still be implemented for). So we don't want to allow dragging layers (which output group data) into a node which begins with the Path node, or any other node with a primary input incompatible with group data. In that case, the grayed out expansion arrow shouldn't show in the Layers panel, and users shouldn't be able to drag a layer into it. (In the future, if we have layers that output a specific other type besides group, we should aim to allow dragging compatible types into compatible inputs even if they don't show the grayed out expansion arrow normally.) This change will prevent the user from using the WYSIWYG tooling to break the graph (which should be considered a bug: #2214).

Lastly, when reordering layers by dragging them around in the Layers panel, we want to turn the insertion bar red if the type would be invalid, causing a graph error.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

No files, tests, or entry points are named. Trace layer-tree drag grouping and layer reordering validation, then verify that group-incompatible primary inputs suppress the grayed arrow, reject drops, and show a red insertion bar; account for the Transform and Flatten Vector Elements cases described in the issue.

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

評価

技術スタック
rust
領域
computer-graphics, frontend
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
42/100

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

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