Connected indicator, Data Explorer-aware disconnect, and remove confirmation - #15241
Open
softwarenerd wants to merge 2 commits into
Open
Connected indicator, Data Explorer-aware disconnect, and remove confirmation#15241softwarenerd wants to merge 2 commits into
softwarenerd wants to merge 2 commits into
Conversation
|
E2E Tests 🚀 Why these tags?
More on automatic tags from changed files. |
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.
Fixes #14623
Summary
Removing a data connection deleted its saved profile but left the connection itself open. Because the profile's row was gone from the Data Connections panel, there was no longer any UI that could close it, so the underlying connection stayed open and unreachable for the rest of the session. Remove now closes the connection as part of removing the profile.
That turned out to need an answer to a broader question: when should a connection close? This PR settles the whole lifetime.
Collapsing a connection gives up the panel's use of it and closes it, as before -- unless Data Explorers previewed from that connection are still open, in which case the connection stays up and closes when the last of them is closed. Collapsing is how a user reclaims the panel's vertical space, so previews opened from a connection keep working across a collapse. Re-expanding cancels the pending close. Connection entries now show an indicator when they have a live connection, so a connection kept open behind a collapsed entry is visible rather than a surprise.
Remove now asks for confirmation first, naming the connection and how many open Data Explorers will close with it, since it deletes saved settings and stored secrets and cannot be undone. On confirmation it closes those Data Explorers, then the connection, then the profile. The Data Explorers are closed rather than left open because their backends die with the connection -- a tab left behind would be a grid that errors on the next scroll or filter.
For core to know which Data Explorers belong to which connection,
DataConnectionNode.preview()now returns the dataset id it opened the explorer under (the same id passed topositron.dataExplorer.open). The return value is optional, so a driver that reports nothing still works; it just can't hold its connection open. All six in-repo drivers report it. Core records those ids per profile and asks the editor service which still have an editor open, so closing a Data Explorer tab is immediately reflected.Supporting changes: a new
DestructiveTwoButtonFooterfor confirmation dialogs whose primary action can't be undone. It fills the primary button with the destructive red (positronModalDialog.buttonDestructiveBackgroundnow resolves to the same red a destructive context menu item uses) and focuses Cancel rather than the destructive button, so Enter and Escape both back out.TwoButtonFooteris unchanged.A dedicated Disconnect action is deliberately not added here (idea 2 in the issue). Collapse and Remove both close the connection now, so the gap the issue describes is closed without a third control; a separate Disconnect item can follow if it's still wanted.
Note for reviewers: this overlaps #15215 (Refresh / Refresh All) in four files, plus a
hasLoadedChildrenhelper both branches add toPositronTreeInstancethat git auto-merges into a duplicate. This branch will rebase onto main after #15215 lands.Screenshots
Connected data connection indicated with a green dot on the right:
Remove connection confirmation when there are no Data Explorer instances open:
Data connection with a Data Explorer open:
Remove connection confirmation when there is one Data Explorer instance open:
Remove connection confirmation when there are more than one Data Explorer instances open:
Release Notes
New Features
Bug Fixes
Validation Steps
@:connections @:data-explorer