Skip to content

Support HTML file inputs on desktop hosts - #10

Merged
dominicletz merged 2 commits into
masterfrom
feat/html-file-input-support
Sep 3, 2026
Merged

Support HTML file inputs on desktop hosts#10
dominicletz merged 2 commits into
masterfrom
feat/html-file-input-support

Conversation

@dominicletz

@dominicletz dominicletz commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add the macOS WKUIDelegate open-panel callback for HTML file inputs
  • document HTML file chooser support as required on macOS, Windows, and Linux
  • rely on WebView2 and WebKitGTK native chooser behavior where the engines provide it
  • add a shared file-input fixture and DOM-level E2E coverage

Testing

  • swift build -c debug
  • ./scripts/build_macos.sh
  • MIX_ENV=test NO_WX=1 mix test --exclude e2e
  • MIX_ENV=test NO_WX=1 DESKTOP_WEBVIEW_BINARY=priv/native/macos/DesktopWebView mix test.e2e
  • Linux build not run: GTK 4 and WebKitGTK 6 are not installed on this macOS host
  • Windows build not run: Windows-only toolchain

Native picker selection and cancellation remain manual checks because the shared E2E suite cannot drive OS file dialogs.


Note

Medium Risk
macOS modal sheet file panels run on the UI thread and touch web content file APIs; incorrect cancel/multiple/directory mapping could break uploads, though scope is isolated to the new delegate hook.

Overview
Adds required <input type="file"> support across macOS, Windows, and Linux, explicitly separated from the dialog.choose_file Elixir RPC.

On macOS, implements WKUIDelegate’s open-panel callback in WebWindow.swift, wiring NSOpenPanel for single/multiple/directory picks and nil on cancel. Windows and Linux are documented to rely on WebView2’s built-in picker and WebKitGTK’s default run-file-chooser handler—no new native code in this PR for those platforms.

Protocol and porting docs now define chooser semantics (multiple, webkitdirectory, cancel behavior, accept). Platform status matrices mark HTML file input as partial until manual native picker checks land.

E2E adds test/fixtures/file_input.html, a shared fixture_url/1 helper (base64 data: URLs), and HTML file input fixture exposes chooser semantics—DOM-only assertions via test.webview.eval; actual picker interaction stays manual.

Reviewed by Cursor Bugbot for commit 703c9aa. Configure here.

dominicletz and others added 2 commits September 4, 2026 01:25
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@dominicletz
dominicletz merged commit bdf8abc into master Sep 3, 2026
4 checks passed
@dominicletz
dominicletz deleted the feat/html-file-input-support branch September 3, 2026 23:49
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