Skip to content

Commit 09c9ca9

Browse files
authored
close-error-details-when-switching-to-summary-tab (#132)
Signed-off-by: shalom <[email protected]> Signed-off-by: shalom <[email protected]>
1 parent f106c37 commit 09c9ca9

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

ide-common/src/main/kotlin/org/digma/intellij/plugin/ui/service/ToolWindowTabsHelper.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,18 @@ class ToolWindowTabsHelper(val project: Project) {
2020
const val SUMMARY_TAB_NAME = "summary"
2121
}
2222

23-
fun isInsightsTab(content: Content?):Boolean{
23+
fun isInsightsTab(content: Content?): Boolean {
2424
return content != null && content.tabName.equals(INSIGHTS_TAB_NAME, ignoreCase = true)
2525
}
2626

27-
fun isErrorsTab(content: Content?):Boolean{
27+
fun isErrorsTab(content: Content?): Boolean {
2828
return content != null && content.tabName.equals(ERRORS_TAB_NAME, ignoreCase = true)
2929
}
3030

31+
fun isSummaryTab(content: Content?): Boolean {
32+
return content != null && content.tabName.equals(SUMMARY_TAB_NAME, ignoreCase = true)
33+
}
34+
3135

3236
fun showingErrorDetails() {
3337
visibleTabBeforeErrorDetails = toolWindow.contentManager.selectedContent

src/main/java/org/digma/intellij/plugin/service/ErrorsActionsService.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ public void closeErrorDetailsBackButton() {
5656

5757
@Override
5858
public void selectionChanged(@NotNull ContentManagerEvent event) {
59-
if (toolWindowTabsHelper.isErrorDetailsOn() && toolWindowTabsHelper.isInsightsTab(event.getContent())){
59+
if (toolWindowTabsHelper.isErrorDetailsOn() &&
60+
(toolWindowTabsHelper.isInsightsTab(event.getContent()) || toolWindowTabsHelper.isSummaryTab(event.getContent()))) {
6061
toolWindowTabsHelper.errorDetailsOff();
6162
errorsViewService.closeErrorDetails();
6263
insightsViewService.updateUi();

0 commit comments

Comments
 (0)