Implement TimelineItemProvider diff truncate mechanism

This commit is contained in:
Stefan Ceriu
2026-08-14 17:18:45 +03:00
parent f7f55024ab
commit 5f236c577f
@@ -175,8 +175,10 @@ class TimelineItemProvider: TimelineItemProviderProtocol {
let itemProxy = TimelineItemProxy(item: item)
changes.append(.remove(offset: Int(index), element: itemProxy, associatedWith: nil))
changes.append(.insert(offset: Int(index), element: itemProxy, associatedWith: nil))
case .truncate:
break
case .truncate(let length):
for (index, itemProxy) in itemProxies.enumerated() where index >= Int(length) {
changes.append(.remove(offset: index, element: itemProxy, associatedWith: nil))
}
}
return CollectionDifference(changes)