Repository navigation
Feat: macOS file open and save sheets, FR-72 stage 1 (#483) - #503
Merged
Merged
Conversation
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
… with a hint for the app (FR-72, #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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
FileDialogAPI, schema, codegen, KotlinFileDialogCenter, fr72 Rust and Kotlin tests, wire tags: commandShowFileDialog= 26, eventFileDialogResult= 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_REVISIONmoves 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/NSSavePanelas a sheet viabeginSheetModalForWindow). 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 inFileDialogs.platformbefore the Host starts (single-window and multi-window runs).Windownode'sMacosPlatformWindow.nativeWindow; node 0 is the single window, or in a multi-window run the key window (else the first open one).NSWindowWillCloseNotificationandcancelWindowend its open and queued requests withCancelled.Windownode) is retried on the main queue every 50 ms, up to 5 s, then answeredUnavailable.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 answerUnavailable); 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:
run-heavy-cilabel is the next step once the GraalVM macOS check is green. The label is not on yet.filteris the position in the normalised list, so when a filter was dropped it is not the Host's original position (default_filteris mapped back, the result is not).