fix(connections): make the connections strip's close command close the connection - #2115
Merged
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Stacked on
mainafter #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-issueworkflow: a codebase trace, an Apple platform survey and a competitor survey, run independently.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 ofConnectionDisconnectAction. Closes every tab across every database the connection has open, ends its session, and removes every row it holds. Itsdecision(hasSession:hasUnsavedWork:)is pure and pins the case that used to fail silently.ConnectionWorkspacebetween windows throughConnectionWorkspaceHandoff, so tabs, session, unsaved edits and undo travel with it rather than being rebuilt.Deleted
closeWorkspace(container:),BatchCloseKind.container, and its arm intabsToClose.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 --strictclean 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.