Skip to content
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

Sort by category only once #91907

Merged
merged 1 commit into from Mar 2, 2020
Merged

Sort by category only once #91907

merged 1 commit into from Mar 2, 2020

Conversation

jrieken
Copy link
Member

@jrieken jrieken commented Mar 2, 2020

This PR fixes #91900

Categories/groups in the refactor view that have unconfirmed changes should be sort atop because they need user approval. However, this should happen only once, when the view's tree is populated and not all the time while the tree updates. This PR removes the category/group sort logic from the tree comparator to the generation of the tree input.

@jrieken jrieken added this to the February 2020 milestone Mar 2, 2020
@jrieken jrieken requested a review from mjbvz March 2, 2020 18:06
@jrieken jrieken assigned jrieken and unassigned mjbvz Mar 2, 2020
Copy link
Contributor

@mjbvz mjbvz left a comment

Choose a reason for hiding this comment

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

Fix looks good to me

@@ -260,6 +260,17 @@ export class BulkFileOperations {
}
}

// sort (once) categories atop which have unconfirmed edits
this.categories.sort((a, b) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we switch to use a stable sort such as mergeSort from array.ts? (not sure if that would have fixed the original problem or not)

Copy link
Member Author

Choose a reason for hiding this comment

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

I think by now all sort-implementations are stable (by spec update and implementation) and that can get rid of mergeSort

@jrieken jrieken merged commit af57067 into release/1.43 Mar 2, 2020
@jrieken jrieken deleted the joh/fix/91900 branch March 2, 2020 19:16
@github-actions github-actions bot locked and limited conversation to collaborators Apr 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants