Keep rename preview scroll reports outside source boundaries

This commit is contained in:
2026-09-13 02:44:11 -07:00
parent 022d8cda2a
commit bebf9f594c
2 changed files with 12 additions and 0 deletions
+5
View File
@@ -1278,6 +1278,11 @@ impl App {
{
return Task::none();
}
// A validated preview measurement only retains display state. Do not
// turn each wheel report into source interaction or scan shared boundaries.
if let Message::SourceRename(event @ source_rename::Event::PreviewScrolled(..)) = message {
return self.source_rename_event(event);
}
let usage_viewport = self.diagram_reveal_viewport(&message);
let window_resized = matches!(&message, Message::WindowResized(_));
// Reject stale measurements before legacy viewport handlers can change
@@ -444,10 +444,17 @@ async fn details_remount_restores_wheel_offset_before_any_rescroll() {
offset > 10.,
"real wheel input must move the overflowing fixture"
);
let interaction = app.source_symbols.interaction;
let camera = app.camera_boundary();
let allocation = app.allocation_boundary();
for message in reports.iter().cloned() {
let task = app.update(message);
assert_eq!(mounted.execute(&app, task).await, 0);
}
assert_eq!(app.source_symbols.interaction, interaction);
assert!(app.camera_boundary() == camera);
assert!(app.allocation_boundary() == allocation);
assert_eq!(evidence(&app), before);
assert_eq!(
app.source_rename.form.as_ref().unwrap().preview_offset,
offset