Commit 8d81e99
committed
fix(acp): Replace optimistic message in-place to preserve order
The previous approach removed the optimistic message and appended the
persisted version at the end of the array, which broke chronological
order when assistant messages had already been added after it.
Now uses `findIndex` + in-place replacement to keep the message at
its correct position in the chat history.1 parent 634321d commit 8d81e99
1 file changed
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
99 | | - | |
| 98 | + | |
| 99 | + | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
102 | 108 | | |
103 | 109 | | |
104 | 110 | | |
| |||
0 commit comments