Repository navigation
legend selector lookups - #322
Merged
Merged
Conversation
|
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the category-lookup and legend-state changes.
No open issues 🎉
What changed in this PR
Improves category lookup performance in selection and legend selectors, addressing part of #318’s slowdown with large category counts.
Changes:
- Replaces repeated array searches with
Setlookups and map-based name counting. - Derives the “check all” indeterminate state from legend rows, including the N/A category.
- Adds tests for category naming, excluded categories, and checkbox states.
| File | Description |
|---|---|
src/state/selection/selectors.ts |
Uses a Set to check excluded categories while filtering cells. |
src/containers/ColorByMenu/test/selectors.test.ts |
Adds naming, exclusion, and checkbox-state regression tests. |
src/containers/ColorByMenu/selectors.ts |
Optimizes legend lookups and updates indeterminate-state calculation. |
Review effort: Balanced
interim17
marked this pull request as ready for review
November 3, 2026 19:47
interim17
requested review from
ascibisz and
frasercl
and removed request for
a team
November 3, 2026 19:47
frasercl
approved these changes
Nov 4, 2026
ascibisz
approved these changes
Nov 12, 2026
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.
Problem
Advances #318
Features with large number of categories were causing memory use to balloon, slowing down performance or crashing.
This was one PR with #319, split for size/scope.
Solution
Use of
.includeswhen looping over categories is inefficient and can be optimized, saving on resources when loading datasets with large numbers of categories..includesto check filters and displayable groupsAlong with 319, this prevented crashes on the test dataset that Peyton linked in the issue.