Insert SVG: the file picker opens on SVG files (#1801) (#1827)

* claim: #1801

* Insert SVG: the file picker opens on SVG files (#1801)

Every Open went through one host picker whose filters start with designs, CAD
files and meshes, so Insert SVG (and Insert DXF) in a sketch opened on STEP,
IGES and meshes, and the SVG file had to be found under another filter.

The host's pick_open now takes the extensions the command reads and offers
them as the picker's first, default filter. Insert SVG and Insert DXF pass
their type; every other Open passes none and keeps the list it had. The
browser host ignores them (it shows its own file panel).

---------

Co-authored-by: MateuszSychXpl <151755914+MateuszSychXpl@users.noreply.github.com>
This commit is contained in:
Mateusz SychandMateuszSychXpl authored and GitHub committed 2026-10-17 00:27:11 +00:00
1 parent a6ca2e8ca1
commit c599238653
7 files changed
+46 -14

No files matched your search

+1 -1
View File
@@ -183,7 +183,7 @@ impl Harness {
self.app.services.pick_save =
Some(Box::new(move |name, _| Box::pin(std::future::ready(Some(dir.join(name).to_string_lossy().into_owned())))));
let next = self.next_file.clone();
self.app.services.pick_open = Some(Box::new(move || Box::pin(std::future::ready(next.borrow_mut().take()))));
self.app.services.pick_open = Some(Box::new(move |_| Box::pin(std::future::ready(next.borrow_mut().take()))));
}
/// Autosave into the scenario's recovery folder (as the desktop app does into the user's).