-
-
Notifications
You must be signed in to change notification settings - Fork 202
refactor: Adopt 'internalId' for Stable DOM Keying (List & Data Views) #9071
Copy link
Copy link
Closed
Labels
Description
Context:
We have implemented a stable internalId (e.g., neo-record-1) for all store items via #9070.
Currently, Neo.list.Base and data views (Gallery, Helix) use the record's primary key (keyProperty) to generate DOM IDs (e.g., view__100).
Problem:
- Phantom Records: New records (
id: null) cause DOM ID collisions. - Mutability: Saving a record changes its ID (
-1->100), forcing a full DOM re-render. - Security: Exposes database IDs in the DOM.
Task:
Update the base classes for Lists and Data Views to support using internalId for DOM keying.
Requirements:
- Opt-in Config: Add
useInternalId: true(defaulting tofalseinitially, ortrueif we are confident) toNeo.list.BaseandNeo.component.Gallery/Helix. - Implementation:
- Update
getItemIdand item creation logic to usestore.getInternalId(record)when the config is enabled. - Ensure selection models (
ListModel,GalleryModel) respect this switch (comparing internal IDs vs record IDs).
- Update
- Verification: Test with CRUD scenarios (phantom records) and verify selection stability.
Scope:
src/list/Base.mjssrc/component/Gallery.mjssrc/component/Helix.mjs- Related Selection Models
Reactions are currently unavailable