Commit 7edeb0d
committed
fix: preserve user messages at choice prompts in history (fixes #7316)
- Added local message history buffer in usePromptHistory hook to store messages immediately upon sending
- Modified ChatTextArea to save messages to local history before clearing input field
- Ensured messages typed at follow-up question prompts are preserved and accessible via up-arrow navigation
- Added deduplication logic to prevent duplicate entries when messages are confirmed by backend
This fix ensures that user messages are never lost, even if typed at choice prompts or if backend processing fails.1 parent 9b8f3b9 commit 7edeb0d
File tree
2 files changed
+57
-10
lines changed- webview-ui/src/components/chat
- hooks
2 files changed
+57
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
225 | 226 | | |
226 | 227 | | |
227 | 228 | | |
| |||
465 | 466 | | |
466 | 467 | | |
467 | 468 | | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
468 | 474 | | |
469 | 475 | | |
470 | 476 | | |
| |||
531 | 537 | | |
532 | 538 | | |
533 | 539 | | |
| 540 | + | |
534 | 541 | | |
535 | 542 | | |
536 | 543 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| 42 | + | |
| 43 | + | |
41 | 44 | | |
42 | 45 | | |
43 | 46 | | |
| |||
46 | 49 | | |
47 | 50 | | |
48 | 51 | | |
49 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
50 | 57 | | |
51 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
52 | 76 | | |
53 | 77 | | |
54 | 78 | | |
| |||
67 | 91 | | |
68 | 92 | | |
69 | 93 | | |
70 | | - | |
| 94 | + | |
71 | 95 | | |
72 | 96 | | |
73 | 97 | | |
| |||
175 | 199 | | |
176 | 200 | | |
177 | 201 | | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
178 | 217 | | |
179 | 218 | | |
180 | 219 | | |
| |||
184 | 223 | | |
185 | 224 | | |
186 | 225 | | |
| 226 | + | |
187 | 227 | | |
188 | 228 | | |
0 commit comments