A rule needs something on both sides of it - #221
Merged
Merged
Conversation
Reported from a screenshot: the connection's own context menu drew Database..., Close database, a rule, Create, then TWO rules with nothing between them, Refresh, and two more rules below it with nothing after them at all. The cause is the other half of the change that gave each node its own menu. Every ITEM there learned to hide itself where it does not apply, and the five separators - the only elements of that menu with no condition on them - were left drawing the shape of a menu that is no longer there. Measured over all fourteen kinds of node: every one of them was wrong. A folder's menu began with a rule, a column's menu was one command wrapped in five, a sequence's was three rules, Refresh, two rules and Drop, and even a table's - the node with one of everything - opened with a stray line. Each separator now asks whether both sides of it are there. Refresh applies to every node, so anything above it always has something below, which is why the first three rules ask only about what precedes them. The guard reads the real menu: the ORDER and the conditions come from the markup and the answers from the real ViewModel, so it walks every node type and reports the sequence it would draw. It went red on all fourteen before the fix, and red again with each of the five conditions removed one at a time. Driven afterwards against a fresh build - the connection, a folder and a table all draw what the fixture says. Studio: 1019 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.
Reported from a screenshot: the connection's own context menu drew Database…, Close database, a rule, Create ▸, then two rules with nothing between them, Refresh, and two more rules below it with nothing after them at all.
What it was
The other half of the change that gave each node its own menu (#219). Every item in that shared menu learned to hide itself where it does not apply; the five separators - the only elements with no condition on them - were left drawing the shape of a menu that is no longer there.
Measured over all fourteen kinds of node, and every one of them was wrong:
Even the table - the node that has one of everything - opened with a stray line.
The fix
Each separator asks whether both sides of it are there.
Refreshapplies to every node, so anything above it always has something below - which is why the first three rules ask only about what precedes them.The guard
ARuleHasSomethingOnBothSidesTestsreads the real menu: the order and the conditions come fromDatabaseExplorer.axaml, the answers from the real ViewModel, so it walks every node type and reports the sequence that would be drawn. It asserts the exact menu of a connection, a folder, a column and a table, and the general rule - no leading rule, no trailing rule, no two running together - over all fourteen.Studio: 1019 green.
🤖 Generated with Claude Code