Skip to content

fix(connections): show inline connecting state and clean up on cancel (#1185)#1232

Merged
datlechin merged 1 commit into
mainfrom
fix/connecting-state-window
May 12, 2026
Merged

fix(connections): show inline connecting state and clean up on cancel (#1185)#1232
datlechin merged 1 commit into
mainfrom
fix/connecting-state-window

Conversation

@datlechin
Copy link
Copy Markdown
Member

Summary

  • Replaces the empty/half-rendered editor window during connect with a native ContentUnavailableView showing the database type icon (with .symbolEffect(.pulse)), connection name, host:port, an in-line spinner, and a Cancel button.
  • Cancels the in-flight ensureConnected task and drops the .connecting session entry when the user closes the editor window mid-connect, so the libpq result is discarded silently.
  • Suppresses the post-cancel "Connection Failed" alert and the ghost "Connecting…" window: WelcomeViewModel/ConnectionFormCoordinator check WindowManager.hasOpenWindow(for:) and only present the alert when the editor window is still open.
  • Tears down a successful late connection if the user already closed the window, so we don't leak a connected driver.

Closes #1185.

Test plan

  • Connect to a reachable host: connecting state shows briefly, then the editor takes over.
  • Connect to an unreachable host (e.g. 192.168.79.78:5432): connecting state shows; clicking Cancel or the X closes the window cleanly with no ghost and no alert.
  • Wait for the libpq timeout instead: window closes itself and a single "Connection Failed" alert appears on Welcome.
  • Save & Connect from the connection form to a bad host: same suppression applies.

@datlechin datlechin force-pushed the fix/connecting-state-window branch from e42d7e7 to 3397305 Compare May 12, 2026 07:39
@datlechin datlechin force-pushed the fix/connecting-state-window branch from 3397305 to a6824c9 Compare May 12, 2026 07:45
@datlechin datlechin merged commit 868a646 into main May 12, 2026
2 checks passed
@datlechin datlechin deleted the fix/connecting-state-window branch May 12, 2026 08:03
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.

Weird behavior when database connection fails

1 participant