Standardize clone depth of drawable configurations - #993
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Image validation accepts empty data that cannot produce a valid non-web image.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Standardizes drawable configuration cloning so mutable nested state is independent while intentional GameObject sharing remains intact.
Changes:
- Deep-clones drawable configurations, collections, and mutable nested data.
- Adds lightweight surface-only cloning and image-data validation.
- Adds regression tests and clone-semantics documentation.
File summaries
| File | Description |
|---|---|
Assets/SEETests/Net/Actions/Drawable/AddImageNetActionTests.cs.meta |
Registers the test asset. |
Assets/SEETests/Net/Actions/Drawable/AddImageNetActionTests.cs |
Tests image validation. |
Assets/SEETests/Net/Actions/Drawable.meta |
Registers the test folder. |
Assets/SEETests/Net/Actions.meta |
Registers the test folder. |
Assets/SEETests/Net.meta |
Registers the test folder. |
Assets/SEETests/Game/Drawable/Configurations/TextConfCloneTests.cs.meta |
Registers the test asset. |
Assets/SEETests/Game/Drawable/Configurations/TextConfCloneTests.cs |
Tests text cloning. |
Assets/SEETests/Game/Drawable/Configurations/MindMapNodeConfCloneTests.cs.meta |
Registers the test asset. |
Assets/SEETests/Game/Drawable/Configurations/MindMapNodeConfCloneTests.cs |
Tests nested and collection cloning. |
Assets/SEETests/Game/Drawable/Configurations/LineConfCloneTests.cs.meta |
Registers the test asset. |
Assets/SEETests/Game/Drawable/Configurations/LineConfCloneTests.cs |
Tests line cloning. |
Assets/SEETests/Game/Drawable/Configurations/LineCapConfCloneTests.cs.meta |
Registers the test asset. |
Assets/SEETests/Game/Drawable/Configurations/LineCapConfCloneTests.cs |
Tests line-cap cloning. |
Assets/SEETests/Game/Drawable/Configurations/ImageConfCloneTests.cs.meta |
Registers the test asset. |
Assets/SEETests/Game/Drawable/Configurations/ImageConfCloneTests.cs |
Tests file-data cloning. |
Assets/SEETests/Game/Drawable/Configurations/DrawableConfigCloneTests.cs.meta |
Registers the test asset. |
Assets/SEETests/Game/Drawable/Configurations/DrawableConfigCloneTests.cs |
Tests aggregate and surface-only clones. |
Assets/SEETests/Game/Drawable/Configurations.meta |
Registers the test folder. |
Assets/SEETests/Game/Drawable.meta |
Registers the test folder. |
Assets/SEETests/Game.meta |
Registers the test folder. |
Assets/SEE/Net/Actions/Drawable/SurfaceNetAction.cs |
Uses surface-only cloning. |
Assets/SEE/Net/Actions/Drawable/AddImageNetAction.cs |
Validates image data before cloning. |
Assets/SEE/Game/Drawable/Configurations/TextConf.cs |
Documents clone depth. |
Assets/SEE/Game/Drawable/Configurations/MindMapNodeConf.cs |
Deep-clones nested configurations and collections. |
Assets/SEE/Game/Drawable/Configurations/LineConf.cs |
Documents line clone semantics. |
Assets/SEE/Game/Drawable/Configurations/LineCapConf.cs |
Documents line-cap clone semantics. |
Assets/SEE/Game/Drawable/Configurations/ImageConf.cs |
Preserves null or copies file data. |
Assets/SEE/Game/Drawable/Configurations/DrawableConfig.cs |
Deep-clones contained configurations. |
Review details
Files not reviewed (13)
- Assets/SEETests/Game.meta: Generated file
- Assets/SEETests/Game/Drawable.meta: Generated file
- Assets/SEETests/Game/Drawable/Configurations.meta: Generated file
- Assets/SEETests/Game/Drawable/Configurations/DrawableConfigCloneTests.cs.meta: Generated file
- Assets/SEETests/Game/Drawable/Configurations/ImageConfCloneTests.cs.meta: Generated file
- Assets/SEETests/Game/Drawable/Configurations/LineCapConfCloneTests.cs.meta: Generated file
- Assets/SEETests/Game/Drawable/Configurations/LineConfCloneTests.cs.meta: Generated file
- Assets/SEETests/Game/Drawable/Configurations/MindMapNodeConfCloneTests.cs.meta: Generated file
- Assets/SEETests/Game/Drawable/Configurations/TextConfCloneTests.cs.meta: Generated file
- Assets/SEETests/Net.meta: Generated file
- Assets/SEETests/Net/Actions.meta: Generated file
- Assets/SEETests/Net/Actions/Drawable.meta: Generated file
- Assets/SEETests/Net/Actions/Drawable/AddImageNetActionTests.cs.meta: Generated file
- Files reviewed: 15/28 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
But we cannot.
koschke
left a comment
There was a problem hiding this comment.
There were only very minor things, which I fixed myself.
I renamed the new test classes so that they start with the prefix Test for consistency with our other test classes.
I will ask Claude for a second opinion tomorrow.
|
Here is Claude's opinion. Review:
|
|
Thanks for getting Claude's second opinion. I addressed all of the points raised in the review.
I additionally fixed the pre-existing |
|
So, should I pull the merge trigger? |
|
Yes, from my side everything is ready now. Thanks! |
Closes #987
Summary
This PR reviews and standardizes the clone depth of drawable configurations.
The contained configurations of
DrawableConfigare now cloned independently instead of being retained by reference. Mutable nested state in the individual drawable configurations is cloned where appropriate, while intentional sharing is preserved and documented.Changes
DrawableConfig.MindMapNodeConf, includingBranchLineConf.GameObjectreferences contained inMindMapNodeConf.Children.ImageConf.FileDatavalues while independently copying existing file data.AddImageNetAction.CloneWithoutDrawableTypes()to avoid unnecessary deep cloning in surface network actions.Testing
DrawableConfig.Clone(), andCloneWithoutDrawableTypes().