Fix core grid bugs and rendering performance - #78
Merged
Conversation
Filtering: OR-only expression trees matched every record because the empty AND set was vacuously true; nullish cell values crashed string conditions. Fix the match logic and coerce nullish operands once in normalizeCase. Events: cancelable sorting/filtering fired after state was already mutated. Hand listeners a candidate copy and commit it onto the state-held object only when the event passes, preserving both object identity and the listener-can-modify contract. Emit sorted/filtered after the data view updates. Pipeline: concurrent async runs could resolve out of order. Sequence them with an epoch token; stale results are discarded and a rejected hook keeps the previous data state. Expose the documented but missing public columns setter and stop columnReducer from dropping sibling columns inside containers. Navigation: state was module-level and shared across grid instances; hidden columns were reachable and a nullish active node produced NaN row indices. Move state per instance and clamp over visible columns. Performance: key row rendering by column field so cells are reused, share a single Intl.Collator, memoize dot-path segments, and drive the scrollbar offset from a ResizeObserver coalesced into rAF instead of per-render measurement. Tests: 178 -> 227, coverage 98%.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Filtering: OR-only expression trees matched every record because the empty AND set was vacuously true; nullish cell values crashed string conditions. Fix the match logic and coerce nullish operands once in normalizeCase.
Events: cancelable sorting/filtering fired after state was already mutated. Hand listeners a candidate copy and commit it onto the state-held object only when the event passes, preserving both object identity and the listener-can-modify contract. Emit sorted/filtered after the data view updates.
Pipeline: concurrent async runs could resolve out of order. Sequence them with an epoch token; stale results are discarded and a rejected hook keeps the previous data state. Expose the documented but missing public columns setter and stop columnReducer from dropping sibling columns inside containers.
Navigation: state was module-level and shared across grid instances; hidden columns were reachable and a nullish active node produced NaN row indices. Move state per instance and clamp over visible columns.
Performance: key row rendering by column field so cells are reused, share a single Intl.Collator, memoize dot-path segments, and drive the scrollbar offset from a ResizeObserver coalesced into rAF instead of per-render measurement.
Tests: 178 -> 227, coverage 98%.