Digital PCT265 story MVAPCT-272: Minor code cleanups.

This commit is contained in:
Hedden, Kyle Matthew 2024-10-17 20:30:56 -04:00
parent 920a7ca275
commit ac5c65edd0

View File

@ -20,7 +20,7 @@ public struct MoleculeInfo: Hashable, CustomDebugStringConvertible {
}
public var moleculeId: String
// TODO: This is an existing bug in the template handling. cellReuseId is a deep definition of the cell and its children. Structural changes to the cell should re-register.
// cellReuseId is a deep definition of the cell and its children. Structural changes to the cell should re-register.
public let cellReuseId: String
public let cellType: MoleculeViewProtocol.Type
@ -335,7 +335,7 @@ open class MoleculeListTemplate: ThreeLayerTableViewController, TemplateProtocol
}) != nil
})
// A full reload can cause a flicker / animation. Better to avoid with above reconfigure method.
// A full reload can cause a flicker / animation in the cell's nested view as its being rebuilt. Better to avoid with reconfigure method which will begin with the original cell state should the cell be on screen and visible.
snapshot.reconfigureItems(updatedListItems)
dataSource.defaultRowAnimation = .fade
@ -485,8 +485,6 @@ extension MoleculeListTemplate: MoleculeListProtocol {
public func swapMolecules(_ molecules: [ListItemModelProtocol & MoleculeModelProtocol], with replacements: [ListItemModelProtocol & MoleculeModelProtocol], position: AddMoleculesPosition, molecule: (ListItemModelProtocol & MoleculeModelProtocol)?, animation: UITableView.RowAnimation?) {
guard let tableView else { return }
var snapshot = dataSource.snapshot()
debugLog("[SWAP] State before: \(snapshot.itemIdentifiers)")