Commit
·
b79edb4
1
Parent(s):
0585b20
Create New Assistant now switches to blank session instead of creating immediately
Browse files
frontend/src/hooks/useChat.ts
CHANGED
|
@@ -245,6 +245,12 @@ export function useChat(options: UseChatOptions = {}) {
|
|
| 245 |
setCurrentSessionId(null)
|
| 246 |
}, [])
|
| 247 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 248 |
return {
|
| 249 |
// Session management
|
| 250 |
sessions,
|
|
@@ -255,6 +261,7 @@ export function useChat(options: UseChatOptions = {}) {
|
|
| 255 |
deleteSession,
|
| 256 |
renameSession,
|
| 257 |
clearAllSessions,
|
|
|
|
| 258 |
|
| 259 |
// Messages
|
| 260 |
messages,
|
|
|
|
| 245 |
setCurrentSessionId(null)
|
| 246 |
}, [])
|
| 247 |
|
| 248 |
+
// Clear current session (switch to blank state without creating new session)
|
| 249 |
+
const clearCurrentSession = useCallback(() => {
|
| 250 |
+
setCurrentSessionId(null)
|
| 251 |
+
localStorage.removeItem('edge-llm-current-session')
|
| 252 |
+
}, [])
|
| 253 |
+
|
| 254 |
return {
|
| 255 |
// Session management
|
| 256 |
sessions,
|
|
|
|
| 261 |
deleteSession,
|
| 262 |
renameSession,
|
| 263 |
clearAllSessions,
|
| 264 |
+
clearCurrentSession,
|
| 265 |
|
| 266 |
// Messages
|
| 267 |
messages,
|
frontend/src/pages/Playground.tsx
CHANGED
|
@@ -70,6 +70,7 @@ export function Playground() {
|
|
| 70 |
createNewSession,
|
| 71 |
selectSession,
|
| 72 |
deleteSession,
|
|
|
|
| 73 |
messages,
|
| 74 |
input,
|
| 75 |
setInput,
|
|
@@ -223,7 +224,7 @@ export function Playground() {
|
|
| 223 |
}
|
| 224 |
}
|
| 225 |
|
| 226 |
-
// Create new assistant (clear all settings)
|
| 227 |
const createNewAssistant = () => {
|
| 228 |
setSystemPrompt('')
|
| 229 |
setTemperature(0.7)
|
|
@@ -233,6 +234,8 @@ export function Playground() {
|
|
| 233 |
name: 'New Assistant',
|
| 234 |
type: 'new'
|
| 235 |
})
|
|
|
|
|
|
|
| 236 |
}
|
| 237 |
|
| 238 |
// Clear current assistant
|
|
|
|
| 70 |
createNewSession,
|
| 71 |
selectSession,
|
| 72 |
deleteSession,
|
| 73 |
+
clearCurrentSession,
|
| 74 |
messages,
|
| 75 |
input,
|
| 76 |
setInput,
|
|
|
|
| 224 |
}
|
| 225 |
}
|
| 226 |
|
| 227 |
+
// Create new assistant (clear all settings and switch to blank session)
|
| 228 |
const createNewAssistant = () => {
|
| 229 |
setSystemPrompt('')
|
| 230 |
setTemperature(0.7)
|
|
|
|
| 234 |
name: 'New Assistant',
|
| 235 |
type: 'new'
|
| 236 |
})
|
| 237 |
+
// Switch to blank session state (don't create session until user sends message)
|
| 238 |
+
clearCurrentSession()
|
| 239 |
}
|
| 240 |
|
| 241 |
// Clear current assistant
|
static/assets/index-2cd7a1a6.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
static/assets/index-2cd7a1a6.js.map
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
static/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
| 5 |
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 7 |
<title>Edge LLM</title>
|
| 8 |
-
<script type="module" crossorigin src="/assets/index-
|
| 9 |
<link rel="stylesheet" href="/assets/index-5451caa1.css">
|
| 10 |
</head>
|
| 11 |
<body>
|
|
|
|
| 5 |
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 7 |
<title>Edge LLM</title>
|
| 8 |
+
<script type="module" crossorigin src="/assets/index-2cd7a1a6.js"></script>
|
| 9 |
<link rel="stylesheet" href="/assets/index-5451caa1.css">
|
| 10 |
</head>
|
| 11 |
<body>
|