Skip to content

Draw the inspector's properties as a property grid - #41

Merged
matt-edmondson merged 3 commits into
mainfrom
claude/blissful-wozniak-mnyiso
Sep 9, 2026
Merged

Draw the inspector's properties as a property grid#41
matt-edmondson merged 3 commits into
mainfrom
claude/blissful-wozniak-mnyiso

Conversation

@matt-edmondson

@matt-edmondson matt-edmondson commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

The node inspector's properties are now rows of ktsu.ImGui.Widgets' new PropertyGrid instead of individually labelled controls. Names line up in a column of their own, every editor fills the width left over rather than whatever the widest label made room for, and the divider between the two columns is the user's to drag.

What changed

  • AstGraphEditor.DrawInspector opens one ImGuiWidgets.PropertyGrid and draws each property as a row of it. Which rows a node has is still AstFields' answer, so the panel offers exactly what it did before — only the layout belongs to the widget now.
  • A whole number and a fraction get the grid's number rows rather than a text box, so the editor steps with the arrow keys and refuses what is not a number before AstFields.TryWrite has to. The value still travels as text between the two, which is what keeps one undoable command able to record any field. Text is still committed when the box is left or enter is pressed, so a rename is one undo step rather than one per character.
  • Two rows the widget has no method for — a choice between arbitrary labelled values, and a count with the buttons that change it — are composed into the grid's own table so they keep the same two columns and the same divider. The grid's Enum row spells an option by its enumeration name, where an operator here reads as its symbol beside its name and an unspecified visibility reads as "(language default)"; and the widget has no row that ends in buttons at all.
  • Both composed rows, and each option of a choice, are named for ktsu.ImGui.Probes the way the grid names its own rows, so a headless test finds them beside the rest.
  • The grid is given a name column of very nearly half the panel and fifteen significant digits for fractions, so a literal reads as 3.14 rather than 3.140000.

Dependencies

The whole ktsu ImGui suite goes to 3.31.0, the release the property grid arrived in, and ktsu.ImGui.Probes joins the list. An earlier revision of this branch held everything but the widgets back at 3.28.0, because 3.29–3.30's retuned layout pushed a node past what Editor_KeepsTheLayoutInsideTheView allowed; #40 has since taken the suite to 3.30.0 on main and reshaped that test around the new layout, so this branch merges main and moves every package together.

Testing

dotnet build clean, and the full suite passes on the merged tree: 378 tests, including five new ones in AstGraphEditorInspectorPanelTests that drive the panel through the headless rasterizer — a row per property, a typed rename committed on leaving the box as one undo step, a flag committed as it is clicked, an operator picked from the combo by its readable label, and a slot grown and shrunk by its buttons.

🤖 Generated with Claude Code

https://claude.ai/code/session_01UNhZ9nTJqzyTmCySe2ZE5z

Every property of the selected node is now a row of ktsu.ImGui.Widgets'
PropertyGrid rather than an individually labelled control: the names line up
in a column of their own, the editors fill the width left over rather than
whatever the widest label made room for, and the divider between the two is
the user's to drag.

Which rows a node has is still AstFields' answer, so the panel offers what it
always did. What changed beside the layout is that a whole number and a
fraction get the grid's number rows rather than a text box, so the editor
steps with the arrow keys and refuses what is not a number before
AstFields.TryWrite has to; the value still travels as text between the two,
which is what keeps one undoable command able to record any field.

Two rows the widget has no method for - a choice between arbitrary labelled
values, and a count with the buttons that change it - are composed into the
grid's own table, so they sit in the same two columns as the rest. Both are
named for the probes the way the grid names its own rows, which is what lets
the new panel tests pick an operator by the label it reads as.

ktsu.ImGui.Widgets goes to 3.31.0, where the property grid arrived, and
ktsu.ImGui.Probes comes with it. The rest of the suite stays at 3.28.0: the
releases in between also retuned the force-directed layout enough to move a
graph past what Editor_KeepsTheLayoutInsideTheView allows, which is a change
to take on its own.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UNhZ9nTJqzyTmCySe2ZE5z
MSTEST0037 through Sonar: Assert.HasCount says what is being counted, where
Assert.AreEqual against a Count reports only two numbers when it fails.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UNhZ9nTJqzyTmCySe2ZE5z
main has since taken the suite to 3.30.0 and reshaped
Editor_KeepsTheLayoutInsideTheView around the tuned layout it brings, which
is the change this branch had held the suite back from. With that on the
base there is nothing left to hold back: every package moves to 3.31.0
together, the release the property grid arrived in.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UNhZ9nTJqzyTmCySe2ZE5z
@matt-edmondson
matt-edmondson force-pushed the claude/blissful-wozniak-mnyiso branch from 693cb15 to 30c9f81 Compare September 9, 2026 07:55
@sonarqubecloud

sonarqubecloud Bot commented Sep 9, 2026

Copy link
Copy Markdown

@matt-edmondson
matt-edmondson merged commit 7e1c54f into main Sep 9, 2026
11 checks passed
@matt-edmondson
matt-edmondson deleted the claude/blissful-wozniak-mnyiso branch September 9, 2026 08:05
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.

2 participants