Skip to content

refactor(connection-form): rebuild the macOS editor as one scrolling form - #4391

Merged
datlechin merged 2 commits into
mainfrom
refactor/connection-form-revamp
Nov 21, 2026
Merged

datlechin merged 2 commits into
mainfrom
refactor/connection-form-revamp

Conversation

@datlechin

@datlechin datlechin commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Rebuilt the macOS connection editor as one scrolling grouped Form in place of the four-pane sidebar split. A connection is a single object, so it reads top to bottom (Identity, Connection, Authentication, Transport, Encryption, Appearance) with the rarely-set options behind one Advanced disclosure. Drops ConnectionFormSplitViewController, ConnectionFormSidebar and ConnectionFormDetailView; the window now hosts ConnectionFormContentView in an NSHostingController.
  • Extracted ConnectionPresentation, a pure engine for field visibility, built-in password hiding and required/range validation, fed one merged value dictionary. The three pane view models read it instead of each re-deriving the same answers.
  • Added an Environment label (Production / Staging / Development / Local) on the identity row, stored in the app-managed additionalFields["environment"] key so it rides the existing synced field set.
  • Replaced the "Prompt for password" checkbox with a Password menu: Store in Keychain or Ask Every Time.

Fixes found while in here:

  • Password hiding read the authentication pane's value slice instead of the merged dictionary, so a cross-section rule (Redis Sentinel) resolved the wrong way.
  • The connect timeout getter on macOS did not range-check, so the same stored value resolved differently on macOS and iOS.
  • Closing the form mid-test left the test's staged secrets in the Keychain; a close now cancels the test and reaps them.
  • Editing a connection deleted elsewhere opened a blank form that only errored on Save; it now shows an inline "Connection Not Found".
  • Remote-file drivers reported "SSH host is required" twice; the SSH pane owns it now.
  • The transport footer always showed the read-only-copy summary even for the "On the Server" remote-file mode.
  • A failed cloudflared access login gave no feedback and left the process unreaped.

Not in scope, with reasons

  • Run-a-command password mode: a new arbitrary-shell surface; it already exists via credential profiles and warrants its own security-reviewed change.
  • A dedicated synced Environment field: a new CloudKit field needs a Production schema deploy (maintainer only), so the label rides the existing additionalFields instead.

Test plan

  • New ConnectionPresentationTests (7 cases: section/visibility, cross-section visibleWhen, password hiding, required/range, hidden-required, defaults, visibility cycle).
  • New ConnectionFormEditsTests.environmentRoundTrips and an appManagedAdditionalFieldIDs assertion.
  • ConnectionTimeoutSettingsTests exercises the connect-timeout clamp and the kafka legacy-key short-circuit.
  • Replaced the removed ListClickFocusUITests (it drove the deleted sidebar) with ConnectionFormDisclosureUITests, which opens the new form and checks the Advanced disclosure reveals the options.
  • build, test, lint and l10n pass in the worktree. Reviewed by Codex (two rounds of findings, both fixed, third round clean).

Screenshots

Before After
Light before light after light
Dark before dark after dark

…form

Drop the four-pane sidebar for a single grouped Form with an Advanced
disclosure, extract a pure ConnectionPresentation engine the pane view models
share, add an Environment label and a Store-in-Keychain/Ask password menu, and
fix the defects found on the way (password hiding, connect timeout, test-secret
leak, missing-record form, duplicate SSH-host issue, cloudflared login).
@datlechin
datlechin merged commit d0841bb into main Nov 21, 2026
10 of 11 checks passed
@datlechin
datlechin deleted the refactor/connection-form-revamp branch November 21, 2026 07:34
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