Skip to content

[Feature]: Let --class-name / --type be the whole ui query, with no text selector #1095

Closed

Description

Is your feature request related to a problem? Please describe.

Part of #1084 (item 2).

--class-name and --type can only narrow a text match. You can't ask for "the element of class CalendarSurface" without knowing its name, and * matches nothing.

winapp ui search --class-name CalendarSurface -a <app>
-> ❌ A selector is required.
expected: the elements whose ClassName is CalendarSurface

Describe the solution you'd like

When --class-name or --type is given, accept a missing text selector on search, wait-for, get-property and the single-element verbs. Single-element verbs still require exactly one match and fail as ambiguous otherwise.

Additional context

The selector argument is currently required, and UiQueryOptions.ValidateWithOptionalSelector explicitly rejects filters without a selector.

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions