mirror of
https://github.com/carlrobertoh/ProxyAI.git
synced 2026-05-20 01:02:02 +00:00
Add tabs for multiple concurrent conversations (#54)
This commit is contained in:
parent
638fb557a7
commit
3d104c8b5a
11 changed files with 158 additions and 94 deletions
|
|
@ -3,9 +3,8 @@ package ee.carlrobert.codegpt.action;
|
|||
import com.intellij.icons.AllIcons;
|
||||
import com.intellij.openapi.actionSystem.AnAction;
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import ee.carlrobert.codegpt.conversations.ConversationsState;
|
||||
import ee.carlrobert.codegpt.toolwindow.ContentManagerService;
|
||||
import ee.carlrobert.codegpt.toolwindow.ToolWindowService;
|
||||
import ee.carlrobert.codegpt.toolwindow.chat.ChatToolWindowPanel;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class AskAction extends AnAction {
|
||||
|
|
@ -23,10 +22,15 @@ public class AskAction extends AnAction {
|
|||
public void actionPerformed(@NotNull AnActionEvent event) {
|
||||
var project = event.getProject();
|
||||
if (project != null) {
|
||||
ConversationsState.getInstance().startConversation();
|
||||
project.getService(ContentManagerService.class).displayChatTab(project);
|
||||
var chatToolWindow = project.getService(ToolWindowService.class).getChatToolWindow();
|
||||
chatToolWindow.displayLandingView();
|
||||
var contentManagerService = project.getService(ContentManagerService.class);
|
||||
contentManagerService.displayChatTab(project);
|
||||
contentManagerService.tryFindChatTabbedPane(project)
|
||||
.ifPresent(tabbedPane -> {
|
||||
var panel = new ChatToolWindowPanel(project);
|
||||
panel.displayLandingView();
|
||||
tabbedPane.addTab("Chat " + (tabbedPane.getTabCount() + 1), panel);
|
||||
tabbedPane.setSelectedIndex(tabbedPane.getTabCount() - 1);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue