Skip to content

Fix core grid bugs and rendering performance - #78

Merged
rkaraivanov merged 1 commit into
masterfrom
rkaraivanov/grid-fixes-and-refactor
Aug 25, 2026
Merged

Fix core grid bugs and rendering performance#78
rkaraivanov merged 1 commit into
masterfrom
rkaraivanov/grid-fixes-and-refactor

Conversation

@rkaraivanov

Copy link
Copy Markdown
Member

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%.

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%.
@rkaraivanov
rkaraivanov merged commit e541ff8 into master Aug 25, 2026
4 checks passed
@rkaraivanov
rkaraivanov deleted the rkaraivanov/grid-fixes-and-refactor branch August 25, 2026 07:33
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