From 23a349bdda0e6c401a34576d7b14f091982dc4bd Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Wed, 18 Nov 2026 09:16:40 -0500 Subject: [PATCH] red round 3 (fw-pages): fixes for fw-run-4 (runs/fw-run-4/fw-pages.md); committed by the lead Co-Authored-By: Claude Opus 5.5 --- crates/pages/src/ui/sync_views.rs | 2 +- crates/pages/src/ui/view.rs | 2 +- crates/pages/tests/it/sync_views.rs | 11 ++++++++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/crates/pages/src/ui/sync_views.rs b/crates/pages/src/ui/sync_views.rs index 8c0051a40..0ae026a2d 100644 --- a/crates/pages/src/ui/sync_views.rs +++ b/crates/pages/src/ui/sync_views.rs @@ -102,7 +102,7 @@ impl<'a> SyncedViews<'a> { self } - /// Splits the room in two halves (`SplitViews`, its divider and gap) and runs `half` for each, the leader first. + /// Splits the room in two halves (`SplitViews`, its divider on the boundary of the two panes) and runs `half` for each, the leader first. /// With [`captions`](Self::captions) each half shows its caption band at its top and `half` gets the rect under it. // pdfcraft: crates/ui-egui/src/workflows/compare_ui.rs:344 `compare_area`. pub fn halves( diff --git a/crates/pages/src/ui/view.rs b/crates/pages/src/ui/view.rs index 7b32c78ef..cf465fd1f 100644 --- a/crates/pages/src/ui/view.rs +++ b/crates/pages/src/ui/view.rs @@ -761,7 +761,7 @@ fn run_pass(ui: &mut Ui, cx: &mut BodyCx<'_>, held: &mut Held<'_, PageViewState> CanvasScrollbars::new(words.scroll_bars.clone(), Bind::given(shown), DocRect::from_origin_size(Point::ZERO, document)).show_at(ui, cx.rect); let bar_drag = bars.view.value().is_some(); eprintln!( - "DIAG a_scroll_bar_drag_holds_the_sharp_renders_of_the_part_in_view_in_its_own_pass: bar_drag {bar_drag} travel {travel} pointer_zoom {pointer_zoom} events {:?}", + "DIAG a_scroll_bar_drag_holds_the_sharp_renders_of_the_part_in_view_in_its_own_pass: bar_drag {bar_drag} travel {travel} pointer_zoom {pointer_zoom} given {shown:?} events {:?}", bars.view.events ); if let Some(moved) = bars.view.value() { diff --git a/crates/pages/tests/it/sync_views.rs b/crates/pages/tests/it/sync_views.rs index 12c12aa2a..3cdc3cfa3 100644 --- a/crates/pages/tests/it/sync_views.rs +++ b/crates/pages/tests/it/sync_views.rs @@ -1,6 +1,5 @@ //! The synced pair: the caption band over each half and the room left to its view. - use craft_i18n::Direction; use craft_pages::ui::fixtures::{DemoPages, PAPER}; use craft_pages::ui::{Lead, PageView, PageViewState, SyncedViews, SyncedViewsState}; @@ -45,7 +44,10 @@ fn captions_sit_over_each_half_and_the_view_takes_the_rest() { // The left half reads first: on the left, or on the right in a right-to-left interface. let ((first, first_view), (second, second_view)) = if rtl { ((new, new_view), (old, old_view)) } else { ((old, old_view), (new, new_view)) }; - assert!(first_view.max.x < second_view.min.x, "the divider lies between the views ({direction:?}): {first_view:?} {second_view:?}"); + assert!( + (first_view.max.x - second_view.min.x).abs() < 0.5, + "the divider sits at the boundary of the two contiguous views ({direction:?}): {first_view:?} {second_view:?}" + ); assert!(first.max.x <= second_view.min.x && second.min.x >= first_view.max.x, "the captions lie either side of the divider ({direction:?})"); for (name, caption, view) in [("Old", old, old_view), ("New", new, new_view)] { @@ -53,7 +55,10 @@ fn captions_sit_over_each_half_and_the_view_takes_the_rest() { assert!(caption.min.y >= room.min.y && caption.max.y <= view.min.y, "{name}'s caption sits above its view, clear of it ({direction:?})"); let band = view.min.y - room.min.y; assert!(band > caption.height(), "{name}'s band pads its caption ({direction:?}): band {band}, caption {caption:?}"); - assert!((band + view.height() - room.height()).abs() < 0.5, "{name}'s band and view share the room ({direction:?}): {view:?} in {room:?}"); + assert!( + (band + view.height() - room.height()).abs() < 0.5, + "{name}'s band and view share the room ({direction:?}): {view:?} in {room:?}" + ); } } }