Skip to content

Read a templated dropdown's selection as the box shows it, and name the object selector's items (#1288) - #1300

Merged
imojenisys merged 2 commits into
mainfrom
fix/1288-dropdown-selection
Oct 21, 2026
Merged

imojenisys merged 2 commits into
mainfrom
fix/1288-dropdown-selection

Conversation

@imojenisys

Copy link
Copy Markdown
Contributor

Closes #1288.

On the Properties window's object selector, inspect_element gave selectionItems and value as ["HexIDE.VisualDesigner.ComponentInstanceViewModel"]. That is the selected item's ToString(), which the dropdown's peer names it by, not what the dropdown shows.

  • ComponentInstanceViewModel.ToString() returns the control's name, as ConflictedFileViewModel and others already do. So the object selector reads "Command1" closed and open, its rows are named in the dump, and select by value finds them. Its template shows the name and the class, "Command1 CommandButton", which names no control.
  • For any dropdown: some items give text without a ToString of their own: their type (generic arguments and all) or a record's members. When the selection or value is that text, it is read as the closed box shows it, from the visible text of the presenter of its selection box item. An item's own text is kept, whatever the template shows.
  • Tree hygiene now refuses this machine's session scratch folder and worktree root, and the selftest covers it. The first version of this branch had a test that wrote debug output there, which would have failed on CI.

Review

One adversarial reviewer, using headless probes, including the real PropertiesToolView loaded with parsed ComponentInstanceViewModels. No live IDE was available to this session.

Finding Severity Outcome
The committed test wrote to a machine-local scratch path, so it would throw on CI Blocker Fixed; the hygiene guard now refuses such paths
On the real selector the read was "Command1 Command" (name and class), which nothing else matched; rows were unnamed and select by value failed High Fixed at the source with ToString() => Name; test on the real view covers inspect closed and open, the dump row name and select by value
Records (LanguageInfo, RegionInfo in six real dropdowns) slipped past the type-name check Medium Fixed: the check compares with the item's own type text and a record's form; test
Generic view models slipped past it too Medium-low Fixed by the same check; test
Lists (ListBox SelectedNames, the Object Browser's lists) and unnamed multi-block rows have the same defect Medium Outside a dropdown fix: filed #1299
A text block inside a hidden parent was read Low Fixed: IsEffectivelyVisible; test
Run inlines, control items and editable boxes aren't read Low None in the app's dropdowns; left
The docs and test misdescribed why a string item keeps its name Low Reworded

The reviewer confirmed that the presenter lookup finds the closed box's presenter, not an open row's, in the Simple theme the IDE uses. SelectionBoxItemTemplate is respected, a null selection is safe, and the cost is negligible (about 15 ms per 1000 inspects).

Every new condition was mutation-checked. Unit 3086 and integration 1434 pass, and so does the hygiene selftest (67 assertions).

🤖 Generated with Claude Code

imojenisys and others added 2 commits October 21, 2026 03:56
… view model's type (#1288)

A closed dropdown's peer names its selection, and gives its value, by the
item's ToString, which for a view model shown through a template is its type
name. A selection or value that is only a type name is now read from the
presenter of the box's selection item.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…generics as the box shows them, and guard against session scratch paths (#1288 review)

The committed test still wrote debug output to this machine's session scratch
folder, which does not exist on CI. Removed, and the tree-hygiene guard now
refuses that folder and the local worktree root, with a selftest probe.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

inspect_element names a templated dropdown's selection by its view model's type

1 participant