From 9538640f561950f57fdc43e0267276cee6f0add7 Mon Sep 17 00:00:00 2001 From: RiceDee <345114586+RiceDee@users.noreply.github.com> Date: Sun, 1 Nov 2026 19:19:23 +1100 Subject: [PATCH] fix(ui): a bookmark made in the page grid goes to the current page (#5636) The grid moves the viewport without refreshing where the pages are on screen, so bookmark_position now gives no position there. --- crates/ui-egui/src/canvas/navigation.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/ui-egui/src/canvas/navigation.rs b/crates/ui-egui/src/canvas/navigation.rs index 7f149d912b..56df4f19bc 100644 --- a/crates/ui-egui/src/canvas/navigation.rs +++ b/crates/ui-egui/src/canvas/navigation.rs @@ -9,6 +9,11 @@ impl DocView { /// zoom are kept). `None` before the first frame has laid pages out, when the bookmark just /// goes to the current page. pub(crate) fn bookmark_position(&self, info: &DocInfo) -> Option<(usize, [Option; 2])> { + // The page grid moves the viewport without refreshing where the pages are on screen, so + // there is no position to read: the bookmark goes to the current page. + if self.organize { + return None; + } if let Some(sel) = self.selection && let Some(text) = self.texts.get(&sel.page) && let Some(p) = info.pages.get(sel.page)