Skip to content

Fixed Error During Peak Switching by Adjusting Graph Axis Update Order#620

Merged
Bujee415 merged 1 commit intomasterfrom
bugfix/fix-similarity-map-axis-error
Aug 27, 2025
Merged

Fixed Error During Peak Switching by Adjusting Graph Axis Update Order#620
Bujee415 merged 1 commit intomasterfrom
bugfix/fix-similarity-map-axis-error

Conversation

@YukiMatsuzawa
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Contributor

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 an error during peak switching by modifying the order in which graph axis updates are performed. The change addresses a timing issue that was causing errors when switching between peaks in the spectra similarity map.

  • Replaces direct collection clearing and population with local collection building
  • Ensures atomic updates to the OrderedFiles property to prevent intermediate states

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +186 to +192
var files = new List<AnalysisFileBeanModel>(matrix.GetLength(0));
tree.NodePreOrder(i => {
if (tree[i].Count() == 0) {
OrderedFiles.Add(Files.AnalysisFiles[i]);
files.Add(Files.AnalysisFiles[i]);
}
});
OrderedFiles = files;
Copy link

Copilot AI Aug 27, 2025

Choose a reason for hiding this comment

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

The same code pattern is duplicated in both UpdateSimilaritiesAsync methods. Consider extracting this logic into a private method like 'BuildOrderedFilesFromTree(matrix, tree)' to reduce code duplication and improve maintainability.

Copilot uses AI. Check for mistakes.
@Bujee415 Bujee415 merged commit 14f6af8 into master Aug 27, 2025
5 checks passed
@Bujee415 Bujee415 deleted the bugfix/fix-similarity-map-axis-error branch August 27, 2025 01:47
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.

3 participants