Skip to content

Keep Open and Save asynchronous to prevent macOS resize crashes - #1127

Merged
bherbruck merged 3 commits into
tangency-labs:mainfrom
Karl-VonRichter:fix/macos-async-file-dialogs
Oct 14, 2026
Merged

bherbruck merged 3 commits into
tangency-labs:mainfrom
Karl-VonRichter:fix/macos-async-file-dialogs

Conversation

@Karl-VonRichter

@Karl-VonRichter Karl-VonRichter commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Resizing the main window while Open or Save is open can re-enter winit from rfd's synchronous AppKit modal loop and abort SolidCraft. Open and Save now use parented AsyncFileDialog sheets; their answers run on the UI thread in a later frame.

The shared picker flow covers Home, File/keyboard actions, imports, exports, canvases, parameters, shortcuts and screenshot saving. Editors, tab changes and model-changing control requests wait for the answer. Save before Close/Quit resumes only after a successful write; cancelling or a failed save keeps the design open. Browser and scenario hosts return ready futures through the same interface.

Fixes #1088.

Validation:

  • GitHub CI on ad562af is green: 12 checks succeeded and four optional checks were skipped.
  • Ran RUSTUP_TOOLCHAIN=1.99.0 RUST_TEST_THREADS=2 RAYON_NUM_THREADS=2 ACTION_MATRIX_JOBS=2 cargo xtask ci. Formatting, assets, licences, layers, Clippy, wasm, 672 UI tests and 109 GUI scenarios pass on the rebased branch. The action matrix passes with bounded workers; the earlier unconstrained run hit geometry timeouts.
  • Six delayed-answer regression tests cover resize frames, cancellation, Save As, Close/Quit success and failure, multiple untitled tabs, held control requests and canvas placement.
  • Native macOS: Open remained active through resize and cancellation. Save As remained active at 1400 × 900 and 1100 × 700, then wrote the chosen design. Resize, inspection and screenshot requests answered while the sheet was open; the isolated run produced no crash reports. Resizes were driven through the control channel.

Actual captures from the public 60 × 40 × 12 mm box reproduction (the native sheet is captured separately from egui's app frames):

Native macOS Save As remains open while the main window resizes

Evidence and reproduction notes. The captures are hosted separately and are not committed to the repository.

Local macOS validation caveat: full local CI is blocked by three kernel failures that also reproduce independently on unchanged upstream kernel code, both before and after rebasing onto fbd8ada7:

  • blend::tests::a_blend_along_a_boss_ends_on_the_box_side_beside_it: blend rejects a non-straight neighbouring edge.
  • issue_851_tests::arc_top_edge_sizes_never_panic: at radius 10, one face does not mesh.
  • issue_851_tests::fillet_the_three_edges_at_the_arcs_front_corner: a tessellation boundary does not lie on its surface.

This PR changes no kernel, geometry or sketch code. The remaining long-running workspace checks were stopped once these reproducible baseline failures were confirmed; full local macOS CI is not claimed green. GitHub CI completed successfully as noted above.

@Karl-VonRichter
Karl-VonRichter marked this pull request as ready for review October 14, 2026 15:46
The local library rows in the Appearance dialog (tangency-labs#863) still called the
picker services synchronously. They now ask with pick_open/pick_save and
load or export when the picker answers.
@bherbruck
bherbruck force-pushed the fix/macos-async-file-dialogs branch from 6ff0f6c to fe6ea57 Compare October 14, 2026 17:15
@bherbruck
bherbruck merged commit 37547f8 into tangency-labs:main Oct 14, 2026
16 checks passed
@bherbruck

Copy link
Copy Markdown
Collaborator

Thanks, this is a great fix. Main had picked up the local library rows in the Appearance dialog (#863) since your last push, and they still called the pickers synchronously, so I merged main in and moved those two onto pick_open/pick_save before merging.

tsijercic1 added a commit to tsijercic1/solidcraft that referenced this pull request Oct 14, 2026
Brings in 26 commits up to 764fcaa. Main took format 20, so
manufacturing data is now format 21; docs/features.md is regenerated.
Main's file pickers are asynchronous now (tangency-labs#1127), so the Tool Library's
import and export and Post Process use app.pick_open / pick_save.

Checked on the merged tree: fmt, clippy, layers, assets, and the cam,
doc, ui-egui and engine CAM/format tests. The wasm check fails in
crates/ui-egui/src/dialogs_library.rs (with_state is native-only but
used on wasm); that file is main's, unchanged here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

macOS: resizing the window while an Open or Save dialog is open crashes the app

2 participants