PdfCraft: An open-source PDF reader and editor written by scratch in pure Rust
M3: Save asks before writing over a changed file, one tab per file, locked autosaves (#2166) (#2218)
mtlcl4103de8d5678494
diff --git a/ATTRIBUTION.toml b/ATTRIBUTION.tomlindex d4ff7802c..ff4e1b6c8 100644--- a/ATTRIBUTION.toml+++ b/ATTRIBUTION.toml@@ -7,7 +7,7 @@ licence = "MIT OR Apache-2.0"licence_file = "LICENSE-MIT"kind = "translation"usage = "Greek UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"-sha256 = "22f3fdd8849e6ef0f8dca9dcbb4f7a14835162379b84f89de05eafdc68f3557d"+sha256 = "110f2a5262514645144a7312e724f6bf2ff9cd12bf49d93668d99f0fe868ee92"# ATTRIBUTION.toml: one entry per asset (AGENTS.md §1). The source of truth for provenance and licences.# ATTRIBUTION.md is generated from this file: `cargo xtask assets --write`. Checked by `cargo xtask assets` (part of `xtask ci`).@@ -30,7 +30,7 @@ licence = "MIT OR Apache-2.0"licence_file = "LICENSE-MIT"kind = "translation"usage = "Simplified Chinese UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"-sha256 = "96bf1d0993b3d1e19fb4953c37f47649d7b7e373d600b17f12c8aca2e3644d57"+sha256 = "1ca0dba0272a5b5d928ec9dd58a14e1fd8d1f56b4fc23d8d8315a03302fec4d2"[[asset]]path = "crates/ui-egui/src/i18n/zh-hant.tsv"@@ -41,7 +41,7 @@ licence = "MIT OR Apache-2.0"licence_file = "LICENSE-MIT"kind = "translation"usage = "Traditional Chinese UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"-sha256 = "78569ef1bffd54432b57ce84d21f1c65e6e3cf60f47f19a284b4d5e7a4c4aa71"+sha256 = "41ab3391e815144ff1a4e29034c8edfc566ca0b3d669cc521ef38d33f8d0603a"[[asset]]path = "crates/ui-egui/src/i18n/cs.tsv"@@ -52,7 +52,7 @@ licence = "MIT OR Apache-2.0"licence_file = "LICENSE-MIT"kind = "translation"usage = "Czech UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"-sha256 = "bd0605ae01a6f0cef6675fb73006ca798338892650102a1df5d3d815bc964c63"+sha256 = "90360967683e870a6c12c3fb91ed4f03b1204f2b031f88845d7b2ec4480067ff"[[asset]]path = "crates/ui-egui/src/i18n/pt-br.tsv"@@ -63,7 +63,7 @@ licence = "MIT OR Apache-2.0"licence_file = "LICENSE-MIT"kind = "translation"usage = "Brazilian Portuguese UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"-sha256 = "aca4600c31bbc48a9c46328643704850f383cf799f7fed4651aaf1f0bcecc1b7"+sha256 = "4d1bf401a120ce51d9a584362feb1db1cc6a7694157cb7bd9d6acf7a8a8309cb"[[asset]]path = "crates/ui-egui/src/i18n/es.tsv"@@ -74,7 +74,7 @@ licence = "MIT OR Apache-2.0"licence_file = "LICENSE-MIT"kind = "translation"usage = "Spanish UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"-sha256 = "0d5992212ead5820c0686b9a1990f29949d347e73d4c485a66e029c8edbaccb0"+sha256 = "3e24afe4cce398fde6b15047d118f37f5cbbaf38fae23f22dd4b244746fe1e6b"[[asset]]path = "crates/ui-egui/src/i18n/fr.tsv"@@ -85,7 +85,7 @@ licence = "MIT OR Apache-2.0"licence_file = "LICENSE-MIT"kind = "translation"usage = "French UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"-sha256 = "bae65abd8480f3dfcb36fbdc9ad7578adf78e7630e3c81ffc4cc7351d61cfd55"+sha256 = "2855204f355fc4720e3621021005fe042bd3272faddf41010883debe4b3ac848"[[asset]]path = "crates/ui-egui/src/i18n/de.tsv"@@ -96,7 +96,7 @@ licence = "MIT OR Apache-2.0"licence_file = "LICENSE-MIT"kind = "translation"usage = "German UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"-sha256 = "9db8eaa561c362f9efcf44f4b5f2c380615dead8da29e66fbe49085c71c4af13"+sha256 = "2fb8ff03f3aa8463ced6cfc9f4683581520beb42d08867e26414d926ba4317e7"[[asset]]path = "crates/ui-egui/src/i18n/te.tsv"@@ -107,7 +107,7 @@ licence = "MIT OR Apache-2.0"licence_file = "LICENSE-MIT"kind = "translation"usage = "Telugu UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"-sha256 = "96a8ed3759e00d5b400472d186d418b88b1a0c33fa15644399506d998975083b"+sha256 = "dbec277ec7965222c608fdc40ff63827022efe75abbe9d38e22bb49933145059"[[asset]]path = "crates/ui-egui/src/i18n/it.tsv"@@ -118,7 +118,7 @@ licence = "MIT OR Apache-2.0"licence_file = "LICENSE-MIT"kind = "translation"usage = "Italian UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"-sha256 = "84900cd6c913d77f55d229f2204e778136029f52772d82a0230525a24fada4a1"+sha256 = "4b9a018a8d3876d48d898e1684f6253c13936794e5ed93c28bc9224ffb4d3b4e"[[asset]]path = "crates/ui-egui/src/i18n/pl.tsv"@@ -129,7 +129,7 @@ licence = "MIT OR Apache-2.0"licence_file = "LICENSE-MIT"kind = "translation"usage = "Polish UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"-sha256 = "944d8e2bb7f5ea24adac2251a4f3f17af971f521e70026727cf17e362339bbea"+sha256 = "a0530e10fb03abf9da1a2ab6a8f29f4566f65d658b0ce5d5320b7d37001edd0c"[[asset]]path = "crates/ui-egui/src/i18n/ru.tsv"@@ -140,7 +140,7 @@ licence = "MIT OR Apache-2.0"licence_file = "LICENSE-MIT"kind = "translation"usage = "Russian UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"-sha256 = "4716f4e2124a669634e68f93a0d99e339c531ade667b1cb6c769f9349cd15517"+sha256 = "e4677cfb72372d76ff585ca9276977d43a7c4b2b930cb7be8bb0d4f66d8bbe15"[[asset]]path = "crates/ui-egui/src/i18n/hu.tsv"@@ -151,7 +151,7 @@ licence = "MIT OR Apache-2.0"licence_file = "LICENSE-MIT"kind = "translation"usage = "Hungarian UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"-sha256 = "161b8fec2d1d832d2a88c479decc0f666cda01ccec5f60d1338b54ba11242358"+sha256 = "3a7960c31871361ec84c531d6d7c694c6d185374577f563aeca444cef8a00ee7"[[asset]]path = "crates/ui-egui/src/i18n/bg.tsv"@@ -162,7 +162,7 @@ licence = "MIT OR Apache-2.0"licence_file = "LICENSE-MIT"kind = "translation"usage = "Bulgarian UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"-sha256 = "e7fd488de8417519614725f150ba3621c86abcf97e70bd4dfcc4fb01bd09d7ac"+sha256 = "3f1f5e1cdd05aefb613421b896525448ed4fbbcc3e6d63fba961b0add49bd404"[[asset]]path = "crates/ui-egui/src/i18n/kk.tsv"@@ -173,7 +173,7 @@ licence = "MIT OR Apache-2.0"licence_file = "LICENSE-MIT"kind = "translation"usage = "Kazakh UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"-sha256 = "df9c65e807e3bcd86b283248510ccca5ab470ae6209fe4a367a7238826416b4f"+sha256 = "8421ad841f41182d640fa5cf675184ba8d0c0119ff992b185398d7cd51171d28"[[asset]]path = "crates/ui-egui/src/i18n/ja.tsv"@@ -184,7 +184,7 @@ licence = "MIT OR Apache-2.0"licence_file = "LICENSE-MIT"kind = "translation"usage = "Japanese UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"-sha256 = "a7fbbd81686e0001b7173b51e4feaa8d4e00cfbbcb48fef350122088a494f6d6"+sha256 = "55aa36c5607de5be34526665366f072fe7786d2545b78f8408c81a3c42ece201"[[asset]]path = "crates/ui-egui/src/i18n/uk.tsv"@@ -195,7 +195,7 @@ licence = "MIT OR Apache-2.0"licence_file = "LICENSE-MIT"kind = "translation"usage = "Ukrainian UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"-sha256 = "c7550bde0d8b00e348a7c89f6ade7bb960371a75d88968bd5af588257ebc68be"+sha256 = "8d893071405f05673a80164e9910288a7931c02a80d070339b35163c95c66466"[[asset]]path = "crates/ui-egui/src/i18n/ar.tsv"@@ -206,7 +206,7 @@ licence = "MIT OR Apache-2.0"licence_file = "LICENSE-MIT"kind = "translation"usage = "Arabic UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"-sha256 = "10a56fcf63ac1714ec23dd57ee5ddf7e0d16fd7eaebf28b065e58ed96c9f5d8e"+sha256 = "0ff60d3ca5ca3f675815d6bdc1eb69474438c5f130fd12a70e483ce150687b8d"[[asset]]path = "crates/ui-egui/src/i18n/tr.tsv"@@ -217,7 +217,7 @@ licence = "MIT OR Apache-2.0"licence_file = "LICENSE-MIT"kind = "translation"usage = "Turkish UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"-sha256 = "f111d02153db4277b6cddb77c5823ac30e1377f3aae59bca962a5884f3857d48"+sha256 = "4dc2b84acde904350edfa4bbe0886cb86145a093ecc7b874e0f17c6e7d6464ff"[[asset]]path = "crates/ui-egui/src/i18n/lt.tsv"@@ -228,7 +228,7 @@ licence = "MIT OR Apache-2.0"licence_file = "LICENSE-MIT"kind = "translation"usage = "Lithuanian UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"-sha256 = "22ffe5e2c5b43c7b29df378ad4f9773584467b411f3cf647e7b21f5bce862446"+sha256 = "a66e580aa58bcda4e598d63c7b50b27532be6d5fe3b2fedff1faf070250010a4"[[asset]]@@ -3363,7 +3363,7 @@ licence = "MIT OR Apache-2.0"licence_file = "LICENSE-MIT"kind = "translation"usage = "Slovene UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"-sha256 = "ad4439af89320c314064d1062ab057b53366d857c6dd0deafbea7069ffc5920c"+sha256 = "773913ba39e959b007a7615cd2cccecd0f03bf5c6cad997afec9cdf65c8de922"[[asset]]path = "vendor/vello_common/assets/probe.png"diff --git a/ROADMAP.md b/ROADMAP.mdindex 6348ed7e4..d2ab2637b 100644--- a/ROADMAP.md+++ b/ROADMAP.md@@ -157,6 +157,7 @@ Ranked; detail and the full milestone table in [docs/roadmap.md](docs/roadmap.md## Progress log- **2026-10-13 (G14, Vietnamese localization):** Added Vietnamese (`vi`, Tiếng Việt) as an interface and date language with a 2,591-entry catalog (`plural_none`) covering 100% of the current localizable key union (plus `theme`/`Appearance`). Locale tags `vi` / `vi-VN` / `vi_VN.UTF-8` resolve; calendar months use numeric `Tháng 1`…`12` / `tháng 1`…`12`. Native-speaker community review recorded. The twelve-language localization mean moves from ≈59% to ≈68%; weighted readiness ≈49% → ≈50%. Status stays `partial`: engine/OS details, document contents, filenames, CLI/MCP and external help stay outside the catalog by design.+- **2026-10-15 (M3, #2166 part 1):** Save asks before writing over a version of the file the document did not come from (something else wrote it since the open or the last save), with Save as… to keep it, and the changed-on-disk notice says what Reload and Save each do; a file that is open already comes to the front instead of opening twice; a running instance's autosaves are locked, so a second instance neither offers nor discards them. Part 2 (every writer checked and atomic) is #2182.- **2026-10-14 (M1, #2166):** No PDF leaves the engine unchecked and no writer truncates: new files from Combine, Extract, Split and Create, signed, timestamped and LTV-embedded files and the OCR batch output reopen with their pages before anyone writes them, as saves already did; the desktop app, the automation tools (with or without `--root`) and the CLI's edit, combine, extract and split all write through the one staging-file writer in `pdfcraft-platform`, so a failed write or `--out` naming the input never leaves a half-written file. Special files such as `/dev/stdout` are still written as given.- **2026-10-14 (M3 #2080 candidate):** Existing per-tab page history gains explicit search jumps, rail buttons and control-channel commands. Continuous scrolling and automatic search refresh stay outside history; page-level restoration and estimates unchanged.diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rsindex c3100e3bb..2ede8f1f8 100644--- a/crates/ui-egui/src/canvas.rs+++ b/crates/ui-egui/src/canvas.rs@@ -3976,8 +3976,10 @@ fn notices(ui.horizontal(|ui| {ui.add(icons::image("rotate-cw", 16.0, t.accent_text));ui.label(- egui::RichText::new(tl!("This file changed on disk. Reload it to see the new version; your unsaved changes will be lost."))- .color(t.text),+ egui::RichText::new(tl!(+ "This file changed on disk. Reload shows the new version and drops your unsaved changes; Save replaces it with this version."+ ))+ .color(t.text),);ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| {if icons::button(ui, "x", 22.0, false, tl!("Dismiss")).clicked() {diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rsindex e28d67c31..12dbe490a 100644--- a/crates/ui-egui/src/dialogs.rs+++ b/crates/ui-egui/src/dialogs.rs@@ -63,6 +63,8 @@ fn dialogs(app: &mut PdfCraftApp, ctx: &egui::Context) {let mut import_words = false;let mut print_go = false;let mut revert_now = false;+ let mut overwrite_now = false;+ let mut overwrite_elsewhere = false;let mut summarize_now = false;let mut optimize_now = false;let mut duplicate_now: Option<Edit> = None;@@ -799,6 +801,33 @@ fn dialogs(app: &mut PdfCraftApp, ctx: &egui::Context) {});return;}+ Dialog::OverwriteChanged => {+ #[cfg(not(target_arch = "wasm32"))]+ let name = app.pending_overwrite.as_ref().and_then(|p| app.session.get(p.id)).map(|d| d.name.clone()).unwrap_or_default();+ #[cfg(target_arch = "wasm32")]+ let name = String::new();+ ui.label(egui::RichText::new(tl!("Save over the changed file?")).font(theme::semibold(18.0)));+ ui.add_space(8.0);+ ui.label(crate::i18n::fmt(+ tl!("“{name}” changed on disk after it was opened or last saved. Saving now replaces that newer version with this one."),+ &[("name", &name)],+ ));+ ui.add_space(12.0);+ ui.with_layout(Layout::right_to_left(Align::Center), |ui| {+ if widgets::pill_button(ui, tl!("Save anyway"), true).clicked() {+ overwrite_now = true;+ close = true;+ }+ if widgets::pill_button(ui, tl!("Save as…"), false).clicked() {+ overwrite_elsewhere = true;+ close = true;+ }+ if widgets::pill_button(ui, tl!("Cancel"), false).clicked() {+ close = true;+ }+ });+ return;+ }Dialog::Print => {let Some((i, id)) = app.active_ids() else {close = true;@@ -1214,6 +1243,22 @@ fn dialogs(app: &mut PdfCraftApp, ctx: &egui::Context) {if revert_now {app.revert_active();}+ #[cfg(not(target_arch = "wasm32"))]+ {+ if overwrite_now {+ app.overwrite_changed_file();+ }+ if overwrite_elsewhere {+ app.save_changed_file_elsewhere();+ }+ }+ #[cfg(target_arch = "wasm32")]+ let _ = (overwrite_now, overwrite_elsewhere);+ // Cancelled or dismissed: the save is dropped.+ #[cfg(not(target_arch = "wasm32"))]+ if dialog == Dialog::OverwriteChanged && (modal.should_close() || close) {+ app.pending_overwrite = None;+ }if summarize_now {app.summarize_comments();}diff --git a/crates/ui-egui/src/editing.rs b/crates/ui-egui/src/editing.rsindex ddd1af824..08c7a944e 100644--- a/crates/ui-egui/src/editing.rs+++ b/crates/ui-egui/src/editing.rs@@ -18,6 +18,16 @@ pub enum CloseRequest {All,}+/// A save held back by [`Dialog::OverwriteChanged`](crate::Dialog::OverwriteChanged): the file+/// on disk is another version than the document came from (#2166).+#[cfg(not(target_arch = "wasm32"))]+pub struct PendingOverwrite {+ pub id: pdfcraft_engine::DocId,+ pub dest: String,+ /// What was to run once the document is written (close its tab, quit).+ after: Box<dyn FnOnce(&mut PdfCraftApp) + Send>,+}+/// Where Save writes.#[derive(Clone, Copy, Debug, PartialEq, Eq)]pub enum SaveTarget {@@ -597,18 +607,12 @@ impl PdfCraftApp {let dialog = rfd::AsyncFileDialog::new().add_filter("PDF", &["pdf"]).set_file_name(name);// The bytes are taken once the user has chosen, so edits made meanwhile are saved too.self.ask_one(crate::pickers::Ask::Save(dialog), None, move |app, dest| {- if app.save_doc_to(id, &dest.to_string_lossy()) {- after(app);- }+ app.save_doc_to_then(id, &dest.to_string_lossy(), Box::new(after));});return false;}};- let saved = self.save_doc_to(id, &destination);- if saved {- after(self);- }- saved+ self.save_doc_to_then(id, &destination, Box::new(after))}#[cfg(target_arch = "wasm32")]{@@ -657,6 +661,44 @@ impl PdfCraftApp {}}+ /// [`Self::save_doc_to`], then `after`. When `dest` is the document's own file and it is+ /// another version on disk than the one the document came from (something else wrote it+ /// since the open or the last save, #2166), it asks first: the save waits in+ /// `pending_overwrite` behind [`Dialog::OverwriteChanged`](crate::Dialog::OverwriteChanged).+ /// Returns `true` if written now.+ #[cfg(not(target_arch = "wasm32"))]+ fn save_doc_to_then(&mut self, id: pdfcraft_engine::DocId, dest: &str, after: Box<dyn FnOnce(&mut Self) + Send>) -> bool {+ let own = self.session.get(id).and_then(|d| d.path.as_deref()).is_some_and(|p| crate::same_file(p, dest));+ if own && self.watch.disk_differs(id, dest) {+ self.pending_overwrite = Some(PendingOverwrite { id, dest: dest.to_string(), after });+ self.dialog = Some(crate::Dialog::OverwriteChanged);+ return false;+ }+ let saved = self.save_doc_to(id, dest);+ if saved {+ after(self);+ }+ saved+ }++ /// The dialog's Save anyway: write over the changed file.+ #[cfg(not(target_arch = "wasm32"))]+ pub(crate) fn overwrite_changed_file(&mut self) {+ let Some(p) = self.pending_overwrite.take() else { return };+ if self.save_doc_to(p.id, &p.dest) {+ (p.after)(self);+ }+ }++ /// The dialog's Save as…: leave the file on disk as it is and ask where to put this version.+ #[cfg(not(target_arch = "wasm32"))]+ pub(crate) fn save_changed_file_elsewhere(&mut self) {+ let Some(p) = self.pending_overwrite.take() else { return };+ if let Some(index) = self.views.iter().position(|v| v.id == p.id) {+ self.save_then(index, SaveTarget::As, p.after);+ }+ }+/// Write document `id` to `dest` and make it the document's file. Returns `true` if written.#[cfg(not(target_arch = "wasm32"))]fn save_doc_to(&mut self, id: pdfcraft_engine::DocId, dest: &str) -> bool {diff --git a/crates/ui-egui/src/file_watch.rs b/crates/ui-egui/src/file_watch.rsindex e0e653e0e..533842d7e 100644--- a/crates/ui-egui/src/file_watch.rs+++ b/crates/ui-egui/src/file_watch.rs@@ -247,6 +247,10 @@ pub struct FileWatch {inline: Watcher,/// The version of each document's file that PdfCraft last read or wrote.known: HashMap<DocId, Stamp>,+ /// The version each document came from (its open, reload or last save). Unlike `known`,+ /// a version found on disk and not applied (the document had unsaved changes) is not+ /// recorded here, so Save can tell that the file is not the one the document came from.+ basis: HashMap<DocId, Stamp>,/// How many times PdfCraft has read or written each document's file: a version the watcher/// found before the latest one is older than the document in memory, and is not applied/// (#1802).@@ -259,20 +263,29 @@ impl FileWatch {/// PdfCraft read or wrote `path` for `doc`: that version is not a change, and anything the/// watcher found before it is stale.pub fn known_now(&mut self, doc: DocId, path: &str) {- if let Some(stamp) = Stamp::at(path) {- self.known.insert(doc, stamp);- }- self.bump(doc);+ self.known_as(doc, Stamp::at(path));}/// Remember `stamp`, read before the file was, for `doc`.pub fn known_as(&mut self, doc: DocId, stamp: Option<Stamp>) {if let Some(stamp) = stamp {self.known.insert(doc, stamp);+ self.basis.insert(doc, stamp);}self.bump(doc);}+ /// Whether the file at `path` is another version than the one `doc` came from: something+ /// else wrote it since the document was opened, reloaded or last saved (#2166). A file+ /// that is missing or can't be looked at, or a document whose version was never recorded,+ /// is not a difference.+ pub fn disk_differs(&self, doc: DocId, path: &str) -> bool {+ match (Stamp::at(path), self.basis.get(&doc)) {+ (Some(now), Some(basis)) => now != *basis,+ _ => false,+ }+ }+fn bump(&mut self, doc: DocId) {let epoch = self.epoch.entry(doc).or_default();*epoch = epoch.wrapping_add(1);@@ -307,6 +320,7 @@ impl PdfCraftApp {let list: Vec<Watched> = self.watched().map(|(doc, path, known, epoch)| Watched { doc, path: path.to_owned(), known, epoch }).collect();let open: Vec<DocId> = self.views.iter().map(|v| v.id).collect();self.watch.known.retain(|doc, _| open.contains(doc));+ self.watch.basis.retain(|doc, _| open.contains(doc));self.watch.epoch.retain(|doc, _| open.contains(doc));if self.send_to_watcher(list.clone()) {self.watch.sent = list;@@ -514,7 +528,12 @@ mod tests {let app = h.state_mut();app.views[0].select_pages(&[0]);app.apply_edit(pdfcraft_engine::Edit::RotatePages { pages: vec![0], degrees: 90 });- assert!(app.save_active(SaveTarget::InPlace), "saved version C");+ // B is on disk, not the A the document came from: Save asks first (#2166), and the+ // user saves C over it.+ assert!(!app.save_active(SaveTarget::InPlace), "asks before writing over B");+ app.overwrite_changed_file();+ assert!(!doc(&h).dirty, "saved version C");+ let app = h.state_mut();app.watch.found.lock().unwrap().extend(stale);h.run_steps(3);let d = doc(&h);diff --git a/crates/ui-egui/src/i18n/ar.tsv b/crates/ui-egui/src/i18n/ar.tsvindex 470ccc720..bb827f179 100644--- a/crates/ui-egui/src/i18n/ar.tsv+++ b/crates/ui-egui/src/i18n/ar.tsv@@ -1416,6 +1416,9 @@Sort comments by: فرز التعليقات حسب:Create PDF Comment Summary إنشاء ملخص تعليقات PDFRevert to the previously saved version of “{name}”? Changes since then can't be undone afterwards. هل تريد الرجوع إلى آخر نسخة محفوظة من «{name}»؟ لا يمكن التراجع بعدها عن التغييرات التي أُجريت منذ ذلك الحين.+ Save over the changed file? الحفظ فوق الملف الذي تغيّر؟+ “{name}” changed on disk after it was opened or last saved. Saving now replaces that newer version with this one. تغيّر «{name}» على القرص بعد فتحه أو حفظه آخر مرة. الحفظ الآن يستبدل تلك النسخة الأحدث بهذه.+ Save anyway الحفظ على أي حالNumber pages ترقيم الصفحاتStyle النمطNone (prefix only) لا شيء (البادئة فقط)@@ -2290,7 +2293,7 @@ key Space مسافةPrinter paper and scaling may differ. Check driver settings. قد يختلف ورق الطابعة ومقياس الطباعة. تحقق من إعدادات برنامج التشغيل.Drawing scale changes. Use Actual size for full-scale plans. يتغير مقياس الرسم. استخدم الحجم الفعلي لطباعة المخططات بمقياسها الأصلي.Reload documents when their files change on disk إعادة تحميل المستندات عند تغيّر ملفاتها على القرص- This file changed on disk. Reload it to see the new version; your unsaved changes will be lost. تغيّر هذا الملف على القرص. أعد تحميله لعرض النسخة الجديدة؛ ستفقد تغييراتك غير المحفوظة.+ This file changed on disk. Reload shows the new version and drops your unsaved changes; Save replaces it with this version. تغيّر هذا الملف على القرص. «إعادة التحميل» تعرض النسخة الجديدة وتُسقط تغييراتك غير المحفوظة؛ و«حفظ» يستبدلها بهذه النسخة.Reload إعادة تحميلCouldn't reload {name}: {e} تعذّرت إعادة تحميل {name}: {e}Select page {label} تحديد الصفحة {label}diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsvindex dd5ba04e9..5ca1b844c 100644--- a/crates/ui-egui/src/i18n/bg.tsv+++ b/crates/ui-egui/src/i18n/bg.tsv@@ -1368,6 +1368,9 @@Sort comments by: Сортирай коментарите по:Create PDF Comment Summary Създай PDF обобщение на коментаритеRevert to the previously saved version of “{name}”? Changes since then can't be undone afterwards. Да се върне ли последната записана версия на „{name}“? Промените след нея няма да могат да бъдат отменени.+ Save over the changed file? Да се запише ли върху променения файл?+ “{name}” changed on disk after it was opened or last saved. Saving now replaces that newer version with this one. „{name}“ беше променен на диска след отварянето или последното записване. Записването сега заменя тази по-нова версия с настоящата.+ Save anyway Запис въпреки товаNumber pages Номерирай страницитеStyle СтилNone (prefix only) Без (само префикс)@@ -2232,7 +2235,7 @@ key Space ИнтервалPrinter paper and scaling may differ. Check driver settings. Хартията и мащабът на принтера може да се различават. Проверете настройките на драйвера.Drawing scale changes. Use Actual size for full-scale plans. Мащабът на чертежа се променя. Използвайте Действителен размер за планове в оригинален мащаб.Reload documents when their files change on disk Презареждай документите, когато файловете им се променят на диска- This file changed on disk. Reload it to see the new version; your unsaved changes will be lost. Този файл е променен на диска. Презаредете го, за да видите новата версия; незаписаните ви промени ще бъдат загубени.+ This file changed on disk. Reload shows the new version and drops your unsaved changes; Save replaces it with this version. Този файл беше променен на диска. „Презареждане“ показва новата версия и отхвърля незаписаните ви промени; „Запис“ я заменя с тази версия.Reload ПрезаредиCouldn't reload {name}: {e} Неуспешно презареждане на {name}: {e}Select page {label} Избиране на страница {label}diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsvindex f7374a1bc..4fa7d1caa 100644--- a/crates/ui-egui/src/i18n/cs.tsv+++ b/crates/ui-egui/src/i18n/cs.tsv@@ -137,7 +137,7 @@Used when a PDF doesn't ask for a layout or zoom. Continuous scrolling never snaps between pages. Používá se, když PDF nepožaduje rozložení ani zvětšení. Plynulé posouvání mezi stránkami neskáče.Reopen the files that were open when PdfCraft last closed Znovu otevřít soubory, které byly otevřené při posledním zavření aplikace PdfCraftReload documents when their files change on disk Znovu načítat dokumenty při změně jejich souborů na disku- This file changed on disk. Reload it to see the new version; your unsaved changes will be lost. Tento soubor se na disku změnil. Znovu jej načtěte, abyste viděli novou verzi; neuložené změny budou ztraceny.+ This file changed on disk. Reload shows the new version and drops your unsaved changes; Save replaces it with this version. Tento soubor se na disku změnil. Znovu načíst zobrazí novou verzi a zahodí neuložené změny; Uložit ji nahradí touto verzí.Reload Znovu načístCouldn't reload {name}: {e} Soubor {name} nelze znovu načíst: {e}Choose a PNG or JPEG image (up to 4 MiB). Transparency is preserved. Vyberte obrázek PNG nebo JPEG (nejvýše 4 MiB). Průhlednost bude zachována.@@ -1484,6 +1484,9 @@ key Space MezerníkSort comments by: Seřadit komentáře podle:Create PDF Comment Summary Vytvořit souhrn komentářů v PDFRevert to the previously saved version of “{name}”? Changes since then can't be undone afterwards. Vrátit se k dříve uložené verzi „{name}“? Změny provedené od té doby pak nepůjde vrátit zpět.+ Save over the changed file? Uložit přes změněný soubor?+ “{name}” changed on disk after it was opened or last saved. Saving now replaces that newer version with this one. Soubor „{name}“ se na disku změnil po otevření nebo posledním uložení. Uložení nyní nahradí tuto novější verzi touto.+ Save anyway Přesto uložitNumber pages Očíslovat stránkyStyle StylNone (prefix only) Žádný (jen předpona)diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsvindex 9f7d40de7..4544f1d26 100644--- a/crates/ui-egui/src/i18n/de.tsv+++ b/crates/ui-egui/src/i18n/de.tsv@@ -1401,6 +1401,9 @@Sort comments by: Kommentare sortieren nach:Create PDF Comment Summary Kommentarübersicht erstellenRevert to the previously saved version of “{name}”? Changes since then can't be undone afterwards. Zur zuletzt gespeicherten Version von „{name}“ zurückkehren? Seitdem vorgenommene Änderungen lassen sich danach nicht wiederherstellen.+ Save over the changed file? Die geänderte Datei überschreiben?+ “{name}” changed on disk after it was opened or last saved. Saving now replaces that newer version with this one. „{name}“ wurde auf dem Datenträger geändert, seit es geöffnet oder zuletzt gespeichert wurde. Speichern ersetzt diese neuere Version durch diese hier.+ Save anyway Trotzdem speichernNumber pages Seiten nummerierenStyle StilNone (prefix only) Keiner (nur Präfix)@@ -2274,7 +2277,7 @@ key Space LeertastePrinter paper and scaling may differ. Check driver settings. Druckerpapier und Skalierung können abweichen. Treibereinstellungen prüfen.Drawing scale changes. Use Actual size for full-scale plans. Der Zeichnungsmaßstab ändert sich. Für maßstabsgetreue Pläne Tatsächliche Größe verwenden.Reload documents when their files change on disk Dokumente neu laden, wenn sich ihre Dateien auf dem Datenträger ändern- This file changed on disk. Reload it to see the new version; your unsaved changes will be lost. Diese Datei wurde auf dem Datenträger geändert. Lade sie neu, um die neue Version zu sehen; deine nicht gespeicherten Änderungen gehen dabei verloren.+ This file changed on disk. Reload shows the new version and drops your unsaved changes; Save replaces it with this version. Diese Datei wurde auf dem Datenträger geändert. „Neu laden“ zeigt die neue Version und verwirft Ihre ungespeicherten Änderungen; „Speichern“ ersetzt sie durch diese Version.Reload Neu ladenCouldn't reload {name}: {e} {name} konnte nicht neu geladen werden: {e}Mouse wheel scroll speed Scrollgeschwindigkeit des Mausradsdiff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsvindex b09e860ef..53ab65748 100644--- a/crates/ui-egui/src/i18n/el.tsv+++ b/crates/ui-egui/src/i18n/el.tsv@@ -950,6 +950,9 @@Sort comments by: Ταξινόμηση σχολίων κατά:Create PDF Comment Summary Δημιουργία σύνοψης σχολίων PDFRevert to the previously saved version of “{name}”? Changes since then can't be undone afterwards. Επαναφορά της τελευταίας αποθηκευμένης έκδοσης του «{name}»; Οι μεταγενέστερες αλλαγές δεν θα μπορούν να αναιρεθούν.+ Save over the changed file? Αποθήκευση πάνω στο αλλαγμένο αρχείο;+ “{name}” changed on disk after it was opened or last saved. Saving now replaces that newer version with this one. Το «{name}» άλλαξε στον δίσκο μετά το άνοιγμα ή την τελευταία αποθήκευση. Η αποθήκευση τώρα αντικαθιστά αυτή τη νεότερη έκδοση με αυτήν εδώ.+ Save anyway Αποθήκευση ούτως ή άλλωςNumber pages Αρίθμηση σελίδωνStyle ΣτυλNone (prefix only) Κανένα (μόνο πρόθεμα)@@ -2278,7 +2281,7 @@ comment menu Edit ΕπεξεργασίαPrinter paper and scaling may differ. Check driver settings. Το χαρτί και η κλίμακα του εκτυπωτή μπορεί να διαφέρουν. Ελέγξτε τις ρυθμίσεις του προγράμματος οδήγησης.Drawing scale changes. Use Actual size for full-scale plans. Η κλίμακα του σχεδίου αλλάζει. Για σχέδια σε πλήρη κλίμακα χρησιμοποιήστε το Πραγματικό μέγεθος.Reload documents when their files change on disk Επαναφόρτωση εγγράφων όταν αλλάζουν τα αρχεία τους στον δίσκο- This file changed on disk. Reload it to see the new version; your unsaved changes will be lost. Αυτό το αρχείο άλλαξε στον δίσκο. Επαναφορτώστε το για να δείτε τη νέα έκδοση· οι μη αποθηκευμένες αλλαγές θα χαθούν.+ This file changed on disk. Reload shows the new version and drops your unsaved changes; Save replaces it with this version. Αυτό το αρχείο άλλαξε στον δίσκο. Η επαναφόρτωση δείχνει τη νέα έκδοση και απορρίπτει τις μη αποθηκευμένες αλλαγές σας· η αποθήκευση την αντικαθιστά με αυτή την έκδοση.Reload ΕπαναφόρτωσηCouldn't reload {name}: {e} Δεν ήταν δυνατή η επαναφόρτωση του {name}: {e}Mouse wheel scroll speed Ταχύτητα κύλισης τροχού ποντικιούdiff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsvindex 206ef3195..ad0c9ccd4 100644--- a/crates/ui-egui/src/i18n/es.tsv+++ b/crates/ui-egui/src/i18n/es.tsv@@ -1411,6 +1411,9 @@Sort comments by: Ordenar comentarios por:Create PDF Comment Summary Crear resumen de comentarios en PDFRevert to the previously saved version of “{name}”? Changes since then can't be undone afterwards. ¿Revertir a la última versión guardada de «{name}»? Los cambios hechos desde entonces no se podrán deshacer después.+ Save over the changed file? ¿Guardar sobre el archivo modificado?+ “{name}” changed on disk after it was opened or last saved. Saving now replaces that newer version with this one. «{name}» cambió en el disco después de abrirse o guardarse por última vez. Guardar ahora reemplaza esa versión más reciente por esta.+ Save anyway Guardar de todos modosNumber pages Numerar páginasStyle EstiloNone (prefix only) Ninguno (solo prefijo)@@ -2145,7 +2148,7 @@ action wizard Start IniciarHome / End Inicio / FinH / Space (hold) H / Espacio (mantener)Reload documents when their files change on disk Recargar los documentos cuando sus archivos cambien en el disco- This file changed on disk. Reload it to see the new version; your unsaved changes will be lost. Este archivo ha cambiado en el disco. Recárgalo para ver la nueva versión; se perderán tus cambios sin guardar.+ This file changed on disk. Reload shows the new version and drops your unsaved changes; Save replaces it with this version. Este archivo cambió en el disco. Recargar muestra la versión nueva y descarta los cambios sin guardar; Guardar la reemplaza por esta versión.Reload RecargarCouldn't reload {name}: {e} No se pudo recargar {name}: {e}Created a PDF from {n} files Se creó un PDF a partir de {n} archivosdiff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsvindex 43c0eb803..a4dedcc4a 100644--- a/crates/ui-egui/src/i18n/fr.tsv+++ b/crates/ui-egui/src/i18n/fr.tsv@@ -1396,6 +1396,9 @@Sort comments by: Trier les commentaires par :Create PDF Comment Summary Créer un résumé des commentaires en PDFRevert to the previously saved version of “{name}”? Changes since then can't be undone afterwards. Revenir à la version précédemment enregistrée de «{name}» ? Les modifications faites depuis ne pourront plus être annulées.+ Save over the changed file? Enregistrer par-dessus le fichier modifié ?+ “{name}” changed on disk after it was opened or last saved. Saving now replaces that newer version with this one. « {name} » a été modifié sur le disque après son ouverture ou son dernier enregistrement. Enregistrer maintenant remplace cette version plus récente par celle-ci.+ Save anyway Enregistrer quand mêmeNumber pages Numéroter les pagesStyle StyleNone (prefix only) Aucun (préfixe seulement)@@ -1994,7 +1997,7 @@Used when a PDF doesn't ask for a layout or zoom. Continuous scrolling never snaps between pages. Utilisé lorsqu'un PDF ne demande ni présentation ni zoom. Le défilement continu ne saute jamais d'une page à l'autre.Reopen the files that were open when PdfCraft last closed Rouvrir les fichiers qui étaient ouverts lors de la dernière fermeture de PdfCraftReload documents when their files change on disk Recharger les documents lorsque leurs fichiers sont modifiés sur le disque- This file changed on disk. Reload it to see the new version; your unsaved changes will be lost. Ce fichier a été modifié sur le disque. Rechargez-le pour voir la nouvelle version ; vos modifications non enregistrées seront perdues.+ This file changed on disk. Reload shows the new version and drops your unsaved changes; Save replaces it with this version. Ce fichier a été modifié sur le disque. Recharger affiche la nouvelle version et abandonne vos modifications non enregistrées ; Enregistrer la remplace par cette version.Reload RechargerCouldn't reload {name}: {e} Impossible de recharger {name} : {e}Show Afficherdiff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsvindex 53d8ef1b8..0b4257ecf 100644--- a/crates/ui-egui/src/i18n/hu.tsv+++ b/crates/ui-egui/src/i18n/hu.tsv@@ -1386,6 +1386,9 @@Sort comments by: Megjegyzések rendezése eszerint:Create PDF Comment Summary PDF-megjegyzésösszefoglaló létrehozásaRevert to the previously saved version of “{name}”? Changes since then can't be undone afterwards. Visszatérsz „{name}” előzőleg mentett változatához? Az azóta tett módosítások utána nem vonhatók vissza.+ Save over the changed file? Felülírja a megváltozott fájlt?+ “{name}” changed on disk after it was opened or last saved. Saving now replaces that newer version with this one. A(z) „{name}” megváltozott a lemezen a megnyitás vagy az utolsó mentés óta. A mentés most ezt az újabb változatot cseréli le erre.+ Save anyway Mentés mindenképpNumber pages Oldalak számozásaStyle StílusNone (prefix only) Nincs (csak előtag)@@ -2268,7 +2271,7 @@ key Space SzóközPrinter paper and scaling may differ. Check driver settings. A nyomtató papírja és méretezése eltérhet. Ellenőrizze az illesztőprogram beállításait.Drawing scale changes. Use Actual size for full-scale plans. A rajz méretaránya változik. Méretarányos tervekhez használja a Tényleges méret beállítást.Reload documents when their files change on disk Dokumentumok újratöltése, ha a fájljuk megváltozik a lemezen- This file changed on disk. Reload it to see the new version; your unsaved changes will be lost. Ez a fájl megváltozott a lemezen. Töltsd újra az új változat megtekintéséhez; a nem mentett módosításaid elvesznek.+ This file changed on disk. Reload shows the new version and drops your unsaved changes; Save replaces it with this version. Ez a fájl megváltozott a lemezen. Az Újratöltés az új változatot mutatja, és eldobja a nem mentett módosításokat; a Mentés erre a változatra cseréli le.Reload ÚjratöltésCouldn't reload {name}: {e} {name} újratöltése nem sikerült: {e}Select page {label} {label}. oldal kijelölésediff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsvindex 908a79744..0e00e5e24 100644--- a/crates/ui-egui/src/i18n/it.tsv+++ b/crates/ui-egui/src/i18n/it.tsv@@ -1412,6 +1412,9 @@Sort comments by: Ordina commenti per:Create PDF Comment Summary Crea riepilogo commenti PDFRevert to the previously saved version of “{name}”? Changes since then can't be undone afterwards. Ripristinare la versione salvata in precedenza di “{name}”? Le modifiche successive non potranno essere recuperate.+ Save over the changed file? Salvare sopra il file modificato?+ “{name}” changed on disk after it was opened or last saved. Saving now replaces that newer version with this one. “{name}” è cambiato sul disco dopo l’apertura o l’ultimo salvataggio. Salvando ora, quella versione più recente viene sostituita da questa.+ Save anyway Salva comunqueNumber pages Numera pagineStyle StileNone (prefix only) Nessuno (solo prefisso)@@ -2278,7 +2281,7 @@ key Space SpazioPrinter paper and scaling may differ. Check driver settings. Carta e scala della stampante possono differire. Controlla le impostazioni del driver.Drawing scale changes. Use Actual size for full-scale plans. La scala del disegno cambia. Usa Dimensioni effettive per le planimetrie in scala.Reload documents when their files change on disk Ricarica i documenti quando i loro file cambiano sul disco- This file changed on disk. Reload it to see the new version; your unsaved changes will be lost. Questo file è cambiato sul disco. Ricaricalo per vedere la nuova versione; le modifiche non salvate andranno perse.+ This file changed on disk. Reload shows the new version and drops your unsaved changes; Save replaces it with this version. Questo file è cambiato sul disco. Ricarica mostra la nuova versione e scarta le modifiche non salvate; Salva la sostituisce con questa versione.Reload RicaricaCouldn't reload {name}: {e} Impossibile ricaricare {name}: {e}Select page {label} Seleziona pagina {label}diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsvindex 7733d74ab..96888a6b5 100644--- a/crates/ui-egui/src/i18n/ja.tsv+++ b/crates/ui-egui/src/i18n/ja.tsv@@ -1417,6 +1417,9 @@Sort comments by: 注釈の並べ替え:Create PDF Comment Summary PDF 注釈の一覧を作成Revert to the previously saved version of “{name}”? Changes since then can't be undone afterwards. 「{name}」を保存済みの状態に戻しますか?それ以降の変更は後から取り消せません。+ Save over the changed file? 変更されたファイルに上書きしますか?+ “{name}” changed on disk after it was opened or last saved. Saving now replaces that newer version with this one. 「{name}」は開いた後または最後に保存した後にディスク上で変更されました。今保存すると、その新しい版がこの版で置き換えられます。+ Save anyway それでも保存Number pages ページ番号を設定Style スタイルNone (prefix only) なし(接頭辞のみ)@@ -2269,7 +2272,7 @@ key Space スペースPrinter paper and scaling may differ. Check driver settings. プリンターの用紙や倍率は異なる場合があります。ドライバーの設定を確認してください。Drawing scale changes. Use Actual size for full-scale plans. 図面の縮尺が変わります。原寸で印刷するには「実際のサイズ」を使用してください。Reload documents when their files change on disk ディスク上のファイルが変更されたら文書を再読み込みする- This file changed on disk. Reload it to see the new version; your unsaved changes will be lost. このファイルはディスク上で変更されました。再読み込みすると新しいバージョンが表示されますが、未保存の変更は失われます。+ This file changed on disk. Reload shows the new version and drops your unsaved changes; Save replaces it with this version. このファイルはディスク上で変更されました。「再読み込み」は新しい版を表示して未保存の変更を破棄し、「保存」はこの版で置き換えます。Reload 再読み込みCouldn't reload {name}: {e} {name} を再読み込みできませんでした: {e}Select page {label} ページ {label} を選択diff --git a/crates/ui-egui/src/i18n/kk.tsv b/crates/ui-egui/src/i18n/kk.tsvindex 72cdfd395..4a8de1e93 100644--- a/crates/ui-egui/src/i18n/kk.tsv+++ b/crates/ui-egui/src/i18n/kk.tsv@@ -1357,6 +1357,9 @@Sort comments by: Түсініктемелерді сұрыптау:Create PDF Comment Summary Түсініктемелердің PDF қорытындысын жасауRevert to the previously saved version of “{name}”? Changes since then can't be undone afterwards. «{name}» бұрын сақталған нұсқасына оралу керек пе? Осы уақыттан кейінгі өзгерістерді кейін болдырмауға болмайды.+ Save over the changed file? Өзгертілген файлдың үстіне сақтау керек пе?+ “{name}” changed on disk after it was opened or last saved. Saving now replaces that newer version with this one. «{name}» ашылғаннан немесе соңғы сақталғаннан кейін дискіде өзгертілді. Қазір сақтау сол жаңарақ нұсқаны осымен алмастырады.+ Save anyway Бәрібір сақтауNumber pages Беттерді нөмірлеуStyle СтильNone (prefix only) Жоқ (тек префикс)@@ -2268,7 +2271,7 @@ key Space Бос орынPrinter paper and scaling may differ. Check driver settings. Принтер қағазы мен масштабы өзгеше болуы мүмкін. Драйвер параметрлерін тексеріңіз.Drawing scale changes. Use Actual size for full-scale plans. Сызба масштабы өзгереді. Толық масштабты жоспарлар үшін Нақты өлшемді пайдаланыңыз.Reload documents when their files change on disk Дискідегі файлдары өзгергенде құжаттарды қайта жүктеу- This file changed on disk. Reload it to see the new version; your unsaved changes will be lost. Бұл файл дискіде өзгерді. Жаңа нұсқасын көру үшін оны қайта жүктеңіз; сақталмаған өзгерістер жоғалады.+ This file changed on disk. Reload shows the new version and drops your unsaved changes; Save replaces it with this version. Бұл файл дискіде өзгертілді. «Қайта жүктеу» жаңа нұсқаны көрсетіп, сақталмаған өзгерістеріңізді тастайды; «Сақтау» оны осы нұсқамен алмастырады.Reload Қайта жүктеуCouldn't reload {name}: {e} {name} қайта жүктеу мүмкін болмады: {e}Mouse wheel scroll speed Тінтуір дөңгелегімен айналдыру жылдамдығыdiff --git a/crates/ui-egui/src/i18n/lt.tsv b/crates/ui-egui/src/i18n/lt.tsvindex dd8150414..9bbf48cf5 100644--- a/crates/ui-egui/src/i18n/lt.tsv+++ b/crates/ui-egui/src/i18n/lt.tsv@@ -969,6 +969,9 @@Reverse pages Apversti puslapiusRevert changes Atšaukti pakeitimusRevert to the previously saved version of “{name}”? Changes since then can't be undone afterwards. Grąžinti anksčiau įrašytą „{name}“ versiją? Po to atliktų pakeitimų nebegalėsite atkurti.+ Save over the changed file? Įrašyti ant pakeisto failo?+ “{name}” changed on disk after it was opened or last saved. Saving now replaces that newer version with this one. „{name}“ diske pasikeitė po atidarymo arba paskutinio įrašymo. Įrašius dabar ta naujesnė versija bus pakeista šia.+ Save anyway Vis tiek įrašytiReview History Pakeitimų retrospektyvaRevisions VersijosRight Dešinė@@ -1176,7 +1179,7 @@This document isn't password-protected Šis dokumentas neapsaugotas slaptažodžiuThis drawing exceeds the snapping limit; only the first paths are used. Brėžinys viršija pritraukimo ribą; naudojami tik pirmieji keliai.This field is locked. Unlock it to change its properties. Šis laukas užrakintas. Atrakinkite jį, kad galėtumėte keisti savybes.- This file changed on disk. Reload it to see the new version; your unsaved changes will be lost. Failas diske pasikeitė. Įkelkite jį iš naujo, kad matytumėte naują versiją; neįrašyti pakeitimai bus prarasti.+ This file changed on disk. Reload shows the new version and drops your unsaved changes; Save replaces it with this version. Šis failas diske pasikeitė. „Įkelti iš naujo“ parodo naują versiją ir atmeta neįrašytus pakeitimus; „Įrašyti“ pakeičia ją šia versija.This file was damaged and has been repaired. Saving keeps the repaired version. Failas buvo pažeistas ir pataisytas. Įrašius bus išsaugota pataisyta versija.This folder isn't available right now. It may have moved, or its drive or cloud sync is offline. Aplankas šiuo metu nepasiekiamas. Jis galėjo būti perkeltas arba diskas ar sinchronizavimas su debesija neveikia.This form's scripts are turned off because one ran too long. Reopen the document to run them again. Šios formos scenarijai išjungti, nes vienas jų veikė per ilgai. Atverkite dokumentą iš naujo, kad scenarijai būtų vykdomi vėl.diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsvindex 2a2dedede..5214913f4 100644--- a/crates/ui-egui/src/i18n/pl.tsv+++ b/crates/ui-egui/src/i18n/pl.tsv@@ -1400,6 +1400,9 @@Sort comments by: Sortuj komentarze według:Create PDF Comment Summary Utwórz podsumowanie komentarzy w PDFRevert to the previously saved version of “{name}”? Changes since then can't be undone afterwards. Przywrócić ostatnio zapisaną wersję „{name}”? Późniejszych zmian nie będzie można odzyskać.+ Save over the changed file? Zapisać na zmienionym pliku?+ “{name}” changed on disk after it was opened or last saved. Saving now replaces that newer version with this one. Plik „{name}” zmienił się na dysku po otwarciu lub ostatnim zapisie. Zapisanie teraz zastąpi tę nowszą wersję bieżącą.+ Save anyway Zapisz mimo toNumber pages Ponumeruj stronyStyle StylNone (prefix only) Brak (tylko prefiks)@@ -2249,7 +2252,7 @@ key Space SpacjaThese objects could not be moved. Select them again and try a smaller move. Nie udało się przenieść tych obiektów. Zaznacz je ponownie i spróbuj mniejszego przesunięcia.This page contains objects that cannot be selected together. Ta strona zawiera obiekty, których nie można zaznaczyć razem.Reload documents when their files change on disk Wczytuj ponownie dokumenty, gdy ich pliki zmienią się na dysku- This file changed on disk. Reload it to see the new version; your unsaved changes will be lost. Ten plik zmienił się na dysku. Wczytaj go ponownie, aby zobaczyć nową wersję; niezapisane zmiany zostaną utracone.+ This file changed on disk. Reload shows the new version and drops your unsaved changes; Save replaces it with this version. Ten plik zmienił się na dysku. Wczytaj ponownie pokazuje nową wersję i odrzuca niezapisane zmiany; Zapisz zastępuje ją tą wersją.Reload Wczytaj ponownieCouldn't reload {name}: {e} Nie można ponownie wczytać {name}: {e}Select page {label} Wybierz stronę {label}diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsvindex 5515f00bf..be83ec262 100644--- a/crates/ui-egui/src/i18n/pt-br.tsv+++ b/crates/ui-egui/src/i18n/pt-br.tsv@@ -1311,6 +1311,9 @@Sort comments by: Classificar comentários por:Create PDF Comment Summary Criar resumo de comentários do PDFRevert to the previously saved version of “{name}”? Changes since then can't be undone afterwards. Reverter para a versão salva anteriormente de “{name}”? As alterações feitas desde então não poderão ser desfeitas depois.+ Save over the changed file? Salvar sobre o arquivo alterado?+ “{name}” changed on disk after it was opened or last saved. Saving now replaces that newer version with this one. “{name}” foi alterado no disco depois de ser aberto ou salvo pela última vez. Salvar agora substitui essa versão mais recente por esta.+ Save anyway Salvar mesmo assimNumber pages Numerar páginasStyle EstiloNone (prefix only) Nenhum (apenas prefixo)@@ -2271,7 +2274,7 @@ key Space EspaçoPrinter paper and scaling may differ. Check driver settings. O papel e a escala da impressora podem variar. Confira as configurações do driver.Drawing scale changes. Use Actual size for full-scale plans. A escala do desenho muda. Use Tamanho real para plantas em escala.Reload documents when their files change on disk Recarregar documentos quando os arquivos mudarem no disco- This file changed on disk. Reload it to see the new version; your unsaved changes will be lost. Este arquivo foi alterado no disco. Recarregue-o para ver a nova versão; suas alterações não salvas serão perdidas.+ This file changed on disk. Reload shows the new version and drops your unsaved changes; Save replaces it with this version. Este arquivo foi alterado no disco. Recarregar mostra a nova versão e descarta suas alterações não salvas; Salvar a substitui por esta versão.Reload RecarregarCouldn't reload {name}: {e} Não foi possível recarregar {name}: {e}Select page {label} Selecionar página {label}diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsvindex 09f0ead59..56cc36121 100644--- a/crates/ui-egui/src/i18n/ru.tsv+++ b/crates/ui-egui/src/i18n/ru.tsv@@ -1417,6 +1417,9 @@Sort comments by: Сортировать комментарии по:Create PDF Comment Summary Создать сводку комментариев в PDFRevert to the previously saved version of “{name}”? Changes since then can't be undone afterwards. Вернуть к ранее сохранённой версии «{name}»? Изменения с тех пор нельзя будет отменить.+ Save over the changed file? Сохранить поверх изменённого файла?+ “{name}” changed on disk after it was opened or last saved. Saving now replaces that newer version with this one. «{name}» был изменён на диске после открытия или последнего сохранения. Сохранение сейчас заменит ту более новую версию этой.+ Save anyway Всё равно сохранитьNumber pages Пронумеровать страницыStyle СтильNone (prefix only) Нет (только префикс)@@ -2061,7 +2064,7 @@Used when a PDF doesn't ask for a layout or zoom. Continuous scrolling never snaps between pages. Используется, когда PDF не запрашивает макет или масштаб. Непрерывная прокрутка никогда не привязывается между страницами.Reopen the files that were open when PdfCraft last closed Повторно открывать файлы, которые были открыты при последнем закрытии PdfCraftReload documents when their files change on disk Перезагружать документы при изменении их файлов на диске- This file changed on disk. Reload it to see the new version; your unsaved changes will be lost. Этот файл был изменён на диске. Перезагрузите его, чтобы увидеть новую версию; несохранённые изменения будут потеряны.+ This file changed on disk. Reload shows the new version and drops your unsaved changes; Save replaces it with this version. Этот файл был изменён на диске. «Перезагрузить» покажет новую версию и отбросит несохранённые изменения; «Сохранить» заменит её этой версией.Reload ПерезагрузитьCouldn't reload {name}: {e} Не удалось перезагрузить {name}: {e}Choose a PNG or JPEG image (up to 4 MiB). Transparency is preserved. Выберите изображение PNG или JPEG (до 4 МиБ). Прозрачность сохраняется.diff --git a/crates/ui-egui/src/i18n/sl.tsv b/crates/ui-egui/src/i18n/sl.tsvindex 80d2668c0..dc500c1dc 100644--- a/crates/ui-egui/src/i18n/sl.tsv+++ b/crates/ui-egui/src/i18n/sl.tsv@@ -1502,6 +1502,9 @@Reverse the order Obrni vrstni redRevert PovrniRevert to the previously saved version of “{name}”? Changes since then can't be undone afterwards. Povrniti na prej shranjeno različico dokumenta „{name}“? Sprememb od takrat pozneje ni mogoče razveljaviti.+ Save over the changed file? Shranim čez spremenjeno datoteko?+ “{name}” changed on disk after it was opened or last saved. Saving now replaces that newer version with this one. »{name}« se je na disku spremenila po odprtju ali zadnjem shranjevanju. Shranjevanje zdaj zamenja to novejšo različico s to.+ Save anyway Vseeno shraniReverted to the last saved version Povrnjeno na zadnjo shranjeno različicoReview PregledReview History Zgodovina pregledov@@ -2275,7 +2278,7 @@ key Space PreslednicaPrinter paper and scaling may differ. Check driver settings. Papir in merilo tiskalnika se lahko razlikujeta. Preverite nastavitve gonilnika.Drawing scale changes. Use Actual size for full-scale plans. Merilo risbe se spremeni. Za načrte v polnem merilu uporabite Dejansko velikost.Reload documents when their files change on disk Znova naloži dokumente, ko se njihove datoteke na disku spremenijo- This file changed on disk. Reload it to see the new version; your unsaved changes will be lost. Ta datoteka se je na disku spremenila. Znova jo naložite, da vidite novo različico; neshranjene spremembe bodo izgubljene.+ This file changed on disk. Reload shows the new version and drops your unsaved changes; Save replaces it with this version. Ta datoteka se je na disku spremenila. Ponovno naloži pokaže novo različico in zavrže neshranjene spremembe; Shrani jo zamenja s to različico.Reload Znova naložiCouldn't reload {name}: {e} Datoteke {name} ni bilo mogoče znova naložiti: {e}Mouse wheel scroll speed Hitrost drsenja s kolescem miškediff --git a/crates/ui-egui/src/i18n/te.tsv b/crates/ui-egui/src/i18n/te.tsvindex 963695145..0067c1f9f 100644--- a/crates/ui-egui/src/i18n/te.tsv+++ b/crates/ui-egui/src/i18n/te.tsv@@ -1386,6 +1386,9 @@ signature pad Type టైప్ చేయిSort comments by: వ్యాఖ్యలను క్రమపరిచే విధానం:Create PDF Comment Summary PDF వ్యాఖ్యల సారాంశాన్ని సృష్టించుRevert to the previously saved version of “{name}”? Changes since then can't be undone afterwards. “{name}”ను గతంలో సేవ్ చేసిన వెర్షన్కు తిరిగి మార్చాలా? అప్పటి నుండి చేసిన మార్పులు పోతాయి, వాటిని తర్వాత తిరిగి పొందలేరు.+ Save over the changed file? మార్చబడిన ఫైల్పై సేవ్ చేయాలా?+ “{name}” changed on disk after it was opened or last saved. Saving now replaces that newer version with this one. “{name}” తెరిచిన తర్వాత లేదా చివరిసారి సేవ్ చేసిన తర్వాత డిస్క్లో మారింది. ఇప్పుడు సేవ్ చేస్తే ఆ కొత్త వెర్షన్ స్థానంలో ఇది వస్తుంది.+ Save anyway ఏమైనా సేవ్ చేయిNumber pages పేజీలకు సంఖ్యలు వేయిStyle శైలిNone (prefix only) ఏదీ లేదు (ప్రిఫిక్స్ మాత్రమే)@@ -1980,7 +1983,7 @@ action wizard Start ప్రారంభించుUsed when a PDF doesn't ask for a layout or zoom. Continuous scrolling never snaps between pages. PDF ఏ లేఅవుట్ను గానీ జూమ్ను గానీ కోరనప్పుడు ఉపయోగించబడుతుంది. నిరంతర స్క్రోలింగ్ పేజీల మధ్య ఎప్పుడూ స్నాప్ అవ్వదు.Reopen the files that were open when PdfCraft last closed PdfCraftను చివరిసారి మూసివేసినప్పుడు తెరిచి ఉన్న ఫైల్లను మళ్లీ తెరువుReload documents when their files change on disk డిస్క్లో వాటి ఫైల్లు మారినప్పుడు పత్రాలను మళ్లీ లోడ్ చేయి- This file changed on disk. Reload it to see the new version; your unsaved changes will be lost. ఈ ఫైల్ డిస్క్లో మారింది. కొత్త వెర్షన్ను చూడటానికి దాన్ని మళ్లీ లోడ్ చేయండి; సేవ్ చేయని మీ మార్పులు పోతాయి.+ This file changed on disk. Reload shows the new version and drops your unsaved changes; Save replaces it with this version. ఈ ఫైల్ డిస్క్లో మారింది. రీలోడ్ కొత్త వెర్షన్ను చూపించి సేవ్ చేయని మార్పులను వదిలేస్తుంది; సేవ్ దాని స్థానంలో ఈ వెర్షన్ను ఉంచుతుంది.Reload మళ్లీ లోడ్ చేయిCouldn't reload {name}: {e} {name}ను మళ్లీ లోడ్ చేయడం సాధ్యం కాలేదు: {e}About పరిచయంdiff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsvindex d8d248b73..46e8e497b 100644--- a/crates/ui-egui/src/i18n/tr.tsv+++ b/crates/ui-egui/src/i18n/tr.tsv@@ -1373,6 +1373,9 @@Sort comments by: Yorumları şuna göre sırala:Create PDF Comment Summary PDF Yorum Özeti OluşturRevert to the previously saved version of “{name}”? Changes since then can't be undone afterwards. “{name}” belgesinin daha önce kaydedilmiş sürümüne geri dönülsün mü? O andan sonraki değişiklikler geri alınamaz.+ Save over the changed file? Değiştirilen dosyanın üzerine kaydedilsin mi?+ “{name}” changed on disk after it was opened or last saved. Saving now replaces that newer version with this one. “{name}” açıldıktan veya son kaydedildikten sonra diskte değişti. Şimdi kaydetmek o daha yeni sürümü bununla değiştirir.+ Save anyway Yine de kaydetNumber pages Sayfaları numaralandırStyle StilNone (prefix only) Yok (yalnızca önek)@@ -2266,7 +2269,7 @@ key Space BoşlukPrinter paper and scaling may differ. Check driver settings. Yazıcı kâğıdı ve ölçekleme farklı olabilir. Sürücü ayarlarını kontrol edin.Drawing scale changes. Use Actual size for full-scale plans. Çizim ölçeği değişir. Tam ölçekli planlar için Gerçek boyutu kullanın.Reload documents when their files change on disk Diskteki dosyaları değiştiğinde belgeleri yeniden yükle- This file changed on disk. Reload it to see the new version; your unsaved changes will be lost. Bu dosya diskte değişti. Yeni sürümü görmek için yeniden yükleyin; kaydedilmemiş değişiklikleriniz kaybolacak.+ This file changed on disk. Reload shows the new version and drops your unsaved changes; Save replaces it with this version. Bu dosya diskte değişti. Yeniden yükle yeni sürümü gösterir ve kaydedilmemiş değişikliklerinizi atar; Kaydet onu bu sürümle değiştirir.Reload Yeniden yükleCouldn't reload {name}: {e} {name} yeniden yüklenemedi: {e}Mouse wheel scroll speed Fare tekerleği kaydırma hızıdiff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsvindex fb9f16284..ae40a648d 100644--- a/crates/ui-egui/src/i18n/uk.tsv+++ b/crates/ui-egui/src/i18n/uk.tsv@@ -1414,6 +1414,9 @@Sort comments by: Сортувати коментарі за:Create PDF Comment Summary Створити PDF зі зведенням коментарівRevert to the previously saved version of “{name}”? Changes since then can't be undone afterwards. Повернутися до попередньої збереженої версії «{name}»? Після цього зміни, внесені відтоді, неможливо буде повернути.+ Save over the changed file? Зберегти поверх зміненого файлу?+ “{name}” changed on disk after it was opened or last saved. Saving now replaces that newer version with this one. «{name}» змінено на диску після відкриття або останнього збереження. Збереження зараз замінить ту новішу версію цією.+ Save anyway Усе одно зберегтиNumber pages Пронумерувати сторінкиStyle СтильNone (prefix only) Немає (лише префікс)@@ -2291,7 +2294,7 @@ key Space ПробілPrinter paper and scaling may differ. Check driver settings. Папір і масштаб принтера можуть відрізнятися. Перевірте налаштування драйвера.Drawing scale changes. Use Actual size for full-scale plans. Масштаб креслення змінюється. Для друку в початковому масштабі виберіть Фактичний розмір.Reload documents when their files change on disk Перезавантажувати документи, коли їхні файли змінюються на диску- This file changed on disk. Reload it to see the new version; your unsaved changes will be lost. Цей файл змінено на диску. Перезавантажте його, щоб побачити нову версію; незбережені зміни буде втрачено.+ This file changed on disk. Reload shows the new version and drops your unsaved changes; Save replaces it with this version. Цей файл змінено на диску. «Перезавантажити» покаже нову версію й відкине незбережені зміни; «Зберегти» замінить її цією версією.Reload ПерезавантажитиCouldn't reload {name}: {e} Не вдалося перезавантажити {name}: {e}Select page {label} Вибрати сторінку {label}diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsvindex 580f8b95f..8b89fb92b 100644--- a/crates/ui-egui/src/i18n/zh-hans.tsv+++ b/crates/ui-egui/src/i18n/zh-hans.tsv@@ -1375,6 +1375,9 @@Sort comments by: 注释排序依据:Create PDF Comment Summary 创建 PDF 注释摘要Revert to the previously saved version of “{name}”? Changes since then can't be undone afterwards. 还原到“{name}”的上次保存版本?此后的更改将无法撤销。+ Save over the changed file? 覆盖已更改的文件?+ “{name}” changed on disk after it was opened or last saved. Saving now replaces that newer version with this one. “{name}”在打开或上次保存后已在磁盘上更改。现在保存会用此版本替换那个较新的版本。+ Save anyway 仍然保存Number pages 页面编号Style 样式None (prefix only) 无(仅前缀)@@ -2095,7 +2098,7 @@Used when a PDF doesn't ask for a layout or zoom. Continuous scrolling never snaps between pages. PDF 未指定布局或缩放时使用。连续滚动时页面不会逐页吸附。Reopen the files that were open when PdfCraft last closed 重新打开上次关闭 PdfCraft 时打开的文件Reload documents when their files change on disk 文件在磁盘上更改时重新加载对应的文档- This file changed on disk. Reload it to see the new version; your unsaved changes will be lost. 此文件已在磁盘上更改。请重新加载以查看新版本;未保存的更改将会丢失。+ This file changed on disk. Reload shows the new version and drops your unsaved changes; Save replaces it with this version. 此文件已在磁盘上更改。“重新加载”显示新版本并放弃未保存的更改;“保存”则用此版本替换它。Reload 重新加载Couldn't reload {name}: {e} 无法重新加载{name}:{e}Write this email? 是否撰写此邮件?diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsvindex d3bc3ed2e..7d65dbdb8 100644--- a/crates/ui-egui/src/i18n/zh-hant.tsv+++ b/crates/ui-egui/src/i18n/zh-hant.tsv@@ -1320,6 +1320,10 @@Sort comments by: 註解排序依據:Create PDF Comment Summary 建立 PDF 註解摘要Revert to the previously saved version of “{name}”? Changes since then can't be undone afterwards. 還原到「{name}」的上次儲存版本?此後的更改將無法復原。+ Revert to the previously saved version of “{name}”? Changes since then can't be undone afterwards. 還原到“{name}”的上次儲存版本?此後的更改將無法復原。+ Save over the changed file? 覆寫已變更的檔案?+ “{name}” changed on disk after it was opened or last saved. Saving now replaces that newer version with this one. 「{name}」在開啟或上次儲存後已在磁碟上變更。現在儲存會以此版本取代那個較新的版本。+ Save anyway 仍要儲存Number pages 頁面編號Style 樣式None (prefix only) 無(僅字首)@@ -2144,7 +2148,7 @@ key Space 空格Tools 工具Inspector 檢查器Reload documents when their files change on disk 檔案在磁碟上變更時重新載入對應的文件- This file changed on disk. Reload it to see the new version; your unsaved changes will be lost. 此檔案已在磁碟上變更。請重新載入以查看新版本;未儲存的變更將會遺失。+ This file changed on disk. Reload shows the new version and drops your unsaved changes; Save replaces it with this version. 此檔案已在磁碟上變更。「重新載入」會顯示新版本並捨棄未儲存的變更;「儲存」則會以此版本取代它。Reload 重新載入Couldn't reload {name}: {e} 無法重新載入{name}:{e}Select page {label} 選取頁面 {label}diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rsindex 90dc2b481..6a1ddd4f7 100644--- a/crates/ui-egui/src/lib.rs+++ b/crates/ui-egui/src/lib.rs@@ -7,6 +7,12 @@#![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable)]+/// Whether `a` and `b` name the same file: equal, or equal once made absolute against the+/// current directory (links are not resolved, as in `last_session`).+pub(crate) fn same_file(a: &str, b: &str) -> bool {+ a == b || matches!((std::path::absolute(a), std::path::absolute(b)), (Ok(x), Ok(y)) if x == y)+}+/// Translate an English UI string into the current language (see [`i18n`]).macro_rules! tl {($s:expr) => {@@ -300,6 +306,8 @@ pub enum Dialog {Print,/// File ▸ Revert confirmation.Revert,+ /// Save over a file that changed on disk since the document came from it (#2166).+ OverwriteChanged,/// Link Properties.LinkProps,/// Organize ▸ Extract (options), Rotate Pages.@@ -610,6 +618,9 @@ pub struct PdfCraftApp {pub host_dirty: Option<HostDirtyFn>,/// A pending "save changes?" question (closing a dirty tab or quitting).pub close_request: Option<CloseRequest>,+ /// A save waiting behind [`Dialog::OverwriteChanged`] (the web build has no files to check).+ #[cfg(not(target_arch = "wasm32"))]+ pub pending_overwrite: Option<editing::PendingOverwrite>,/// Save to this path instead of asking (tests and automation).pub save_override: Option<String>,/// Document Properties ▸ Description fields being edited: (document, Title/Author/Subject/Keywords).@@ -950,6 +961,8 @@ impl PdfCraftApp {host_save: None,host_dirty: None,close_request: None,+ #[cfg(not(target_arch = "wasm32"))]+ pending_overwrite: None,save_override: None,props_draft: None,view_draft: None,@@ -1660,10 +1673,16 @@ impl PdfCraftApp {}}+ /// The tab already showing the file at `path` (the same path, or one that names the same+ /// file once made absolute).+ pub(crate) fn tab_showing(&self, path: &str) -> Option<usize> {+ self.views.iter().position(|v| self.session.get(v.id).and_then(|d| d.path.as_deref()).is_some_and(|p| same_file(p, path)))+ }+/// Open a file from a recent list: focus the tab already showing it, else open it (File ▸/// Open Recent and the Home view's list share this).pub fn open_recent(&mut self, path: &str) {- if let Some(i) = self.views.iter().position(|v| self.session.get(v.id).and_then(|d| d.path.as_deref()) == Some(path)) {+ if let Some(i) = self.tab_showing(path) {self.active = Some(i);} else {#[cfg(not(target_arch = "wasm32"))]@@ -1760,6 +1779,18 @@ impl PdfCraftApp {/// Keep a chosen tool with its file until preparation and any password entry finish.#[cfg(not(target_arch = "wasm32"))]fn open_path_then(&mut self, path: &str, then: Option<&'static str>) {+ // One file, one tab (#2166): a file that is open already comes to the front instead,+ // and the tool it was opened for runs on it. One still being opened is left to that.+ if let Some(i) = self.tab_showing(path) {+ self.active = Some(i);+ if let Some(command) = then {+ self.execute(command);+ }+ return;+ }+ if self.pending_opens.iter().any(|p| p.path.as_deref().is_some_and(|p| same_file(p, path))) {+ return;+ }let name = std::path::Path::new(path).file_name().map(|n| n.to_string_lossy().into_owned()).unwrap_or_else(|| path.to_string());// Taken before reading: a build that rewrites the file meanwhile still counts as a change.let stamp = file_watch::Stamp::at(path);diff --git a/crates/ui-egui/src/recovery.rs b/crates/ui-egui/src/recovery.rsindex 134f54ecd..4f1f1d8e8 100644--- a/crates/ui-egui/src/recovery.rs+++ b/crates/ui-egui/src/recovery.rs@@ -8,8 +8,16 @@//!//! Encrypted documents are stored encrypted (the working file is), so recovery never writes//! plaintext of a protected document to disk. The web build has no recovery store yet.+//!+//! A running instance holds an exclusively locked `instance-<pid>-<n>.lock` in the folder and+//! names it in the snapshots it writes, so a second instance can tell live autosaves from a+//! crash's leftovers and neither offers nor discards them (#2166). The OS releases the lock+//! when the process dies.+use std::fs::{File, TryLockError};use std::path::{Path, PathBuf};+use std::sync::atomic::{AtomicU64, Ordering};+use std::sync::{Arc, OnceLock};use crate::PdfCraftApp;@@ -27,17 +35,110 @@ pub struct RecoveryMeta {pub saved_at: u64,/// The bytes are encrypted; recovering asks for the password.pub encrypted: bool,+ /// The lock file of the instance that wrote the snapshot (see the module doc); missing in+ /// snapshots from before it.+ #[serde(default)]+ pub instance: Option<String>,}/// The recovery folder.#[derive(Clone, Debug)]pub struct RecoveryStore {dir: PathBuf,+ /// This instance's lock, held while it runs and shared by the store's clones (one store,+ /// one instance). Unset until [`claim`](Self::claim); `Some(None)` when claiming failed+ /// (the folder can't be written, or the platform has no file locks).+ lock: Arc<OnceLock<Option<InstanceLock>>>,+}++/// An open, exclusively locked `instance-<pid>-<n>.lock` in the folder, released and removed+/// with the last clone of its store.+#[derive(Debug)]+struct InstanceLock {+ name: String,+ path: PathBuf,+ file: File,+}++impl Drop for InstanceLock {+ fn drop(&mut self) {+ let _ = self.file.unlock();+ let _ = std::fs::remove_file(&self.path);+ }}+/// Tells this process's stores apart: tests make several, and a dropped one's lock is free.+static CLAIMS: AtomicU64 = AtomicU64::new(0);+impl RecoveryStore {pub fn new(dir: impl Into<PathBuf>) -> Self {- Self { dir: dir.into() }+ Self { dir: dir.into(), lock: Arc::default() }+ }++ /// Mark the folder as in use by a running instance (see the module doc). Without a lock+ /// (the folder can't be written, or the platform has no file locks) snapshots are written+ /// and offered as before.+ pub fn claim(&self) {+ self.lock.get_or_init(|| {+ if let Err(e) = std::fs::create_dir_all(&self.dir) {+ log::warn!("recovery folder {} can't be made: {e}", self.dir.display());+ return None;+ }+ let name = format!("instance-{}-{}.lock", std::process::id(), CLAIMS.fetch_add(1, Ordering::Relaxed));+ let path = self.dir.join(&name);+ let locked = File::options().read(true).write(true).create(true).truncate(false).open(&path).and_then(|file| match file.try_lock() {+ Ok(()) => Ok(file),+ Err(TryLockError::WouldBlock) => Err(std::io::Error::new(std::io::ErrorKind::WouldBlock, "held by another instance")),+ Err(TryLockError::Error(e)) => Err(e),+ });+ match locked {+ Ok(file) => Some(InstanceLock { name, path, file }),+ Err(e) => {+ let _ = std::fs::remove_file(&path);+ log::warn!("recovery folder {} can't be claimed: {e}", self.dir.display());+ None+ }+ }+ });+ }++ fn own_lock(&self) -> Option<&InstanceLock> {+ self.lock.get().and_then(Option::as_ref)+ }++ /// The name of this instance's lock file, for the snapshots it writes.+ pub fn instance(&self) -> Option<String> {+ self.own_lock().map(|l| l.name.clone())+ }++ /// Whether `meta` was written by another instance that is still running. A lock file that+ /// is no longer held is a crash's leftover and is removed. The name comes from the sidecar,+ /// which is untrusted, so only a plain `instance-….lock` name in the folder is looked at.+ fn written_by_a_live_instance(&self, meta: &RecoveryMeta) -> bool {+ let Some(name) = meta.instance.as_deref() else { return false };+ if self.own_lock().is_some_and(|l| l.name == name) {+ return false;+ }+ let plain = name.starts_with("instance-")+ && name.ends_with(".lock")+ && !name.contains("..")+ && name.chars().all(|c| c.is_ascii_alphanumeric() || c == '-' || c == '.');+ if !plain {+ return false;+ }+ let path = self.dir.join(name);+ let Ok(file) = File::options().read(true).write(true).open(&path) else { return false };+ match file.try_lock() {+ Err(TryLockError::WouldBlock) => true,+ Ok(()) => {+ let _ = file.unlock();+ drop(file);+ let _ = std::fs::remove_file(&path);+ false+ }+ // Can't tell (no file locks here): offered, as before.+ Err(TryLockError::Error(_)) => false,+ }}/// `Recovery` in the portable data folder in portable mode ([`crate::portable`]), otherwise@@ -76,7 +177,8 @@ impl RecoveryStore {let _ = std::fs::remove_file(self.dir.join(format!("{key}.pdf")));}- /// Snapshots, newest first. Listing never removes files; missing metadata uses the file name.+ /// Snapshots, newest first, leaving out what another running instance is autosaving.+ /// Listing never removes a snapshot; missing metadata uses the file name.pub fn list(&self) -> Vec<RecoveryMeta> {let Ok(dir) = std::fs::read_dir(&self.dir) else { return Vec::new() };let mut out = Vec::new();@@ -104,9 +206,11 @@ impl RecoveryStore {saved_at,// This is only a display hint; opening the PDF still detects encryption.encrypted: false,+ instance: None,}}));}+ out.retain(|m| !self.written_by_a_live_instance(m));out.sort_by_key(|m| std::cmp::Reverse(m.saved_at));out}@@ -157,6 +261,7 @@ fn now_secs() -> u64 {impl PdfCraftApp {/// Turn on autosave into `store`, and look for documents a previous session left behind.pub fn enable_recovery(&mut self, store: RecoveryStore) {+ store.claim();self.recoverable = store.list();if !self.recoverable.is_empty() {self.dialog = Some(crate::Dialog::Recovery);@@ -169,7 +274,8 @@ impl PdfCraftApp {let Some(store) = self.recovery.clone() else { return };for snap in self.session.autosave_snapshots() {let key = self.recovery_keys.entry(snap.doc).or_insert_with(|| format!("{}-{}-{}", now_secs(), std::process::id(), snap.doc.0)).clone();- let meta = RecoveryMeta { key, name: snap.name, path: snap.path, saved_at: now_secs(), encrypted: snap.encrypted };+ let meta =+ RecoveryMeta { key, name: snap.name, path: snap.path, saved_at: now_secs(), encrypted: snap.encrypted, instance: store.instance() };if let Err(e) = store.write(&meta, &snap.bytes) {log::warn!("autosave failed: {e}");}diff --git a/crates/ui-egui/tests/recovery.rs b/crates/ui-egui/tests/recovery.rsindex 7d356744a..807261c8c 100644--- a/crates/ui-egui/tests/recovery.rs+++ b/crates/ui-egui/tests/recovery.rs@@ -41,8 +41,9 @@ fn store(tag: &str) -> RecoveryStore {RecoveryStore::new(dir)}+/// Snapshot files (the PDF and its sidecar), not the running instances' lock files.fn files_in(s: &RecoveryStore) -> usize {- std::fs::read_dir(s.dir()).map(|d| d.count()).unwrap_or(0)+ std::fs::read_dir(s.dir()).map(|d| d.flatten().filter(|e| e.path().extension().and_then(|x| x.to_str()) != Some("lock")).count()).unwrap_or(0)}/// A session that edits a document, autosaves, and then "crashes" (is dropped).@@ -269,6 +270,7 @@ fn a_failed_metadata_write_keeps_the_completed_snapshot_recoverable() {path: Some("original.pdf".into()),saved_at: 1,encrypted: false,+ instance: None,};// A directory at the sidecar path makes its atomic rename fail after the PDF was written.std::fs::create_dir_all(s.dir().join("snapshot.json")).unwrap();@@ -377,3 +379,35 @@ fn control_click_effects_are_visible_when_the_reply_arrives() {assert_eq!(files_in(&s), 0, "discarded by the time the click is answered");assert_eq!(call(&mut h, "ui.state", serde_json::json!({}))["dialog"], serde_json::Value::Null);}++/// A running instance's autosaves are its own (#2166): a second instance started meanwhile+/// does not offer them, so it cannot discard them either; once the first is gone, they are+/// offered. A sidecar naming a lock file outside the folder is a plain leftover. Each instance+/// is a store of its own here: a clone shares its instance.+#[test]+fn a_running_instances_autosaves_are_not_offered_to_a_second_instance() {+ let s = store("live");+ let instance = || RecoveryStore::new(s.dir());+ let mut first = PdfCraftApp::new();+ first.set_option("language", "en").unwrap();+ first.enable_recovery(instance());+ first.open_bytes("work.pdf", None, fixture(2)).unwrap();+ assert!(first.apply_edit(Edit::DeletePages { pages: vec![0] }));+ first.autosave_now();+ assert_eq!(files_in(&s), 2);+ let second = harness(instance());+ assert!(second.state().recoverable.is_empty() && second.state().dialog.is_none(), "the first instance is still running");+ drop(second);+ drop(first);+ let third = harness(instance());+ assert_eq!(third.state().recoverable.len(), 1, "offered once the first instance is gone");+ assert_eq!(files_in(&s), 2, "listing removes no snapshot");+ drop(third);+ let meta =+ std::fs::read_dir(s.dir()).unwrap().flatten().map(|e| e.path()).find(|p| p.extension().and_then(|x| x.to_str()) == Some("json")).unwrap();+ let mut json: serde_json::Value = serde_json::from_slice(&std::fs::read(&meta).unwrap()).unwrap();+ json["instance"] = "../../outside.lock".into();+ std::fs::write(&meta, json.to_string()).unwrap();+ let fourth = harness(instance());+ assert_eq!(fourth.state().recoverable.len(), 1, "a name outside the folder is not looked at, and the snapshot is offered");+}diff --git a/crates/ui-egui/tests/reload.rs b/crates/ui-egui/tests/reload.rsindex 45c6ec56e..fb530093f 100644--- a/crates/ui-egui/tests/reload.rs+++ b/crates/ui-egui/tests/reload.rs@@ -78,6 +78,8 @@ fn harness(path: &str) -> Harness<'static, PdfCraftApp> {let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).build_eframe(move |_cc| {let mut app = PdfCraftApp::new();app.set_option("language", "en").unwrap();+ // The labels looked for are English, whatever the machine's language.+ app.set_option("language", "en").unwrap();app.run_inline = true;app.open_path(&path);app@@ -291,3 +293,74 @@ fn a_shorter_new_version_drops_what_pointed_into_the_old_one() {assert_eq!(view.current, 0, "the page is clamped");assert!(view.selected.is_empty() && view.comments.selected.is_none(), "no selection points past the new version");}++/// Save asks before writing over a version of the file the document did not come from (#2166):+/// something else wrote it since the open or the last save. Cancel keeps the file on disk;+/// Save anyway replaces it, and the next Save does not ask.+#[test]+fn saving_over_a_file_changed_by_something_else_asks_first() {+ let file = TempPdf::new("overwrite", &fixture(2));+ let mut h = harness(&file.path);+ rotate_first_page(&mut h);+ file.rebuild(&fixture(4));+ h.run_steps(3);+ h.get_by_label_contains("This file changed on disk");+ assert!(!h.state_mut().save_active(SaveTarget::InPlace), "not written yet");+ h.run_steps(2);+ h.get_by_label("Save over the changed file?");+ h.get_by_label("Cancel").click();+ h.run_steps(2);+ assert_eq!(std::fs::read(&file.path).unwrap(), fixture(4), "Cancel keeps the newer file");+ assert!(dirty(&h) && h.state().pending_overwrite.is_none());+ assert!(!h.state_mut().save_active(SaveTarget::InPlace));+ h.run_steps(2);+ h.get_by_label("Save anyway").click();+ h.run_steps(3);+ assert!(!dirty(&h), "written");+ assert_ne!(std::fs::read(&file.path).unwrap(), fixture(4));+ assert_eq!(pages(&h), 2, "the document, not the file, is what is shown");+ // Our own write is the version the document came from now.+ rotate_first_page(&mut h);+ assert!(h.state_mut().save_active(SaveTarget::InPlace), "written at once");+}++/// With the watcher off nothing notices the change until Save looks at the file.+#[test]+fn saving_checks_the_file_with_the_watcher_off_too() {+ let file = TempPdf::new("overwrite-unwatched", &fixture(2));+ let path = file.path.clone();+ let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).build_eframe(move |_cc| {+ let mut app = PdfCraftApp::new();+ app.set_option("language", "en").unwrap();+ app.run_inline = true;+ app.reload_changed_files = false;+ app.open_path(&path);+ app+ });+ h.run_steps(4);+ rotate_first_page(&mut h);+ file.rebuild(&fixture(4));+ h.run_steps(3);+ assert!(h.query_by_label_contains("This file changed on disk").is_none(), "nothing watched");+ assert!(!h.state_mut().save_active(SaveTarget::InPlace));+ h.run_steps(2);+ h.get_by_label("Save over the changed file?");+}++/// One file, one tab (#2166): opening a file that is open already brings its tab forward,+/// however its path is spelled.+#[test]+fn opening_a_file_that_is_open_focuses_its_tab() {+ let file = TempPdf::new("twice", &fixture(2));+ let mut h = harness(&file.path);+ let id = h.state().views[0].id;+ h.state_mut().open_bytes("other.pdf", None, fixture(1)).unwrap();+ h.run_steps(2);+ assert_eq!((h.state().views.len(), h.state().active), (2, Some(1)));+ let spelled = file.dir.join(".").join("thesis.pdf").to_string_lossy().into_owned();+ assert_ne!(spelled, file.path);+ h.state_mut().open_path(&spelled);+ h.run_steps(2);+ let app = h.state();+ assert_eq!((app.views.len(), app.active, app.views[0].id), (2, Some(0), id), "focused, not opened again");+}diff --git a/parity/acrobat-features.toml b/parity/acrobat-features.tomlindex ebf6ef439..2c84db6eb 100644--- a/parity/acrobat-features.toml+++ b/parity/acrobat-features.toml@@ -550,8 +550,8 @@ milestone = "M4"status = "shipped"commands = []tools = []-evidence = ["crates/ui-egui/tests/recovery.rs::a_crashed_session_is_offered_and_recovered_unsaved", "crates/ui-egui/tests/recovery.rs::discarding_removes_the_autosaves", "crates/engine/src/tests.rs::recovered_documents_reopen_unsaved_at_their_original_path"]-notes = ""+evidence = ["crates/ui-egui/tests/recovery.rs::a_crashed_session_is_offered_and_recovered_unsaved", "crates/ui-egui/tests/recovery.rs::discarding_removes_the_autosaves", "crates/ui-egui/tests/recovery.rs::a_running_instances_autosaves_are_not_offered_to_a_second_instance", "crates/engine/src/tests.rs::recovered_documents_reopen_unsaved_at_their_original_path"]+notes = "A running instance holds an exclusively locked instance file in the recovery folder and names it in its snapshots, so a second instance neither offers nor discards what the first is autosaving (#2166); the OS releases the lock when the process dies. Where the folder can't be written or the platform has no file locks, snapshots are offered as before."[[feature]]id = "core.encrypted-autosave"@@ -646,8 +646,8 @@ milestone = "M4"status = "shipped"commands = []tools = []-evidence = ["crates/engine/src/tests.rs::reload_reads_the_new_file_into_the_same_document", "crates/ui-egui/tests/reload.rs::a_rebuilt_file_reloads_in_place_keeping_the_page_and_zoom", "crates/ui-egui/tests/reload.rs::a_half_written_file_waits_until_the_pdf_is_whole", "crates/ui-egui/tests/reload.rs::saving_does_not_reload_or_lose_undo", "crates/ui-egui/tests/reload.rs::unsaved_changes_are_kept_until_reload_is_chosen", "crates/ui-egui/tests/reload.rs::a_deleted_file_leaves_the_document_open", "crates/ui-egui/tests/reload.rs::nothing_reloads_with_the_preference_off", "crates/ui-egui/tests/reload.rs::a_shorter_new_version_drops_what_pointed_into_the_old_one"]-notes = "Desktop, on by default (Preferences ▸ Documents and view, #431), for LaTeX/Typst builds: a worker thread checks each open file's metadata every 250 ms and reads a change once it has settled and ends in %%EOF; a clean document reloads in place (same tab, page, zoom, scroll; old page images stay until new ones are drawn), one with unsaved changes gets a Reload notice; PdfCraft's own saves never reload. Measured on Windows: one check 11 µs per file, reload of a 417-page 0.9 MB pdflatex file 16 ms. Not yet: OS change notifications (polling adds up to 250 ms), the web build; a reload clears undo history, like Revert."+evidence = ["crates/engine/src/tests.rs::reload_reads_the_new_file_into_the_same_document", "crates/ui-egui/tests/reload.rs::a_rebuilt_file_reloads_in_place_keeping_the_page_and_zoom", "crates/ui-egui/tests/reload.rs::a_half_written_file_waits_until_the_pdf_is_whole", "crates/ui-egui/tests/reload.rs::saving_does_not_reload_or_lose_undo", "crates/ui-egui/tests/reload.rs::unsaved_changes_are_kept_until_reload_is_chosen", "crates/ui-egui/tests/reload.rs::a_deleted_file_leaves_the_document_open", "crates/ui-egui/tests/reload.rs::nothing_reloads_with_the_preference_off", "crates/ui-egui/tests/reload.rs::a_shorter_new_version_drops_what_pointed_into_the_old_one", "crates/ui-egui/tests/reload.rs::saving_over_a_file_changed_by_something_else_asks_first", "crates/ui-egui/tests/reload.rs::saving_checks_the_file_with_the_watcher_off_too", "crates/ui-egui/tests/reload.rs::opening_a_file_that_is_open_focuses_its_tab"]+notes = "Desktop, on by default (Preferences ▸ Documents and view, #431), for LaTeX/Typst builds: a worker thread checks each open file's metadata every 250 ms and reads a change once it has settled and ends in %%EOF; a clean document reloads in place (same tab, page, zoom, scroll; old page images stay until new ones are drawn), one with unsaved changes gets a Reload notice; PdfCraft's own saves never reload. Save asks before writing over a version of the file the document did not come from, watcher on or off, with Save as… to keep it (#2166); a file that is open already comes to the front instead of opening twice. Measured on Windows: one check 11 µs per file, reload of a 417-page 0.9 MB pdflatex file 16 ms. Not yet: OS change notifications (polling adds up to 250 ms), the web build; a reload clears undo history, like Revert."[[feature]]id = "core.signed-save-policy"