-
Notifications
You must be signed in to change notification settings - Fork 240
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
fix(amazonq): open diff in a new tab when another modal is open #5289
base: main
Are you sure you want to change the base?
Conversation
@@ -804,6 +804,7 @@ class DocController( | |||
followUp = getFollowUpOptions(session.sessionState.phase) | |||
) | |||
|
|||
this.toolWindow?.activate(null, true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: second parameter is redundant, you can use activate(null) method instead
question: processOpenDiff is invoked from 2 places in the DocController, was this issue reproduced for both of them ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the second parameter
Good catch.
One place is after use click Generate readme.
The second one is generate readme using chat. Update this PR to fix both.
7cc69f4
to
3c61ac7
Compare
@@ -720,6 +720,7 @@ class DocController( | |||
} | |||
|
|||
if (filePaths.isNotEmpty()) { | |||
this.toolWindow?.activate(null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the intent of this is not clear. how does a reader know that this is a magic workaround to make the popup occur non-modal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please see if com.intellij.diff.DiffDialogHints
works
@@ -804,6 +805,7 @@ class DocController( | |||
followUp = getFollowUpOptions(session.sessionState.phase) | |||
) | |||
|
|||
this.toolWindow?.activate(null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leaky abstraction. shouldn't this be handled in the logic that makes the diff dialog appear? instead of the caller needing to know?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happens if the tool window does not exist?
fix(amazonq): /doc agent - fix open diff in a new tab when another modal is open
When another modal is open: Help -> Diagnostic Tools -> Activity Monitor. Keep focus on this modal. Diff was opened in a new modal
After this change, the diff always opens in a new tab.
generate Readme:
generate Readme with chat:
Types of changes
Description
Checklist
License
I confirm that my contribution is made under the terms of the Apache 2.0 license.