Skip to content

fix: deep link cold launch missing toolbar and duplicate windows#467

Merged
datlechin merged 3 commits intomainfrom
fix/deeplink-cold-launch-465
Mar 26, 2026
Merged

fix: deep link cold launch missing toolbar and duplicate windows#467
datlechin merged 3 commits intomainfrom
fix/deeplink-cold-launch-465

Conversation

@datlechin
Copy link
Collaborator

Summary

Fixes #465

  • Connect before opening window: Calls connectToSession before openNewConnectionWindow so the session is already in activeSessions when ContentView.init runs. This avoids a SwiftUI bug where toolbar items are dropped when the NavigationSplitView detail transitions from "Connecting..." to MainContentView.
  • Prevent duplicate connections: Adds connectingURLConnectionIds guard set to prevent duplicate windows when the same deep link URL is opened twice rapidly (or re-processed from the cold-start queue).
  • Reactive title update: Updates windowTitle in handleConnectionStatusChange when the session first connects, fixing the stale "SQL Query" fallback title on cold launch.

Test plan

  • Cold launch: open "mysql://root@localhost/db?name=Test" -a TablePro — toolbar, title, and sidebar should all render correctly
  • Warm launch: same URL with app already running — should bring existing window to front or open correctly
  • Rapid duplicate: run the same open command twice quickly — should only create one connection window
  • SQLite file open: open test.sqlite -a TablePro on cold launch
  • Connection failure: use invalid credentials — should show error alert without ghost windows

…n leak

- Connect-before-window for deep links to prevent SwiftUI toolbar drop bug
- Deduplicate connections by param key (catches transient UUIDs and cross-path races)
- Use file path dedup for SQLite/DuckDB/generic file handlers
- Balance endFileOpenSuppression at batch level in handleOpenURLs
- Hide SwiftUI state-restored orphan windows via orderOut in windowDidBecomeKey
- Set pendingConnectionId at all openWindow(id:"main") call sites
- Set isRestorable=false on main windows to reduce restoration attempts
- Update window title on first session connect for cold-launch deep links
@datlechin datlechin merged commit c23c4af into main Mar 26, 2026
2 checks passed
@datlechin datlechin deleted the fix/deeplink-cold-launch-465 branch March 26, 2026 12:48
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.

bug: Open a connection via CLI does not work if TablePro is not already running

1 participant