fix(apollo-react): sort flattened nodes [MST-6261]#245
Merged
BenGSchulz merged 1 commit intomainfrom Feb 19, 2026
Merged
Conversation
Contributor
BenGSchulz
commented
Feb 18, 2026
- Add missing sort to flattened node results. This ensures that node sort order can override category sort order when searching all nodes.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug in the CategoryTree.flatten() method by adding sorting to the flattened node results. The fix ensures that when all nodes are brought to the root level (such as when searching across all categories), they are ordered by their sortOrder property rather than by their original category hierarchy.
Changes:
- Added sorting to flattened nodes by
sortOrderin theflatten()method - Added test case to verify correct sorting behavior across multiple categories
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/apollo-react/src/canvas/core/CategoryTree.ts | Added allNodes.sort((a, b) => a.sortOrder - b.sortOrder) to sort flattened nodes before returning |
| packages/apollo-react/src/canvas/core/CategoryTree.test.ts | Added test case verifying that nodes from different categories are sorted by their sortOrder when flattened |
snuziale
approved these changes
Feb 19, 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.