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
@@ -21,5 +21,5 @@ pub fn save(app: &mut SolveApp, slot: &Slot) {
}
pub fn open(app: &mut SolveApp, slot: &Slot) {
let slot = slot.clone();
app.services.pick_open = Some(Box::new(move || Box::pin(Manual(slot.clone())) as FilePickerFuture));
app.services.pick_open = Some(Box::new(move |_| Box::pin(Manual(slot.clone())) as FilePickerFuture));
}