mirror of
https://github.com/carlrobertoh/ProxyAI.git
synced 2026-04-28 11:41:28 +00:00
refactor: clean up agent tab initialization
This commit is contained in:
parent
b81eeee470
commit
043d4fe4e9
2 changed files with 3 additions and 24 deletions
|
|
@ -23,22 +23,7 @@ class AgentToolWindowContentManager(private val project: Project) : Disposable {
|
|||
}
|
||||
})
|
||||
|
||||
val storedSessions = sessionState.getSessionIds()
|
||||
if (storedSessions.isEmpty()) {
|
||||
createNewAgentTab()
|
||||
} else {
|
||||
storedSessions.forEach { sessionId ->
|
||||
createNewAgentTab(sessionId = sessionId, select = false)
|
||||
}
|
||||
sessionState.getLastActiveSessionId()?.let { lastActive ->
|
||||
tabbedPane.tryFindTabTitle(lastActive).ifPresent { title ->
|
||||
val tabIndex = tabbedPane.indexOfTab(title)
|
||||
if (tabIndex >= 0) {
|
||||
tabbedPane.selectedIndex = tabIndex
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
createNewAgentTab()
|
||||
|
||||
return tabbedPane
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,10 +85,7 @@ class SelectionTagProcessor(
|
|||
}
|
||||
|
||||
promptBuilder.append(
|
||||
"""
|
||||
# User has highlighted code:
|
||||
${CompletionRequestUtil.formatCode(selectedText, tagDetails.virtualFile.path)}
|
||||
""".trimIndent()
|
||||
CompletionRequestUtil.formatCode(selectedText, tagDetails.virtualFile.path)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -104,10 +101,7 @@ class EditorSelectionTagProcessor(
|
|||
}
|
||||
|
||||
promptBuilder.append(
|
||||
"""
|
||||
# User has highlighted code:
|
||||
${CompletionRequestUtil.formatCode(selectedText, tagDetails.virtualFile.path)}
|
||||
""".trimIndent()
|
||||
CompletionRequestUtil.formatCode(selectedText, tagDetails.virtualFile.path)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue