Skip to content

Open from computer: let iOS and iPadOS pick .solidcraft files (#6977) - #7351

Merged
bherbruck merged 2 commits into
tangency-labs:mainfrom
semmelrinde:fix/ios-safari-open-solidcraft
Oct 27, 2026
Merged

bherbruck merged 2 commits into
tangency-labs:mainfrom
semmelrinde:fix/ios-safari-open-solidcraft

Conversation

@semmelrinde

@semmelrinde semmelrinde commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #6977

Change

On an iPhone or iPad, Open ▸ Open from computer showed every .solidcraft design greyed out, so it could not be picked.

Safari on iOS and iPadOS has no File System Access picker, so the web app opens a hidden <input type=file> (input_picker in apps/solidcraft-web/src/files.rs). Its accept attribute listed only file extensions (.solidcraft,.json,.step,…). The iOS file picker does not filter by extension. It turns each accept entry into a system file type (a Uniform Type Identifier) and offers only files of those types. A .solidcraft file is a zip package with our own extension. No system type has that extension, so the file has no type in the list, and the picker greys it out. The same happens to other extensions the system does not know. Every browser on iOS uses the same WebKit picker, so Chrome and Firefox there behave the same way.

Public references:

What changed:

  • disk::apple_touch(user_agent, touch_points) tells whether the page runs on an iPhone or iPad. iPadOS reports itself as a Mac, so a Mac user agent with more than one touch point counts as an iPad. This is the same test the Install app steps use (safari_steps in crates/ui-egui/src/install.rs), but for every browser, not only Safari.
  • disk::input_accept(extensions, apple_touch) builds the accept value. On an iPhone or iPad it is empty, so the picker offers every file. Everywhere else it is the extension list from accept_list, as before.
  • Both file inputs use it: input_picker (Open from computer and Insert without the File System Access API) and choose_file through pick_upload (Insert DXF/SVG, images, meshes, settings), which had the same problem for extensions such as .dxf.

Desktop browsers keep exactly the filter they had. On an iPhone or iPad, a picked file SolidCraft can't read goes through the same open or import path as before and gets its usual error in the status bar. I chose an empty accept over adding application/octet-stream: on iOS that type matches every file anyway, and on desktop browsers it would add unrelated extensions to the filter. Removing accept is also the change the reporter tried on an iPad, and it made the design selectable.

Changes a default: no

Validation

  • New test disk::tests::file_inputs_on_an_iphone_or_ipad_offer_every_file in apps/solidcraft-web/src/disk.rs, next to the other file input test. It checks that:
    • an iPhone, Chrome on iOS and an iPad (Mac user agent with touch points) count as iPhone or iPad;
    • a Mac without touch, a touch-screen Windows PC and an empty user agent do not;
    • the accept value is empty on an iPhone or iPad and .solidcraft,.json,.step elsewhere.
  • Fails without the fix: the functions don't exist on main. With input_accept changed to ignore apple_touch (the old behaviour, extensions only), the test fails on assert_eq!(input_accept(&designs, true), "").
  • cargo test -p solidcraft-web --bin solidcraft-web disk::: 11 passed.
  • cargo test -p solidcraft-web --bin solidcraft-web: 23 passed.
  • cargo build -p solidcraft-web --target wasm32-unknown-unknown: builds.
  • cargo clippy -p solidcraft-web --all-targets -- -D warnings (native): clean.
  • cargo clippy -p solidcraft-web --target wasm32-unknown-unknown --no-deps -- -D warnings: nothing in the changed files. It reports two useless_conversion lints in apps/solidcraft-web/src/install.rs, which this PR doesn't touch; they come from a newer clippy and are on main too.
  • cargo fmt -p solidcraft-web --check: clean.

Not tested on a real iPhone or iPad: no device was available. The behaviour on such a device follows the reporter's test in the issue (no accept, the design can be picked).

Screenshots of the behavior (when observable)

No screenshots. The change only shows in the iOS and iPadOS file picker, which needs a real device or the iOS Simulator with Safari, and neither was available here. Desktop browsers look and behave as before. The reporter's screenshots in #6977 show the greyed-out design.

Integration status

Based on main at 610f2e4. Open PRs that touch apps/solidcraft-web/src/files.rs or disk.rs: #6696, #5821, #4839, #4507 and #4020. None of them changes input_picker, choose_file or accept_list.

🤖 Generated with Claude Code

…cy-labs#6977)

The iOS file picker matches an input's accept list by system file type,
not by extension. No system type has the .solidcraft extension, so the
designs were greyed out. On an iPhone or iPad the file inputs now offer
every file; other devices keep the extension filter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@semmelrinde
semmelrinde marked this pull request as ready for review October 27, 2026 01:09
@bherbruck bherbruck added ready to merge reviewed, every ask addressed; merge once CI is green approved-for-ci Reviewed: run the full PR CI (build, tests, goldens, Clippy) labels Oct 27, 2026
@bherbruck
bherbruck added this pull request to the merge queue Oct 27, 2026
Merged via the queue into tangency-labs:main with commit 9d01dcb Oct 27, 2026
84 of 87 checks passed
@semmelrinde
semmelrinde deleted the fix/ios-safari-open-solidcraft branch October 27, 2026 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved-for-ci Reviewed: run the full PR CI (build, tests, goldens, Clippy) ready to merge reviewed, every ask addressed; merge once CI is green

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Open from computer: can't select .solidcraft archive on iOS Safari

2 participants