Skip to content

fix(apollo-react): sort flattened nodes [MST-6261]#245

Merged
BenGSchulz merged 1 commit intomainfrom
fix/node-sorting
Feb 19, 2026
Merged

fix(apollo-react): sort flattened nodes [MST-6261]#245
BenGSchulz merged 1 commit intomainfrom
fix/node-sorting

Conversation

@BenGSchulz
Copy link
Contributor

  • Add missing sort to flattened node results. This ensures that node sort order can override category sort order when searching all nodes.

Copilot AI review requested due to automatic review settings February 18, 2026 17:46
@github-actions
Copy link

github-actions bot commented Feb 18, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (PT)
apollo-canvas 🟢 Ready Preview, Logs Feb 18, 2026, 09:51:17 AM
apollo-ui-react 🟢 Ready Preview, Logs Feb 18, 2026, 09:49:59 AM
apollo-vertex 🟢 Ready Preview, Logs Feb 18, 2026, 09:49:12 AM
apollo-wind 🟢 Ready Preview, Logs Feb 18, 2026, 09:48:39 AM

@github-actions
Copy link

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 sortOrder in the flatten() 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

@BenGSchulz BenGSchulz marked this pull request as ready for review February 18, 2026 17:51
@BenGSchulz BenGSchulz merged commit 65826a8 into main Feb 19, 2026
30 checks passed
@BenGSchulz BenGSchulz deleted the fix/node-sorting branch February 19, 2026 03:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants