Skip to content

Conversation

@zuoyaofu
Copy link
Contributor

@zuoyaofu zuoyaofu commented Feb 5, 2025

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Description

Problem:

When reviewing code issues in Amazon Q, clicking or using arrow keys to select an issue does not:

  • Focus the code editor on the relevant line
  • Display the issue details/description

Solution:

  • Added TreeSelectionListener in codeScanTree to detect selection of an issue
  • Removed Redundant MouseListener Logic since click would automatically invoke selection

Checklist

  • My code follows the code style of this project
  • I have added tests to cover my changes
  • A short description of the change has been added to the CHANGELOG if the change is customer-facing in the IDE.
  • I have added metrics for my changes (if required)

License

I confirm that my contribution is made under the terms of the Apache 2.0 license.

@zuoyaofu zuoyaofu changed the title fix(amazonq): single click or select through arrow keys on review cod… fix(amazonq): code review navigation not focusing selected issues Feb 5, 2025
@zuoyaofu zuoyaofu marked this pull request as ready for review February 5, 2025 09:47
@zuoyaofu zuoyaofu requested review from a team as code owners February 5, 2025 09:47
}
}

// Move navigateToIssue as a private class function
Copy link
Contributor

Choose a reason for hiding this comment

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

what's this comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh before, the navigateToIssue was in the On double click function. This comment does not make sense anymore now. Let me delete it.


showIssueDetails(issue, defaultScope)

synchronized(issueNode) {
Copy link
Contributor

Choose a reason for hiding this comment

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

what exactly does the synchronized block solve?

Copy link
Contributor Author

@zuoyaofu zuoyaofu Feb 6, 2025

Choose a reason for hiding this comment

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

This was a logic transfer from the OnDoubleClick function.

My guess is that it prevents the issue from being modified (by auto scan completion which modifies the code issues or other selection?) during the execution of navigating to the line in the Editor, but I have not been able to reproduce such scenario. I left the synchronized block there just in case.

@ctlai95
Copy link
Contributor

ctlai95 commented Feb 7, 2025

/retryBuilds

@zuoyaofu zuoyaofu enabled auto-merge (squash) February 12, 2025 19:52
@zuoyaofu zuoyaofu merged commit c8e4ee4 into aws:main Feb 12, 2025
11 of 13 checks passed
@zuoyaofu zuoyaofu deleted the select-bug branch June 27, 2025 05:42
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