Skip to content

fix(connections): make the connections strip's close command close the connection - #2115

Merged
datlechin merged 4 commits into
mainfrom
fix/rail-close-connection
Aug 15, 2026
Merged

fix(connections): make the connections strip's close command close the connection#2115
datlechin merged 4 commits into
mainfrom
fix/rail-close-connection

Conversation

@datlechin

Copy link
Copy Markdown
Member

Stacked on main after #2097.

The bug

Right-clicking a row in the connections strip offered Close Workspace, and choosing it appeared to do nothing.

It was wired to closeWorkspace(container:), a member of the tab strip's bulk-close family. It closed a subset of one connection's tabs and never the connection, and the row it was invoked on could not disappear as a result: WorkspaceRailStore.containers() re-inserts the browsed container on every rebuild. On a connection with no session yet it resolved no coordinator and returned in silence.

Why the connection, not the container

Established through the /fix-issue workflow: a codebase trace, an Apple platform survey and a competitor survey, run independently.

  • The HIG's Sidebars page has no close verb for a sidebar row at all, so the verb has to be borrowed rather than invented.
  • The only app shipping the literal string "Close Workspace" is Xcode's File menu, where it is the outermost close (the whole project session). TablePro used it for the innermost, so the label meant the opposite of what it did.
  • Finder's Locations rows, the structural analogue of a list of live remote sessions, end the session and drop the row.
  • TablePlus calls the (connection, database) pair a workspace, but it is a native window tab there, closed by the platform. Its own sidebar verb is "close connections".
  • No surveyed client puts "close the tabs of this database" on its connection list. Bulk tab closing lives on the tab strip, where TablePro already has it.

HIG Windows also rules out "workspace" as a user-facing noun for a window-like thing, so the word is retired from the UI.

What changed

  • ConnectionCloseAction, a peer of ConnectionDisconnectAction. Closes every tab across every database the connection has open, ends its session, and removes every row it holds. Its decision(hasSession:hasUnsavedWork:) is pure and pins the case that used to fail silently.
  • Unsaved work is confirmed only after the connection is brought on screen. An alert about work the user cannot see names nothing they can check.
  • Rail context menu: Disconnect (unchanged, gated on status), separator, Close "<name>". Plus Open in New Window when the window has another connection left.
  • File > Close Connection mirrors it, which the HIG requires of every context-menu command.
  • Middle-click a row, or ⌘W with the strip focused, closes the connection.
  • Open in New Window moves a live ConnectionWorkspace between windows through ConnectionWorkspaceHandoff, so tabs, session, unsaved edits and undo travel with it rather than being rebuilt.
  • "Workspace" retired from menus, shortcuts, settings, accessibility labels and docs. The strip is named for what it lists: Connections.

Deleted

closeWorkspace(container:), BatchCloseKind.container, and its arm in tabsToClose.

Tests

  • ConnectionCloseActionTests: all four decision inputs, including the sessionless case that was the silent no-op.
  • WorkspaceRailStoreTests: a connection with two databases loses both rows in one pass.
  • ConnectionCloseUITests: drives File > Close Connection against the sample database and asserts no connection is showing afterwards.
  • SingleWindowMenuContractUITests: File offers Close Connection; View names the strip Connections and no longer says Workspace Rail.

Verified: build clean, swiftlint --strict clean on 1373 files, 42 unit tests and 7 UI tests passing locally.

Not done

No UI test drives the rail's own contextual menu. The strip only appears with two connections open and the sample database is a single-file SQLite connection, so a second-connection fixture would be needed first. The connection form carries no accessibility identifiers today, which is what such a fixture would require.

@mintlify

mintlify Bot commented Aug 15, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
TablePro 🟢 Ready View Preview Aug 15, 2026, 1:07 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@datlechin
datlechin merged commit 380c29d into main Aug 15, 2026
4 checks passed
@datlechin
datlechin deleted the fix/rail-close-connection branch August 15, 2026 01:57
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