Skip to content

Commit ad053d1

Browse files
committed
impl: highlight in red the "Delete workspace" action
Similar to the original "Delete" button provided by JetBrains.
1 parent e63fd07 commit ad053d1

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/main/kotlin/com/coder/toolbox/CoderRemoteEnvironment.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ class CoderRemoteEnvironment(
145145
})
146146
}
147147
actions.add(CoderDelimiter(context.i18n.pnotr("")))
148-
actions.add(Action(context.i18n.ptrl("Delete workspace")) {
148+
actions.add(Action(context.i18n.ptrl("Delete workspace"), highlightInRed = true) {
149149
context.cs.launch {
150150
val confirmation = context.ui.showTextInputPopup(
151151
if (wsRawStatus.canStop()) context.i18n.ptrl("Delete running workspace?") else context.i18n.ptrl("Delete workspace?"),

src/main/kotlin/com/coder/toolbox/views/CoderPage.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,14 @@ abstract class CoderPage(
5858
class Action(
5959
description: LocalizableString,
6060
closesPage: Boolean = false,
61+
highlightInRed: Boolean = false,
6162
enabled: () -> Boolean = { true },
6263
private val actionBlock: () -> Unit,
6364
) : RunnableActionDescription {
6465
override val label: LocalizableString = description
6566
override val shouldClosePage: Boolean = closesPage
6667
override val isEnabled: Boolean = enabled()
68+
override val isDangerous: Boolean = highlightInRed
6769
override fun run() {
6870
actionBlock()
6971
}

0 commit comments

Comments
 (0)