Skip to content

Make GridModel.defaultGroupSortFn null-safe and improve type signat… #3973

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 23, 2025

Conversation

ghsolomon
Copy link
Contributor

@ghsolomon ghsolomon commented Apr 23, 2025

…ure (+GridGroupSortFn type).

Hoist P/R Checklist

Pull request authors: Review and check off the below. Items that do not apply can also be
checked off to indicate they have been considered. If unclear if a step is relevant, please leave
unchecked and note in comments.

  • Caught up with develop branch as of last change.
  • Added CHANGELOG entry, or determined not required.
  • Reviewed for breaking changes, added breaking-change label + CHANGELOG if so.
  • Updated doc comments / prop-types, or determined not required.
  • Reviewed and tested on Mobile, or determined not required.
  • Created Toolbox branch / PR, or determined not required.

If your change is still a WIP, please use the "Create draft pull request" option in the split
button below to indicate it is not ready yet for a final review.

Pull request reviewers: when merging this P/R, please consider using a squash commit to
collapse multiple intermediate commits into a single commit representing the overall feature
change. This helps keep the commit log clean and easy to scan across releases. PRs containing a
single commit should be rebased when possible.

@ghsolomon ghsolomon requested review from Copilot, lbwexler, amcclain and RyanMG and removed request for lbwexler April 23, 2025 19:17
Copy link

@Copilot 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 pull request enhances the null-safety of GridModel.defaultGroupSortFn and improves the type signature for GridGroupSortFn while refactoring the group sort logic in InstancesModel.

  • Updated sorting logic in InstancesModel to use more descriptive variables.
  • Improved typing of GridGroupSortFn parameters in Types.ts.
  • Introduced a null-safe defaultGroupSortFn in GridModel.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
inspector/instances/InstancesModel.ts Refactored groupSortFn to introduce explicit sort values for comparison.
cmp/grid/Types.ts Updated type signature of GridGroupSortFn from any to string.
cmp/grid/GridModel.ts Added a null-safe defaultGroupSortFn and removed duplicate definitions.
CHANGELOG.md Updated changelog to reflect bug fixes and type signature improvements.
Comments suppressed due to low confidence (1)

inspector/instances/InstancesModel.ts:267

  • [nitpick] Consider extracting the hard-coded 'Watchlist' string into a well-named constant to improve maintainability and reduce potential errors.
const sortValA = a === 'Watchlist' ? 0 : 1,

@amcclain amcclain merged commit 6a5205e into develop Apr 23, 2025
2 checks passed
@amcclain amcclain deleted the defaultGroupSortFn branch April 23, 2025 21:56
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.

2 participants