From 8cce362009cda540dd038568bec1082ccc15520a Mon Sep 17 00:00:00 2001 From: Afonsop Date: Tue, 15 Sep 2026 20:10:17 +0100 Subject: [PATCH] web: warn when an opened drawing's name collides with an open tab Web builds identify drawings by bare file name (the browser picker exposes no real path), so two tabs with the same name also share the single browser-stored copy: the last save silently replaces the other tab's. Warn on open instead of letting that surface later. (cherry picked from commit 63063593905b7b454dc2b49f8b37c61ca1f06280) --- src/app/update/file.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/app/update/file.rs b/src/app/update/file.rs index 8c7f591f1..da8da00bd 100644 --- a/src/app/update/file.rs +++ b/src/app/update/file.rs @@ -1868,6 +1868,22 @@ impl OpenCADStudio { if self.opening.is_none() { return Task::none(); } + // Web drawings live under bare file names: two tabs sharing a name + // also share the single browser-stored copy, and the last save + // silently replaces the other tab's. Warn at open time — the + // desktop identifies drawings by full path and needs no such check. + #[cfg(target_arch = "wasm32")] + if self.tab_showing(&path).is_some() { + self.command_line.push_warning( + crate::tf!( + "\"{}\" is already open in another tab. On the web both \ + tabs share one stored copy — the last save overwrites \ + the other.", + name + ) + .as_ref(), + ); + } let open_started = self.opening.as_ref().map(|p| p.started); let size_bytes = self .opening