Commit 7eaa8e4
committed
fix: prevent chat UI flickering during cancel operations and checkpoint restoration
- Added isSoftReloading flag to ClineProvider to track soft reload state
- Updated ExtensionMessage interface to include optional isSoftReload property
- Modified cancelTask to set/reset soft reload flag around task recreation
- Updated checkpointRestoreHandler to use soft reload flag for checkpoint operations
- Added UI-side handling in ChatView to check isSoftReload flag and skip re-rendering
- Implemented debouncing mechanism (50ms) for state updates to prevent rapid flickering
- Cancel button now passes isSoftReload flag to prevent UI flicker
This fixes the issue where the chat window would flicker and sometimes duplicate messages when users press Cancel to stop an API response or when restoring checkpoints after editing messages.
Fixes #86771 parent 1a3a873 commit 7eaa8e4
File tree
4 files changed
+83
-7
lines changed- src
- core/webview
- webview-ui/src/components/chat
4 files changed
+83
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| 144 | + | |
| 145 | + | |
144 | 146 | | |
145 | 147 | | |
146 | 148 | | |
| |||
583 | 585 | | |
584 | 586 | | |
585 | 587 | | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
586 | 594 | | |
587 | 595 | | |
588 | 596 | | |
| |||
1602 | 1610 | | |
1603 | 1611 | | |
1604 | 1612 | | |
1605 | | - | |
1606 | | - | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
1607 | 1618 | | |
1608 | | - | |
1609 | | - | |
1610 | | - | |
1611 | | - | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
1612 | 1635 | | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
| 1653 | + | |
| 1654 | + | |
1613 | 1655 | | |
1614 | 1656 | | |
1615 | 1657 | | |
| |||
2595 | 2637 | | |
2596 | 2638 | | |
2597 | 2639 | | |
| 2640 | + | |
| 2641 | + | |
| 2642 | + | |
2598 | 2643 | | |
2599 | 2644 | | |
2600 | 2645 | | |
| |||
2623 | 2668 | | |
2624 | 2669 | | |
2625 | 2670 | | |
| 2671 | + | |
| 2672 | + | |
2626 | 2673 | | |
2627 | 2674 | | |
2628 | 2675 | | |
| |||
2633 | 2680 | | |
2634 | 2681 | | |
2635 | 2682 | | |
| 2683 | + | |
| 2684 | + | |
2636 | 2685 | | |
2637 | 2686 | | |
2638 | 2687 | | |
2639 | 2688 | | |
2640 | 2689 | | |
2641 | 2690 | | |
| 2691 | + | |
| 2692 | + | |
| 2693 | + | |
| 2694 | + | |
| 2695 | + | |
| 2696 | + | |
2642 | 2697 | | |
2643 | 2698 | | |
2644 | 2699 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
30 | 33 | | |
31 | 34 | | |
32 | 35 | | |
| |||
78 | 81 | | |
79 | 82 | | |
80 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
81 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
82 | 94 | | |
83 | 95 | | |
84 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| 208 | + | |
208 | 209 | | |
209 | 210 | | |
210 | 211 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
728 | 728 | | |
729 | 729 | | |
730 | 730 | | |
731 | | - | |
| 731 | + | |
| 732 | + | |
732 | 733 | | |
733 | 734 | | |
734 | 735 | | |
| |||
780 | 781 | | |
781 | 782 | | |
782 | 783 | | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
783 | 791 | | |
784 | 792 | | |
785 | 793 | | |
| |||
0 commit comments