DeleteAssetCommand (src/core/commands/assetCommands.ts:217) löscht mit einem Asset per Kaskade alle platzierten Objekte, die es verwenden, samt ihren Kindern, in Szenen und in Container-Templates (removeSubtrees, Zeile 245).
Verweise auf diese Objekte leert es nicht. Zeigt eine Object-Variable (auch ein Object-Feld oder Object-Item) auf ein so gelöschtes Objekt, bleibt der Verweis stehen, der Inspector zeigt (missing), und im Spiel liest sich der Wert als null.
Das gilt auch, wenn das gelöschte Asset ein Container ist: Seine Platzierungen verschwinden, Verweise auf deren Inhalt bleiben stehen.
Beim Entfernen einzelner Objekte passiert das seit #269 nicht mehr: RemoveSceneObjectsCommand merkt sich mit shownObjectIds, welche Objekte jeder Halter zeigt, und leert danach mit dropReferencesToGone alles, was nicht mehr aufgelöst wird.
Zu bauen (Vorschlag)
In DeleteAssetCommand.execute vor der Kaskade shownObjectIds(project) festhalten und nach dem Entfernen des Assets dropReferencesToGone(project, before, recorder) aufrufen. Der Recorder kommt ins undo, damit ein Undo alle Verweise zurückbringt.
Das sind wenige Zeilen, die Regel selbst ist in #269 schon gebaut und getestet.
Tests (Vorschlag)
Unit: Ein Objekt zeigt auf eine Platzierung eines Sprite-Assets, das Asset wird gelöscht. Der Verweis ist danach leer, und ein Undo stellt Asset, Objekt und Verweis wieder her. Derselbe Fall mit einem Container-Asset und einem Verweis auf dessen Inhalt.
e2e 57 um einen Block erweitern: Asset im Asset-Browser löschen, danach zeigt die Zeile None statt (missing).
Aus #269 (dort gefunden, nicht behoben).
## Befund
- `DeleteAssetCommand` (`src/core/commands/assetCommands.ts:217`) löscht mit einem Asset per Kaskade alle platzierten Objekte, die es verwenden, samt ihren Kindern, in Szenen und in Container-Templates (`removeSubtrees`, Zeile 245).
- Verweise auf diese Objekte leert es nicht. Zeigt eine Object-Variable (auch ein Object-Feld oder Object-Item) auf ein so gelöschtes Objekt, bleibt der Verweis stehen, der Inspector zeigt `(missing)`, und im Spiel liest sich der Wert als `null`.
- Das gilt auch, wenn das gelöschte Asset ein Container ist: Seine Platzierungen verschwinden, Verweise auf deren Inhalt bleiben stehen.
- Beim Entfernen einzelner Objekte passiert das seit #269 nicht mehr: `RemoveSceneObjectsCommand` merkt sich mit `shownObjectIds`, welche Objekte jeder Halter zeigt, und leert danach mit `dropReferencesToGone` alles, was nicht mehr aufgelöst wird.
## Zu bauen (Vorschlag)
- In `DeleteAssetCommand.execute` vor der Kaskade `shownObjectIds(project)` festhalten und nach dem Entfernen des Assets `dropReferencesToGone(project, before, recorder)` aufrufen. Der `Recorder` kommt ins `undo`, damit ein Undo alle Verweise zurückbringt.
- Das sind wenige Zeilen, die Regel selbst ist in #269 schon gebaut und getestet.
## Tests (Vorschlag)
- Unit: Ein Objekt zeigt auf eine Platzierung eines Sprite-Assets, das Asset wird gelöscht. Der Verweis ist danach leer, und ein Undo stellt Asset, Objekt und Verweis wieder her. Derselbe Fall mit einem Container-Asset und einem Verweis auf dessen Inhalt.
- e2e 57 um einen Block erweitern: Asset im Asset-Browser löschen, danach zeigt die Zeile `None` statt `(missing)`.
Done in 5e21d47 (together with #285), wiki 12a2b16 (Behaviors, Containers, Development).
What changes
Delete asset now clears every reference to an object it takes along: its placements in scenes and container templates and everything parented below them. For a container asset that includes the content of its placements.
The row then shows None instead of (missing). One undo brings the asset, the objects and the references back.
Under the hood
Built as proposed. DeleteAssetCommand (src/core/commands/assetCommands.ts) records with shownObjectIds which objects every holder shows before the cascade, and calls dropReferencesToGone after it. Both come from #269.
The cleared references go through a Recorder of the command, and undo reverts it before the objects come back.
57j deletes "Inner 57" through the context menu in the asset list. The reference is empty afterwards, the row shows None, and undo brings it back.
The unit counter-checks work, bent in a container copy. The numbers above cover #285 as well, both issues share the test file.
The browser counter-check works too: without the new call 57j shows (missing).
Screenshot checked: target shows None, "Inner 57" is gone from the asset list.
The e2e total of 1609 is computed (1607 + 2). CI is still switched off, so there is no run for 5e21d47.
Done in `5e21d47` (together with #285), wiki `12a2b16` (*Behaviors*, *Containers*, *Development*).
**What changes**
- *Delete asset* now clears every reference to an object it takes along: its placements in scenes and container templates and everything parented below them. For a container asset that includes the content of its placements.
- The row then shows **None** instead of `(missing)`. One undo brings the asset, the objects and the references back.
**Under the hood**
- Built as proposed. `DeleteAssetCommand` (`src/core/commands/assetCommands.ts`) records with `shownObjectIds` which objects every holder shows before the cascade, and calls `dropReferencesToGone` after it. Both come from #269.
- The cleared references go through a `Recorder` of the command, and `undo` reverts it before the objects come back.
**Tests** (on `melektaus-atx`)
```
gate 198 files, 2882 tests, CHECK EXIT 0 (2873 + 9)
unit object-references 26 passed (17 + 9)
e2e 1-17,57 ALL PASSED - 566 checks (57: +57i, +57j)
```
- **57j** deletes "Inner 57" through the context menu in the asset list. The reference is empty afterwards, the row shows `None`, and undo brings it back.
- The unit counter-checks work, bent in a container copy. The numbers above cover #285 as well, both issues share the test file.
- The browser counter-check works too: without the new call 57j shows `(missing)`.
- Screenshot checked: *target* shows None, "Inner 57" is gone from the asset list.
- The e2e total of 1609 is computed (1607 + 2). CI is still switched off, so there is no run for `5e21d47`.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Aus #269 (dort gefunden, nicht behoben).
Befund
DeleteAssetCommand(src/core/commands/assetCommands.ts:217) löscht mit einem Asset per Kaskade alle platzierten Objekte, die es verwenden, samt ihren Kindern, in Szenen und in Container-Templates (removeSubtrees, Zeile 245).(missing), und im Spiel liest sich der Wert alsnull.RemoveSceneObjectsCommandmerkt sich mitshownObjectIds, welche Objekte jeder Halter zeigt, und leert danach mitdropReferencesToGonealles, was nicht mehr aufgelöst wird.Zu bauen (Vorschlag)
DeleteAssetCommand.executevor der KaskadeshownObjectIds(project)festhalten und nach dem Entfernen des AssetsdropReferencesToGone(project, before, recorder)aufrufen. DerRecorderkommt insundo, damit ein Undo alle Verweise zurückbringt.Tests (Vorschlag)
Nonestatt(missing).Done in
5e21d47(together with #285), wiki12a2b16(Behaviors, Containers, Development).What changes
(missing). One undo brings the asset, the objects and the references back.Under the hood
DeleteAssetCommand(src/core/commands/assetCommands.ts) records withshownObjectIdswhich objects every holder shows before the cascade, and callsdropReferencesToGoneafter it. Both come from #269.Recorderof the command, andundoreverts it before the objects come back.Tests (on
melektaus-atx)None, and undo brings it back.(missing).5e21d47.