Repository navigation
Move TextureLayerState to HandDrawingSwiftMetal - #250
Merged
Merged
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The new state orchestration introduces a retain cycle, an insertion race, and a texture-deletion consistency failure.
Review effort: Balanced
Findings: 1
Open (3)
What changed in this PR
Moves texture-layer state ownership into the main application, leaving the view and canvas packages connected through protocols.
Changes:
- Adds app-owned layer state, snapshots, persistence, and undo coordination.
- Decouples texture-layer UI and canvas packages through protocol-based interfaces.
- Moves generic texture repository utilities into
Coreand relocates tests.
| File | Description |
|---|---|
TextureLayerView/Tests/TextureLayerViewTests/TextureLayerViewModelTests.swift |
Adapts view-model tests to protocol-backed layers. |
TextureLayerView/Tests/TextureLayerViewTests/Models/Layers/TextureLayersModelTests.swift |
Removes relocated model tests. |
TextureLayerView/Tests/TextureLayerViewTests/Extensions/FileManagerExtensionsTests.swift |
Removes relocated utility tests. |
TextureLayerView/Sources/TextureLayerView/Views/Components/TextureLayerToolbar.swift |
Uses protocol operations and view-model closure. |
TextureLayerView/Sources/TextureLayerView/Views/Components/TextureLayerItemView.swift |
Updates file header. |
TextureLayerView/Sources/TextureLayerView/Views/Components/SliderWithStepper.swift |
Updates file header. |
TextureLayerView/Sources/TextureLayerView/Views/Components/ReversedTextureLayerListView.swift |
Reads protocol-backed layers. |
TextureLayerView/Sources/TextureLayerView/Utils/MTLTextureCreator.swift |
Removes migrated texture utility. |
TextureLayerView/Sources/TextureLayerView/Utils/LocalFileConvertible.swift |
Removes migrated persistence utility. |
TextureLayerView/Sources/TextureLayerView/Utils/ButtonThrottle.swift |
Updates file header. |
TextureLayerView/Sources/TextureLayerView/TextureMinimumLength.swift |
Removes migrated texture constant. |
TextureLayerView/Sources/TextureLayerView/TextureLayerViewModel.swift |
Delegates layer operations through the new protocol. |
TextureLayerView/Sources/TextureLayerView/TextureLayerViewDependencies.swift |
Removes repository coupling. |
TextureLayerView/Sources/TextureLayerView/TextureLayerView.swift |
Accepts protocol-backed layer state. |
TextureLayerView/Sources/TextureLayerView/TextureLayersProtocol.swift |
Defines the layer-view interface. |
TextureLayerView/Sources/TextureLayerView/TextureLayerEvent.swift |
Removes callback event API. |
TextureLayerView/Sources/TextureLayerView/Models/Layers/TextureLayersState.swift |
Removes state ownership from the view package. |
TextureLayerView/Sources/TextureLayerView/Models/Layers/TextureLayersArchiveModel.swift |
Removes app-specific archive model. |
TextureLayerView/Sources/TextureLayerView/Models/Layers/TextureLayerItem.swift |
Removes persistence-model conversion. |
TextureLayerView/Sources/TextureLayerView/Models/Layers/LayerId.swift |
Updates file header. |
TextureLayerView/Sources/TextureLayerView/Extensions/URLExtensions.swift |
Removes migrated URL utilities. |
TextureLayerView/Sources/TextureLayerView/Extensions/UIImageExtensions.swift |
Removes migrated image utilities. |
TextureLayerView/Sources/TextureLayerView/Extensions/NSErrorExtensions.swift |
Removes migrated error utility. |
TextureLayerView/Sources/TextureLayerView/Extensions/MTLTextureExtensions.swift |
Removes migrated texture extensions. |
TextureLayerView/Sources/TextureLayerView/Extensions/FileManagerExtensions.swift |
Removes migrated file utilities. |
TextureLayerCanvasView/Tests/TextureLayerCanvasViewTests/TextureLayerSelectionTests.swift |
Tests canvas snapshots instead of view models. |
TextureLayerCanvasView/Sources/TextureLayerCanvasView/TextureLayerCanvasViewModel.swift |
Uses the canvas-layer protocol. |
TextureLayerCanvasView/Sources/TextureLayerCanvasView/TextureLayerCanvasViewDependencies.swift |
Sources repository interfaces from Core. |
TextureLayerCanvasView/Sources/TextureLayerCanvasView/TextureLayerCanvasView.swift |
Decouples the canvas from concrete state. |
TextureLayerCanvasView/Sources/TextureLayerCanvasView/TextureLayerCanvasRenderer.swift |
Renders lightweight layer snapshots. |
TextureLayerCanvasView/Sources/TextureLayerCanvasView/Layers/TextureLayerSelection.swift |
Selects canvas snapshots. |
TextureLayerCanvasView/Sources/TextureLayerCanvasView/Layers/TextureLayers.swift |
Builds layer collections from the protocol. |
TextureLayerCanvasView/Sources/TextureLayerCanvasView/Layers/TextureLayerCanvasProtocol.swift |
Defines the canvas-facing layer API. |
TextureLayerCanvasView/Package.swift |
Replaces the view-package dependency with Core. |
HandDrawingSwiftMetalTests/Models/Layers/TextureLayersStateTests.swift |
Relocates state tests to the app target. |
HandDrawingSwiftMetalTests/Models/Layers/TextureLayersSnapshotTests.swift |
Adds snapshot normalization tests. |
HandDrawingSwiftMetalTests/Models/Layers/TextureLayerModelDummy.swift |
Relocates model test helpers. |
HandDrawingSwiftMetalTests/Models/Layers/RemoveLayerIndexTests.swift |
Relocates removal-index tests. |
HandDrawingSwiftMetalTests/Models/Layers/MoveLayerIndicesTests.swift |
Relocates movement-index tests. |
HandDrawingSwiftMetalTests/Models/Layers/AddLayerIndexTests.swift |
Relocates insertion-index tests. |
HandDrawingSwiftMetal/Utils/TimeStampFormatter.swift |
Updates ownership metadata. |
HandDrawingSwiftMetal/Resources/Localizable.xcstrings |
Adds migrated error strings. |
HandDrawingSwiftMetal/Models/Undo/UndoTextureLayerViewModel.swift |
Replaces subclassing with an undo registrar. |
HandDrawingSwiftMetal/Models/Undo/UndoDrawing.swift |
Uses app-owned layer models. |
HandDrawingSwiftMetal/Models/Undo/UndoCoordinator.swift |
Updates thumbnail handling. |
HandDrawingSwiftMetal/Models/TextureLayers/TextureLayersState.swift |
Adds app-owned state and operation orchestration. |
HandDrawingSwiftMetal/Models/TextureLayers/TextureLayersSnapshot.swift |
Adds persistence snapshots. |
HandDrawingSwiftMetal/Models/TextureLayers/TextureLayerModel.swift |
Relocates the persistent layer model. |
HandDrawingSwiftMetal/Models/TextureLayers/RemoveLayerIndex.swift |
Relocates removal-index logic. |
HandDrawingSwiftMetal/Models/TextureLayers/MoveLayerIndices.swift |
Relocates movement-index logic. |
HandDrawingSwiftMetal/Models/TextureLayers/AddLayerIndex.swift |
Relocates and exposes insertion logic. |
HandDrawingSwiftMetal/Models/Project/TextureLayersArchiveModel.swift |
Adds app-owned archive conversion. |
HandDrawingSwiftMetal/Models/Project/ProjectContent.swift |
Stores layer snapshots. |
HandDrawingSwiftMetal/Models/CoreData/CoreDataTextureLayerStorage.swift |
Persists app-owned state. |
HandDrawingSwiftMetal/HandDrawingViewModel+IO.swift |
Reads and writes layer snapshots. |
HandDrawingSwiftMetal/HandDrawingViewModel+File.swift |
Refreshes thumbnails after file operations. |
HandDrawingSwiftMetal/HandDrawingViewModel.swift |
Creates and configures the new state. |
HandDrawingSwiftMetal/HandDrawingViewController.swift |
Wires state, canvas, UI, and undo. |
HandDrawingSwiftMetal.xcodeproj/project.pbxproj |
Registers relocated sources and tests. |
Core/Sources/Core/Utils/Logger.swift |
Removes the redundant string error overload. |
Core/Sources/Core/Repositories/TextureLayersDocumentsRepository/TextureLayersDocumentsRepositoryProtocol.swift |
Generalizes repository APIs around UUIDs. |
Core/Sources/Core/Repositories/TextureLayersDocumentsRepository/TextureLayersDocumentsRepository.swift |
Moves texture-byte storage into Core. |
Core/Sources/Core/Extensions/MTLTexture.swift |
Adds texture data extraction in Core. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Layer undo can target the wrong item, async canvas refreshes can display stale selections, and several new error-path tests can pass without observing an error.
Review effort: Balanced
Findings: 1
Open (5)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



No description provided.