fix(connections): stop Export Options sheet from resizing and save via fileExporter#1739
Merged
Merged
Conversation
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.
What
Reworks the Welcome window's Export Options sheet (right-click a connection > Export) so it behaves like a native macOS dialog.
Why
Three defects, all from the view fighting macOS conventions:
Formthat conditionally added/removedSections, with a fixed width but no height, made the sheet jump when "Include Credentials" was turned on.Form(.formStyle(.grouped))inside hand-built title/divider/footer chrome rendered a card-in-a-card, inconsistent with the sibling import sheet.NSApp.keyWindow, then opened anNSSavePanelby hand, hand-rolling what.fileExporteralready does (and what the import side already uses via.fileImporter).What changed
VStack/Gridlayout in one fixedframe(width: 440, height: 300). Passphrase fields reveal in pre-sized space; the validation message sits in a reserved slot, so the window never resizes..fileExporterwith a newConnectionExportDocument: FileDocument. Removed thedismiss+Task.sleep(200ms)+NSApp.keyWindowworkaround.ConnectionExportPassphraseStateenum; Export stays disabled until valid, with inline warnings.ConnectionExportServicegainedData-returningexportData/exportEncryptedData; the existing URL writers now call them (signatures unchanged).Pro gating and security (passphrase zeroed once the ciphertext is built; the document holds only encrypted bytes) are preserved.
Tests
New
ConnectionExportDataTests: plaintext and encrypted round-trips (right and wrong passphrase) plus validator-state cases. This is the first coverage of the export pipeline.The system save panel is a system dialog and is not UI-automatable, so the save step itself is not covered by a UI test.
Notes
SwiftLint
--strictpasses on the changed files. The numbered steps indocs/features/connection-sharing.mdxstay accurate (the flow is unchanged), so no docs text change.