Skip to content

Feat: macOS file open and save sheets, FR-72 stage 1 (#483) - #503

Merged
b-re-w merged 15 commits into
developfrom
feat/file-dialog-483
Nov 7, 2026
Merged

b-re-w merged 15 commits into
developfrom
feat/file-dialog-483

Conversation

@b-re-w

@b-re-w b-re-w commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Part of #483

FR-72 stage 1, macOS. Targets v0.0.8 (not the v0.0.7 release branch).

Builds on #486. The common part (Rust FileDialog API, schema, codegen, Kotlin FileDialogCenter, fr72 Rust and Kotlin tests, wire tags: command ShowFileDialog = 26, event FileDialogResult = 50) is #486, merged in here with a merge commit rather than written twice. Merge #486 first; this diff then shrinks to the four commits below. No tag, record or schema hash changes beyond #486.

What this adds:

  • Chore: WINDOW_REVISION moves to e3088cc, the merge of fork Feat: Add a non-blocking macOS file open and save sheet thisisthepy/compose-multiplatform-core-extended#183 (FileDialogs, FileDialogLanes, MacosFileDialogs: NSOpenPanel / NSSavePanel as a sheet via beginSheetModalForWindow). The only other fork change since 1b2884f is its CI (fork Chore: Take the Java toolkit off the Linux native-image path #184).
  • Feat: renderer/macos/src/MacosFileDialogPlatform.kt, installed in FileDialogs.platform before the Host starts (single-window and multi-window runs).
    • Window: a Window node's MacosPlatformWindow.nativeWindow; node 0 is the single window, or in a multi-window run the key window (else the first open one).
    • One set of sheets per window (the fork keeps one window's requests in order); the window is held weakly; NSWindowWillCloseNotification and cancelWindow end its open and queued requests with Cancelled.
    • A request whose window is not on screen yet (first batch, or the batch that created the Window node) is retried on the main queue every 50 ms, up to 5 s, then answered Unavailable.
    • Open file / files / folder / folders, save with name and folder, filters with labels and a default, title shown as the sheet's message: all from the fork's panel code.
  • Tests: renderer/macos/test/MacosFileDialogTest.kt, fr72_macos_* (request and answer mapping, exactly one result, waiting for the window, a window that never opens, per-window sheets, window removal and close).
  • Docs: FR-72.6 states the stage 1 status (macOS shows the sheet; Windows, Linux, iOS, Android, web and the GraalVM native image answer Unavailable); changelog entry updated.

Not built locally (shared machine rule: no cargo, no renderer build). The macOS test file runs in the heavy "Native renderer test" / K/N desktop workflows.

Manual check list (FR-72 criterion 12, macOS): the list in #486 applies unchanged; it needs a macOS build of this branch.

Status (time box ended)

Done: pin move, macOS glue and its tests, SPEC 72.6 status line, changelog. All pushed (head ad628e6). Fast checks pass on that head except "Build and smoke test the GraalVM renderer (macOS, arm64)", which was still running.

Remaining:

b-re-w added 15 commits November 6, 2026 14:55
Host to Renderer command ShowFileDialog (tag 26) and the FileDialogResult
event (tag 50), add-only, no new boundary entry point. Rust: FileDialog
builder, FileDialogSender, request id table, exactly one callback per
request. Kotlin: FileDialogCenter normalizes the request, orders requests
per window, answers Unavailable on platforms without a dialog, cancels a
window's dialogs when it is removed, and delivers one event per request.
The macOS platform implementation follows with the fork pin.

Covers FR-72 criteria 1 to 8, 10 and 11 (criterion 9 and 12 need the
platform dialogs).

Refs #483
…(FR-72)

The choice used to lose the odd path and send the rest, so the application
got fewer paths than the user picked and could not tell. Covers FR-72
criterion 7.

Refs #483
…(FR-72)

A filter of only dots would have meant every file, the opposite of the
request. The default filter follows its filter when an earlier one is dropped.

Refs #483
…(FR-72)

WINDOW_REVISION moves to e3088cc, the merge of fork #183 (thisisthepy/compose-multiplatform-core-extended): FileDialogs in the common window module and MacosFileDialogs, NSOpenPanel and NSSavePanel as a sheet on the owning window. The only other change since 1b2884f is the fork's CI (#184).
The macOS renderer installs MacosFileDialogPlatform before the Host starts. It maps a request to the fork's MacosFileDialogs on the owning NSWindow (a Window node's platform window, or for node 0 the single window, or in a multi-window run the key or first window), keeps one set of sheets per window, cancels them when the window is removed or closes, and translates requests and answers. A request whose window is not on screen yet (the first batch, or the batch that created the window) is retried on the main queue for up to 5 seconds before it is answered Unavailable.

Tests: fr72_macos_* in renderer/macos/test, against fake sheets.
…483)

macOS shows the sheet; Windows, Linux, iOS, Android, the web and the GraalVM native image answer Unavailable until stages 2 and 3. The changelog says the same.
…code

scripts/tests/no-spec-citations.test.sh failed on five comments the macOS file dialog change added.
@b-re-w
b-re-w marked this pull request as draft November 7, 2026 03:02
@b-re-w
b-re-w merged commit 017ce33 into develop Nov 7, 2026
36 of 37 checks passed
@b-re-w
b-re-w deleted the feat/file-dialog-483 branch November 12, 2026 16:33
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