Skip to content

Commit

Permalink
Mention @ in the placeholder message (#553)
Browse files Browse the repository at this point in the history
## Test plan
1. runIde
2. see Cody tool window


|   |   |
| --- | --- |
| <img width="632" alt="image"
src="https://github.com/sourcegraph/jetbrains/assets/19799111/5eaf06f4-dc3f-466b-8350-3b14e9dfe0c9">
| <img width="546" alt="image"
src="https://github.com/sourcegraph/jetbrains/assets/19799111/4d438ec0-43ec-4add-a449-2416782d9edc">
|
  • Loading branch information
mkondratek authored Feb 12, 2024
1 parent 68ca4b1 commit 5c031c0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/com/sourcegraph/cody/PromptPanel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import com.sourcegraph.cody.chat.CodyChatMessageHistory
import com.sourcegraph.cody.chat.ui.SendButton
import com.sourcegraph.cody.ui.AutoGrowingTextArea
import com.sourcegraph.cody.vscode.CancellationToken
import com.sourcegraph.common.CodyBundle
import java.awt.Dimension
import java.awt.event.*
import java.io.File
Expand Down Expand Up @@ -48,7 +49,7 @@ class PromptPanel(project: Project, private val chatSession: ChatSession) : JLay

init {
/** Initialize view */
textArea.emptyText.text = "Ask a question about this code..."
textArea.emptyText.text = CodyBundle.getString("PromptPanel.ask-cody.message")
scrollPane.border = EmptyBorder(JBUI.emptyInsets())
scrollPane.background = UIUtil.getPanelBackground()

Expand Down Expand Up @@ -242,6 +243,10 @@ class PromptPanel(project: Project, private val chatSession: ChatSession) : JLay
}
}

fun updateEmptyTextAfterFirstMessage() {
textArea.emptyText.text = CodyBundle.getString("PromptPanel.ask-cody.follow-up-message")
}

companion object {
private const val CHAT_MESSAGE_HISTORY_CAPACITY = 100
private val KEY_ENTER = KeyboardShortcut(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), null)
Expand Down
1 change: 1 addition & 0 deletions src/main/kotlin/com/sourcegraph/cody/chat/ui/ChatPanel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ class ChatPanel(project: Project, chatSession: ChatSession) :
if (messagesPanel.componentCount == 1) {
modelDropdown.isEnabled = false
}
promptPanel.updateEmptyTextAfterFirstMessage()
messagesPanel.addOrUpdateMessage(message, index, shouldAddBlinkingCursor)
}

Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/CodyBundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,5 @@ popup.select-chat=Select Chat
popup.remove-chat=Remove Chat
popup.remove-all-chats=Remove All Chats

PromptPanel.ask-cody.message=Message (type @ to include specific files as context)
PromptPanel.ask-cody.follow-up-message=Follow-up message (type @ to include specific files as context)

0 comments on commit 5c031c0

Please sign in to comment.