refactor: replace AnyChangeManager closure erasure with ChangeManaging protocol#915
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d9f1b7752f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| wrapped.consumeChangedRowIndices() | ||
| } | ||
|
|
||
| init(_ manager: any ChangeManaging) { |
There was a problem hiding this comment.
Update test-facing AnyChangeManager API changes
This refactor removes the labeled initializers in favor of init(_:) (and also renames the exposed change list to rowChanges), but the existing test target still calls AnyChangeManager(dataManager:), AnyChangeManager(structureManager:), and wrapper.changes in TableProTests/Core/ChangeTracking/AnyChangeManagerTests.swift. In environments that build tests (CI/local test runs), this change set will fail to compile until those call sites are updated or compatibility shims are kept.
Useful? React with 👍 / 👎.
Summary
AnyChangeManagerwas a closure-based type erasure class with 7@ObservationIgnoredclosure properties andchanges: [Any]forcingas? RowChangeruntime downcastsChangeManagingprotocol that bothDataChangeManagerandStructureChangeManagerconform toAnyChangeManageris a thin@Observablewrapper with a singlewrapped: any ChangeManagingpropertychanges: [Any]replaced with typedrowChanges: [RowChange]as? RowChangedowncasts eliminated (2 call sites in DataGridCoordinator + DataGridView)Test plan