Skip to content

Commit 5ceba0d

Browse files
committed
feat(terminal): add show/hide terminal action and update related messages
- Add new action for showing or hiding the terminal - Update message properties for new action in both English and Chinese - Fix action descriptions in TerminalSketchProvider
1 parent 19ba96f commit 5ceba0d

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

core/src/main/resources/messages/AutoDevBundle_en.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,3 +183,4 @@ sketch.patch.apply=Apply
183183
sketch.patch.view=View
184184
autodev.save.as.file=Save File As
185185
autodev.save.as.file.description=Choose location to save the file
186+
sketch.terminal.show.hide=Show or hide the terminal

core/src/main/resources/messages/AutoDevBundle_zh.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,3 +183,4 @@ sketch.patch.apply=修复
183183
sketch.patch.view=查看
184184
autodev.save.as.file=保存文件
185185
autodev.save.as.file.description=选择待保存文件位置
186+
sketch.terminal.show.hide=显示或隐藏终端

exts/ext-terminal/src/main/kotlin/cc/unitmesh/terminal/sketch/TerminalSketchProvider.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ class TerminalLangSketch(val project: Project, var content: String) : ExtensionL
6767
this.component.border = JBUI.Borders.empty()
6868
}
6969

70-
// Store execution results for reuse
7170
private var lastExecutionResults: String = ""
7271
private var hasExecutionResults: Boolean = false
7372

@@ -173,14 +172,14 @@ class TerminalLangSketch(val project: Project, var content: String) : ExtensionL
173172
executeAction = TerminalExecuteAction()
174173

175174
val showTerminalAction = object :
176-
AnAction("Show/Hide Terminal", "Show or hide the terminal", AutoDevIcons.Terminal) {
175+
AnAction(AutoDevBundle.message("sketch.terminal.copy.text"), AutoDevBundle.message("sketch.terminal.show.hide"), AutoDevIcons.Terminal) {
177176
override fun actionPerformed(e: AnActionEvent) {
178177
toggleTerminalAction()
179178
}
180179
}
181180

182181
val copyAction = object :
183-
AnAction("Copy", AutoDevBundle.message("sketch.terminal.copy.text"), AutoDevIcons.Copy) {
182+
AnAction(AutoDevBundle.message("sketch.terminal.copy.text"), AutoDevBundle.message("sketch.terminal.copy.text"), AutoDevIcons.Copy) {
184183
override fun actionPerformed(e: AnActionEvent) {
185184
val clipboard = Toolkit.getDefaultToolkit().systemClipboard
186185
val textToCopy = if (hasExecutionResults) {
@@ -195,7 +194,7 @@ class TerminalLangSketch(val project: Project, var content: String) : ExtensionL
195194
}
196195

197196
val sendAction = object :
198-
AnAction("Send to Chat", AutoDevBundle.message("sketch.terminal.send.chat"), AutoDevIcons.Send) {
197+
AnAction(AutoDevBundle.message("sketch.terminal.send.chat"), AutoDevBundle.message("sketch.terminal.send.chat"), AutoDevIcons.Send) {
199198
override fun actionPerformed(e: AnActionEvent) {
200199
try {
201200
val output = if (hasExecutionResults) {

0 commit comments

Comments
 (0)