From 02fbb6a976e705a4ef937d71c5145b5d12e06d3b Mon Sep 17 00:00:00 2001 From: Nasim <40519831+Naseq@users.noreply.github.com> Date: Sun, 8 Nov 2026 11:29:22 +0430 Subject: [PATCH] =?UTF-8?q?Notes:=20pin=20that=20Paste=20reaches=20the=20f?= =?UTF-8?q?ocused=20speaker-notes=20field,=20bare=20and=20inside=20the=20?= =?UTF-8?q?=E2=8C=98V=20batch=20(refs=20#1855)=20(#1856)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/ui-egui/src/tests.rs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/crates/ui-egui/src/tests.rs b/crates/ui-egui/src/tests.rs index 677e971c5..d84d7d32f 100644 --- a/crates/ui-egui/src/tests.rs +++ b/crates/ui-egui/src/tests.rs @@ -1223,6 +1223,31 @@ fn step_app(services: Services) -> egui_kittest::Harness<'static, SlideApp> { h } +/// #1855: text pasted into the focused speaker-notes field lands at its caret. While a stock +/// field has the focus, `SlideApp::keyboard` leaves the batch to it and nothing in the app drops +/// `Paste`, whether it arrives alone or inside the ⌘V batch egui-winit sends (V down, Paste, V up). +#[test] +fn paste_reaches_the_focused_notes_field() { + let mut h = step_app(Services::default()); + let id = egui::Id::unique("notes_edit"); + h.ctx.memory_mut(|m| m.request_focus(id)); + h.run_steps(2); + assert!(h.ctx.memory(|m| m.has_focus(id)), "the notes field has the focus"); + h.event(egui::Event::Text("ab".into())); + h.run_steps(2); + h.event(egui::Event::Paste("PASTED".into())); + h.run_steps(2); + assert_eq!(h.state().notes_buf.2.text, "abPASTED", "a bare Paste event"); + let v = |pressed| egui::Event::Key { key: egui::Key::V, physical_key: None, pressed, repeat: false, modifiers: egui::Modifiers::COMMAND }; + h.input_mut().events.extend([v(true), egui::Event::Paste("TWO".into()), v(false)]); + h.run_steps(2); + assert_eq!(h.state().notes_buf.2.text, "abPASTEDTWO", "the ⌘V batch"); + // Leaving the field commits the notes to the slide. + h.ctx.memory_mut(|m| m.surrender_focus(id)); + h.run_steps(3); + assert_eq!(h.state().session.active().unwrap().doc.slides[0].notes_text(), "abPASTEDTWO"); +} + /// #1956: the ribbon's drop-downs are announced by their purpose, not by their value or an /// internal key. Animations › Start with a shape that has no animation was "astart"; Home's Font /// and Font size boxes were "font" and "size" while nothing told them a font or size.