Commit cb17207
authored
fix(rich-md-editor): stop the editor flashing during an agent rewrite (#5160)
* fix(rich-md-editor): stop the editor flashing during an agent rewrite
Only reveal streamed chunks that extend what's already shown. A divergent chunk
(an agent rewrite/edit, e.g. removing appended text) would collapse the document
to the partial result and flash on every chunk; now the current content is held
in place and the final result is applied once on settle. Fresh writes still
reveal live.
* fix(rich-markdown-editor): seed shown-body on settled mount and track local edits
Seed lastSyncedBodyRef from a settled (non-streaming) mount and update it on
local edits via onUpdate, so the streaming hold engages on the very first agent
rewrite chunk (no collapse/flash) and the settle still applies the rewrite that
removes a local edit.1 parent 39cfae9 commit cb17207
1 file changed
Lines changed: 16 additions & 3 deletions
File tree
- apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor
Lines changed: 16 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
161 | 169 | | |
162 | 170 | | |
163 | 171 | | |
| |||
263 | 271 | | |
264 | 272 | | |
265 | 273 | | |
| 274 | + | |
266 | 275 | | |
267 | 276 | | |
268 | 277 | | |
269 | 278 | | |
270 | 279 | | |
271 | | - | |
272 | | - | |
273 | 280 | | |
274 | 281 | | |
275 | 282 | | |
| |||
291 | 298 | | |
292 | 299 | | |
293 | 300 | | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
294 | 307 | | |
295 | 308 | | |
296 | 309 | | |
| |||
303 | 316 | | |
304 | 317 | | |
305 | 318 | | |
306 | | - | |
| 319 | + | |
307 | 320 | | |
308 | 321 | | |
309 | 322 | | |
| |||
0 commit comments