Retire layer paths used throughout the code (#1531)

* Part 1

* Part 2

* Part 3

* Part 4

* Part 5

* Part 6

* Part 7

* Part 8
This commit is contained in:
Keavon Chambers
2023-12-21 19:32:46 -08:00
committed by GitHub
parent 5c7e04a725
commit 7bfe0ce55b
73 changed files with 532 additions and 798 deletions
@@ -40,7 +40,9 @@ A message is an enum variant of a certain message sub-type like `FrontendMessage
DocumentMessage::DeleteSelectedLayers
// Carries a layer path and a string as data
DocumentMessage::RenameLayer(Vec<LayerId>, String)
DocumentMessage::DeleteLayer {
id: NodeId,
}
```
Message sub-types hierarchically wrap other message sub-types; for example, `DocumentMessage` is wrapped by `PortfolioMessage` via:
@@ -66,3 +68,8 @@ instead of:
```rs
Message(PortfolioMessage::Document(DocumentMessage::DeleteSelectedLayers))
```
And when pushing a message to the queue, we have the `add` and `add_front` functions which call `.into()` for you. Therefore it's as simple as writing:
```rs
responses.add(DocumentMessage::DeleteSelectedLayers.into());
```