Issue #189: each document tab keeps its own scroll position (#259)

The page view's ScrollArea had no id of its own, so egui derived it from
the parent Ui, which is the same for every document. All tabs therefore
shared one scroll offset: switching to another document showed it at
wherever the previous one had been scrolled to (clamped to its length),
and switching back showed the first document at the other one's offset,
usually the top.

Salt the ScrollArea with the document's id so egui keeps one offset per
tab.

Test: viewer.rs::each_document_keeps_its_own_scroll_position scrolls
a.pdf to page 4, switches to b.pdf and scrolls it to page 2, then
switches back and forth: before the fix b.pdf opened on page 2 instead
of its own top. Cited as evidence on view.document-tabs.

Co-authored-by: wstock <1394687+wstock@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
wstock
2026-10-08 07:53:12 -04:00
committed by GitHub
co-authored by wstock Claude Opus 5.5
parent 2627081935
commit 786fa481f4
3 changed files with 33 additions and 3 deletions
+2 -2
View File
@@ -1166,8 +1166,8 @@ milestone = "M3"
status = "shipped"
commands = []
tools = ["doc_list"]
evidence = ["crates/ui-egui/tests/editing.rs::combining_files_opens_a_new_unsaved_tab", "crates/ui-egui/tests/control.rs::state_and_view_options"]
notes = ""
evidence = ["crates/ui-egui/tests/editing.rs::combining_files_opens_a_new_unsaved_tab", "crates/ui-egui/tests/control.rs::state_and_view_options", "crates/ui-egui/tests/viewer.rs::each_document_keeps_its_own_scroll_position"]
notes = "each tab keeps its own scroll position (#189)"
[[feature]]
id = "view.multiple-windows"