Files
Lenny Khazan 6efd247cae feat(pcb): add native KiCad URL launcher (#983)
* feat(pcb): add native KiCad URL launcher

* fix(pcb): harden launcher recovery choices

* fix(pcb): prevent concurrent recovery sessions

* fix(pcb): guard restored editor sessions

* refactor(pcb): extract shared pcb-diode-uri and pcb-native-dialog crates

pcb-launcher's URI validation re-implemented pcb-diode-api's SandboxFileUri
parsing; move that parser into a tiny pcb-diode-uri crate both can use, and
give the trusted-host allowlist a single home there. Likewise collapse the
duplicated osascript/zenity/kdialog/PowerShell dialog machinery from
pcb-launcher and pcbc's recovery dialog into a pcb-native-dialog crate.
Also drop the launcher's redundant staged-app cleanup (the Drop guard
covers it), the duplicate log chmod, the Debug-formatted log header, and
a clippy for_kv_map lint in the interposer pattern test.

* fix(pcb): block recovery while a recoverable session's editor is open

A recoverable stop now deliberately leaves KiCad running, so the
still-open-editor guard must cover Recoverable sessions too — otherwise
Restore reuses the same local layout dir while the first KiCad instance
still has it open. Also match the tracked pid's process name (open /
pcbnew / kicad) instead of bare liveness, so a recycled pid cannot
permanently wedge the board.

* refactor(pcb): simplify launcher install and open plumbing

Split install_shim_launcher into fetch / stage / replace helpers so the
Windows backup-rename dance is a reusable replace_executable_with_backup,
fold pcb-kicad's duplicated per-OS pcbnew command construction into one
builder, share a single Download-style helper in install.ps1 the way
install.sh already does, dedupe the recovery-cancel wind-down, and fix
the README's launcher wording.

* refactor(pcb): re-export diode URI types without a module alias

Nothing consumed the pcb_diode_api::diode_uri path; re-export the types
directly from pcb-diode-uri instead of aliasing the whole crate.

* refactor(pcb): trust *.diode.computer in release, all hosts in debug

Replaces the enumerated host allowlist: release launchers accept any
*.diode.computer subdomain (portless, so preview and gov endpoints work
without listing them), while debug builds trust every host so local API
stacks need no special-casing.
2026-08-26 10:46:19 -04:00
..