Two initial issues were identified with the TreeGrid implementation regarding updates when expanding/collapsing nodes:
- Row VDOM Recycling Bug: When
grid.Body intercepted a recordChange event, it called row.createVdom() with default arguments (recycle=true). Because the recordId of the mutating record didn't change, the cell recycling logic skipped calling cellRenderer. The Tree cell component never received updated primitive configs, failing to trigger UI updates. Fixed by calling row.createVdom(false, false) for record updates to enforce a fresh cellRenderer pass.
- TreeStore Projection Mutation Bug: The
TreeStore's expand and collapse methods manipulate the flat visible grid array (the Projection Layer). However, they incorrectly called me.splice(), which is overridden to handle deep structural mutations (ingesting/removing from #childrenMap). Fixed by using super.splice() so visual mutations mutate the underlying Collection without corrupting the structural map layer.
- TreeStore.get() polymorphism: The
TreeStore.get method override failed to resolve Record object parameters into primitive keys, causing expand and collapse to instantly abort when passed a Record object. Fixed by implementing isItem checking.
Note: While these structural fixes resolve the early returns and incorrect map mutations, we are still facing issues with visual rendering where icons occasionally fail to update or toggle state correctly on repeated clicks. This will be addressed in a follow-up task.
Two initial issues were identified with the TreeGrid implementation regarding updates when expanding/collapsing nodes:
grid.Bodyintercepted arecordChangeevent, it calledrow.createVdom()with default arguments (recycle=true). Because therecordIdof the mutating record didn't change, the cell recycling logic skipped callingcellRenderer. TheTreecell component never received updated primitive configs, failing to trigger UI updates. Fixed by callingrow.createVdom(false, false)for record updates to enforce a freshcellRendererpass.TreeStore'sexpandandcollapsemethods manipulate the flat visible grid array (the Projection Layer). However, they incorrectly calledme.splice(), which is overridden to handle deep structural mutations (ingesting/removing from#childrenMap). Fixed by usingsuper.splice()so visual mutations mutate the underlyingCollectionwithout corrupting the structural map layer.TreeStore.getmethod override failed to resolve Record object parameters into primitive keys, causingexpandandcollapseto instantly abort when passed a Record object. Fixed by implementingisItemchecking.Note: While these structural fixes resolve the early returns and incorrect map mutations, we are still facing issues with visual rendering where icons occasionally fail to update or toggle state correctly on repeated clicks. This will be addressed in a follow-up task.