A double click opens the thing the node is - #223
Merged
Merged
Conversation
Asked in chat: would a double click on the database not open its properties, the way «Database...» does in the menu? It would, and it is the same rule rather than a third exception. A table IS its rows, so it opens the editor; a view IS the rows it selects; the connection IS the database, so it opens the tab that describes it - the same tab the menu item opens, and only ever one of them. Everything else keeps the tree's own behaviour, which for a folder is to open and close. The decision moved out of the code-behind and into the ViewModel, and that is the larger half of this change. Which node opens what is a RULE; only the gesture belongs to the view. It was written in the code-behind, where the double click had already been broken once and repaired onto a route that does not exist, with a thousand tests unable to say a word about any of it. It is now CanOpenWhatItIs and OpenWhatItIsAsync, and the fixture drives them over every kind of node: three open something, nine open nothing, and a tree whose connection has gone opens nothing at all. Red with the Database arm removed, and red again with the Table arm removed. Studio: 1027 green. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Asked in chat: would a double click on the database not open its properties, the way Database… does in the menu?
It would - and it is the same rule rather than a third exception:
Opening it twice is opening it once: the fixture asserts there is only ever one
DatabaseTabViewModel.The larger half: the rule moved out of the code-behind
Which node opens what is a rule; only the gesture belongs to the view. It was written as a
switchinDatabaseExplorer.axaml.cs- the half no test can reach, where this same double click had already been broken once and repaired onto a route that does not exist (#222), with a thousand green tests unable to say a word about any of it.It is now
DatabaseExplorerViewModel.CanOpenWhatItIsandOpenWhatItIsAsync(), and the code-behind asks rather than decides.The guard
ADoubleClickOpensWhatTheNodeIsTestsdrives it over every kind of node against a real database: three open something and the tab that appears is checked by type and by name; nine open nothing, and nothing is opened and nothing claims it could; a tree whose connection has gone opens nothing at all. The nine-node case carries its own CONTROL in the other direction, because a property that answered false to everything would satisfy it.Databasearm removed.Tablearm removed.Studio: 1027 green.
🤖 Generated with Claude Code