Skip to content

kicad: no KiCad at Edit offers the install above the pane (after the person's Edit; their press is the consent); free-space check before the download; support re-read after the install - #1560

Closed
i2cjak wants to merge 1 commit into
mainfrom
feat/kicad-install-offer
Closed

i2cjak wants to merge 1 commit into
mainfrom
feat/kicad-install-offer

Conversation

@i2cjak

@i2cjak i2cjak commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator

What a new person hits: with no KiCad, Edit used to end in "KiCad could not start: KiCad was not found: set its path in Settings > CAD" with Try again and Open the KiCad app instead. Both did nothing: there is no KiCad to retry or open. Setup's auto-install runs only in setup, once.

The design was agreed with the KiCad lead and the right-rail lead.

Client

  • screens/kicad_update.rs, the existing row above the pane (never over it), gets two new states:
    • Missing: "KiCad isn't installed. Backplane KiCad {version} ({size}) goes into {folder}, with no administrator password." Buttons Install KiCad (kicad-update:install) and Set a path… (kicad-update:path, which opens Settings → CAD's existing page).
    • NoPackage: none is published for this computer. The hub's reason, and Set a path…
  • The row shows only after the person's own Edit (or Open in KiCad, Try again) on that pane, i.e. the pane is ShowBy::Deliberate. It never shows on open, an agent's show, an automatic attach, a pre-warm or a restored tile layout.
  • "Not now" does not put a missing KiCad away.
  • Running, failed, offline and refused-for-space use the existing Progress and Failed states, with the hub's plain reason and Try again.
  • viewers/kicad_pane.rs:
    • no_kicad(info) covers a failed start whose reason is "KiCad was not found". There, Try again and Open the KiCad app are not offered.
    • The pane says "Install KiCad above to edit here, or set the path of a KiCad you have." on the person's pane, and "KiCad isn't installed. Press Edit to install it here." on any other.
    • Other start failures keep both buttons.
  • Consent stays single: only the row's Install KiCad (and Try again after a failed try) sends kicad.install {consent: true}. The hub's refusal still refuses without consent.
  • After the install, the reopen goes only to the pane the person pressed Install on, still on screen. The keyboard moves only if that press is still their last act (kicad pane: after an install, a pane whose Edit had no KiCad attaches again with its container; never a show loop against a KiCad outside it #1509's reattach_why / turned_since, unchanged).
  • Catalog: six entries in en, ja and es. The Android and iOS catalogs are regenerated (scripts/i18n-gate.sh is clean).

Hub

  • kicad/install.rs:
    • missing_offer is published in kicad.update as {missing, to, size, mb, folder, admin}, or {missing, nopackage, words}, when the CAD status is "missing". It carries no offer field, because it is not an update.
    • folder_words: ~/… on Linux and macOS, and the full %LOCALAPPDATA%\Backplane\kicad path on Windows. This replaces the old folder text in the consent line.
    • needs_admin is false on every platform, because managed_parent is the person's own folder, so "with no administrator password" holds everywhere. The text has a variant without it, should that change.
  • Free space, before anything downloads:
    • need_bytes is the rest of the archive, plus UNPACK_X (5) × the archive for the unpacked runtime, plus a tenth.
    • UNPACK_X is measured from the bp.13.3 packages: macOS 4.11× on disk (APFS, Lane M), Linux 4.66×, Windows 4.73× (its zip's file sizes). The largest, rounded up, is used for every platform. No pin format change.
    • space_refusal: "Not enough free space for KiCad: it needs about {need} in {folder}, and {free} is free". Free space that can't be read lets the install proceed, and so does a placeholder pin with size 0.
    • free_bytes reads statvfs (Unix) or GetDiskFreeSpaceExW (Windows) on the nearest existing folder.
    • A partial download still continues where it stopped, as before.
  • support re-read: on a successful install, embed::refresh_support runs before kicad.install says done. Before this, the pane kept the missing runtime's support.
  • kicad/ipc.rs: publish_cad publishes update_offer, or failing that, missing_offer.

Tests

  • Hub, kicad::install 37/0, kicad::ipc 19/0:
    • an_install_is_refused_for_space_before_anything_downloads: the rule, partials, unknowns, and the three measured packages under UNPACK_X.
    • free_space_is_read_where_the_install_goes_or_above_it
    • the_offer_names_the_folder_as_the_person_reads_it
    • no_kicad_at_all_is_offered_the_install_and_one_with_no_package_says_why: also checks that consent is still required.
  • Client, kicad_pane 55/0, kicad_update 3/0:
    • a_missing_kicad_is_offered_only_after_the_persons_edit_and_only_their_press_installs: no row and no install on a pane that isn't the person's; the words; the admin variant; no package; running; space; offline; failed.
    • a_pane_with_no_kicad_offers_no_dead_control
  • scripts/windows-check.sh host and gpui pass.
  • macOS: the change has no cfg(target_os = "macos") code. The free-space read is the generic cfg(unix) branch and the folder text is chosen at run time, so the Linux and Windows compiles cover it.

Release QA: the fresh-home Edit → Install row per platform, including Carbon's refused-Edit → Install row, and measure_no_kicad turned into a row.

Review brief: find a way an install starts without the person's press, and a way the pane is left on a dead control.

🤖 Generated with Claude Code

…(after the person's Edit only; Install KiCad is the consent, Set a path… opens Settings → CAD); the pane drops its dead Try again and Open the KiCad app; an install is refused for space before anything downloads (archive left + 5x unpacked + a tenth); support re-read before the install says done

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@i2cjak

i2cjak commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator Author

Landed via #1565 at 2f62cbf (rebased onto main with Msg.kt regenerated).

@i2cjak i2cjak closed this Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant