Skip to content

A double click opens the thing the node is - #223

Merged
dmitrat merged 1 commit into
mainfrom
studio/double-click-database
Aug 19, 2026
Merged

dmitrat merged 1 commit into
mainfrom
studio/double-click-database

Conversation

@dmitrat

@dmitrat dmitrat commented Aug 19, 2026

Copy link
Copy Markdown
Owner

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:

node what a double click opens
table its rows, for editing (WS-19)
view the rows it selects
connection the tab that describes the database - the same one the menu item opens
everything else nothing; the tree keeps its own behaviour, which for a folder is to open and close

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 switch in DatabaseExplorer.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.CanOpenWhatItIs and OpenWhatItIsAsync(), and the code-behind asks rather than decides.

The guard

ADoubleClickOpensWhatTheNodeIsTests drives 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.

  • Red with the Database arm removed.
  • Red again with the Table arm removed.

Studio: 1027 green.

🤖 Generated with Claude Code

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>
@dmitrat
dmitrat merged commit 42446c2 into main Aug 19, 2026
1 check passed
@dmitrat
dmitrat deleted the studio/double-click-database branch August 19, 2026 10:21
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