Skip to content

Use section and item keys for diffable collection identity - #217

Draft
michaelrhughes wants to merge 1 commit into
Shopify:mainfrom
michaelrhughes:mhughes/diffable-collection-item-identity
Draft

michaelrhughes wants to merge 1 commit into
Shopify:mainfrom
michaelrhughes:mhughes/diffable-collection-item-identity

Conversation

@michaelrhughes

Copy link
Copy Markdown

Diffable collections now identify items by their section and item keys, rather than displayed state. Rows with different keys can have equal state, and the same item key can appear in different sections. The public hashable-config initializers and table renderer are unchanged.

Content and style changes explicitly reload retained items without changing their identity; cell configuration reads the current row rather than a possibly retained snapshot payload. Snapshot construction also runs inside the existing exception boundary. Regression tests cover equal states, cross-section keys, content updates, insertion/deletion/movement, and duplicate-key exception handling.

All 132 tests pass using the package's SwiftPM scheme on an iPhone 17 simulator running iOS 26.5 with Xcode 26.6. The checked-in legacy Xcode project has no test action, so validation used its unchanged Package.swift and source/test directories through a generated SwiftPM scheme. No project or package configuration changes are included.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant