Skip to content

Commit 16006c4

Browse files
committed
refactor(ui): remove "Session - " prefix from session names
Change session naming to use the actual content or timestamp directly without adding the "Session - " prefix. This provides cleaner, more intuitive session names while still maintaining the 32-character limit.
1 parent 9261308 commit 16006c4

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

core/src/main/kotlin/cc/unitmesh/devti/gui/toolbar/NewSketchAction.kt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package cc.unitmesh.devti.gui.toolbar
22

33
import cc.unitmesh.devti.history.ChatHistoryService
4-
import cc.unitmesh.devti.history.ChatSessionHistory
54
import cc.unitmesh.devti.observer.agent.AgentStateService
65
import cc.unitmesh.devti.gui.AutoDevToolWindowFactory.AutoDevToolUtil
76
import cc.unitmesh.devti.settings.locale.LanguageChangedCallback.componentStateChanged
@@ -61,10 +60,10 @@ class NewSketchAction : AnAction(AllIcons.General.Add), CustomComponentAction {
6160
if (messages.isNotEmpty()) {
6261
val timestamp = SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault()).format(Date())
6362
val firstUser = messages.firstOrNull { it.role.lowercase() == "user" }
64-
val limit = (firstUser?.content ?: timestamp).toString().take(32)
65-
val sessionName = "Session - $limit"
66-
chatHistoryService.saveSession(sessionName, messages)
67-
logger.info("Saved session: $sessionName")
63+
val sessionName = firstUser?.content ?: timestamp
64+
val limitName = sessionName.toString().take(32)
65+
chatHistoryService.saveSession(limitName, messages)
66+
logger.info("Saved session: $limitName")
6867
}
6968
}
7069

0 commit comments

Comments
 (0)