Defer owned transcript redraws during raw paste bursts (#52964)

## Why

Raw pastes can arrive as thousands of character, Enter, and Tab events. Redrawing the entire owned transcript before each buffered key defeats the composer's paste batching.

## What changed

Skip those redraws while the composer is capturing a paste burst. Continue refreshing geometry immediately for transcript interactions, shortcuts, and non-text keys, including Enter when an accepted Find owns it.

## Testing

Add regression tests and a render snapshot covering multiline raw paste with tabs and Korean text, deferred rendering until the burst flushes, and a single submission of the complete pasted text. Also verify that an accepted Find still handles Enter during a paste burst without submitting the draft.

GitOrigin-RevId: 49d89958a89c165249322463e6075377c517bd8e
This commit is contained in:
Eric Traut
2026-10-10 19:15:09 +00:00
committed by copyberry
parent 47bcb3a3f9
commit ecebd679c3
4 changed files with 222 additions and 2 deletions
+5 -1
View File
@@ -499,6 +499,10 @@ impl ChatWidget {
self.refresh_startup_recovery();
}
pub(crate) fn is_in_paste_burst(&self) -> bool {
self.bottom_pane.is_in_paste_burst()
}
// Returns true if caller should skip rendering this frame (a future frame is scheduled).
pub(crate) fn handle_paste_burst_tick(&mut self, frame_requester: FrameRequester) -> bool {
if self.bottom_pane.flush_paste_burst_if_due() {
@@ -506,7 +510,7 @@ impl ChatWidget {
// A paste just flushed; request an immediate redraw and skip this frame.
self.request_redraw();
true
} else if self.bottom_pane.is_in_paste_burst() {
} else if self.is_in_paste_burst() {
// While capturing a burst, schedule a follow-up tick and skip this frame
// to avoid redundant renders between ticks.
frame_requester.schedule_frame_in(