feat: consolidate all prompts into a single settings view (#775)

* feat: consolidate all prompts into a single configurable

* feat: implement prompts settings view

* feat: use prompts from PromptsSettings state

* feat: use startInNewWindow settings value

* fix: landing view action placeholder

* feat: update default chat prompts
This commit is contained in:
Carl-Robert Linnupuu 2024-11-22 10:02:13 +00:00 committed by GitHub
parent fdc4134aec
commit 89344346c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
53 changed files with 1439 additions and 3705 deletions

View file

@ -2,6 +2,7 @@ package ee.carlrobert.codegpt.toolwindow.chat;
import static java.util.Objects.requireNonNull;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.components.Service;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.ComponentContainer;
@ -16,7 +17,7 @@ import ee.carlrobert.codegpt.conversations.Conversation;
import ee.carlrobert.codegpt.conversations.ConversationService;
import ee.carlrobert.codegpt.conversations.ConversationsState;
import ee.carlrobert.codegpt.conversations.message.Message;
import ee.carlrobert.codegpt.settings.configuration.ConfigurationSettings;
import ee.carlrobert.codegpt.settings.prompts.PromptsSettings;
import java.util.Arrays;
import java.util.Objects;
import java.util.Optional;
@ -38,8 +39,11 @@ public final class ChatToolWindowContentManager {
public void sendMessage(Message message, ConversationType conversationType) {
getToolWindow().show();
if (ConfigurationSettings.getState().getCreateNewChatOnEachAction()
|| ConversationsState.getCurrentConversation() == null) {
var startInNewWindow = ApplicationManager.getApplication().getService(PromptsSettings.class)
.getState()
.getChatActions()
.getStartInNewWindow();
if (startInNewWindow || ConversationsState.getCurrentConversation() == null) {
createNewTabPanel().sendMessage(message, conversationType);
return;
}