Commit fdb2524
committed
feat(sessions): improve session title handling and tool message insertion
- Replace string comparison with ToolType enum in SessionManager for type safety
- Use GetProjectWithProvider instead of GetProject for proper provider context
- Add insertToolMessage function to correctly position tool messages after anchor points
- Implement onFirstMessage callback to auto-generate session titles from first user message
- Update SessionAwareProjectChat to handle first message and update session title
- Add patch method mock to useSessionManager tests for API client compatibility
- Improve tool message ordering by finding last consecutive tool message before insertion
- Enhance session title generation by truncating first message to 50 characters1 parent 09ca14d commit fdb2524
4 files changed
Lines changed: 61 additions & 6 deletions
File tree
- src/MyYuCode/Services/Sessions
- web/src
- components/project-workspace
- hooks
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
| 161 | + | |
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
| 170 | + | |
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
235 | | - | |
| 235 | + | |
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2311 | 2311 | | |
2312 | 2312 | | |
2313 | 2313 | | |
| 2314 | + | |
| 2315 | + | |
| 2316 | + | |
| 2317 | + | |
| 2318 | + | |
| 2319 | + | |
| 2320 | + | |
| 2321 | + | |
| 2322 | + | |
| 2323 | + | |
| 2324 | + | |
| 2325 | + | |
| 2326 | + | |
| 2327 | + | |
| 2328 | + | |
| 2329 | + | |
| 2330 | + | |
| 2331 | + | |
| 2332 | + | |
| 2333 | + | |
| 2334 | + | |
| 2335 | + | |
| 2336 | + | |
| 2337 | + | |
| 2338 | + | |
| 2339 | + | |
| 2340 | + | |
| 2341 | + | |
| 2342 | + | |
| 2343 | + | |
| 2344 | + | |
2314 | 2345 | | |
2315 | 2346 | | |
2316 | 2347 | | |
| |||
3543 | 3574 | | |
3544 | 3575 | | |
3545 | 3576 | | |
| 3577 | + | |
| 3578 | + | |
| 3579 | + | |
| 3580 | + | |
| 3581 | + | |
| 3582 | + | |
| 3583 | + | |
| 3584 | + | |
3546 | 3585 | | |
3547 | 3586 | | |
3548 | 3587 | | |
| |||
3986 | 4025 | | |
3987 | 4026 | | |
3988 | 4027 | | |
3989 | | - | |
| 4028 | + | |
3990 | 4029 | | |
3991 | 4030 | | |
3992 | 4031 | | |
| |||
4048 | 4087 | | |
4049 | 4088 | | |
4050 | 4089 | | |
4051 | | - | |
| 4090 | + | |
4052 | 4091 | | |
4053 | 4092 | | |
4054 | 4093 | | |
| |||
4142 | 4181 | | |
4143 | 4182 | | |
4144 | 4183 | | |
4145 | | - | |
| 4184 | + | |
4146 | 4185 | | |
4147 | 4186 | | |
4148 | 4187 | | |
| |||
4246 | 4285 | | |
4247 | 4286 | | |
4248 | 4287 | | |
| 4288 | + | |
4249 | 4289 | | |
| 4290 | + | |
4250 | 4291 | | |
4251 | 4292 | | |
4252 | 4293 | | |
| |||
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
136 | 147 | | |
137 | 148 | | |
138 | 149 | | |
| |||
212 | 223 | | |
213 | 224 | | |
214 | 225 | | |
| 226 | + | |
215 | 227 | | |
216 | 228 | | |
217 | 229 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| |||
0 commit comments