Skip to content

Commit 93a91e9

Browse files
committed
fix(devti): handle click event for NEW type changes in planner result
#352 - Add condition to check change type before opening file - Implement alternative action for NEW type changes - Improve user experience by providing feedback for all change types
1 parent f65d325 commit 93a91e9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

core/src/main/kotlin/cc/unitmesh/devti/gui/planner/PlannerResultSummary.kt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,12 +298,15 @@ class PlannerResultSummary(
298298
val fileLabel = HyperlinkLabel(fileName).apply {
299299
icon = changeIcon
300300
toolTipText = filePath
301-
isEnabled = change.type != Change.Type.NEW
302301
addHyperlinkListener(object : HyperlinkListener {
303302
override fun hyperlinkUpdate(e: HyperlinkEvent) {
304303
if (e.eventType == HyperlinkEvent.EventType.ACTIVATED) {
305-
change.virtualFile?.also {
306-
FileEditorManager.getInstance(project).openFile(it, true)
304+
if (change.type != Change.Type.NEW) {
305+
change.virtualFile?.also {
306+
FileEditorManager.getInstance(project).openFile(it, true)
307+
}
308+
} else {
309+
changeActionListener.onView(change)
307310
}
308311
}
309312
}

0 commit comments

Comments
 (0)