Skip to content

Commit 57c0b44

Browse files
nmetulevCopilot
andcommitted
Update docs for SelectionPattern fallback and invokable disambiguation
- get-value docs: add SelectionPattern to fallback chain description, add ComboBox example - wait-for docs: update fallback chain to include SelectionPattern - Plain text search: document invokable disambiguation behavior - Updated: ui-automation.md, SKILL.md, skill fragment, npm-usage.md Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent de9ab66 commit 57c0b44

4 files changed

Lines changed: 10 additions & 5 deletions

File tree

.github/plugin/skills/winapp-cli/ui-automation/SKILL.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ winapp ui screenshot -a myapp --capture-screen --output with-popups.png
105105
# Read text/value content (works for RichEditBox, TextBox, Slider, labels)
106106
winapp ui get-value doc-texteditor-53ad -a notepad
107107
winapp ui get-value SearchBox -a myapp
108+
winapp ui get-value CmbTheme -a myapp # reads ComboBox selected item via SelectionPattern
108109
109110
# Check toggle/selection state, value, scroll position
110111
winapp ui get-property chk-agreecheckbox-b2c3 -a myapp --property ToggleState
@@ -262,7 +263,7 @@ Read UIA property values from an element. Specify --property for a single proper
262263

263264
### `winapp ui get-value`
264265

265-
Read the current value from an element. Tries TextPattern (RichEditBox, Document), ValuePattern (TextBox, ComboBox, Slider), then Name (labels). Usage: winapp ui get-value <selector> -a <app>
266+
Read the current value from an element. Uses smart fallback: TextPattern (RichEditBox, Document), ValuePattern (TextBox, Slider), SelectionPattern (ComboBox, RadioButton, TabView), then Name (labels). Usage: winapp ui get-value <selector> -a <app>
266267

267268
#### Arguments
268269
<!-- auto-generated from cli-schema.json -->

docs/fragments/skills/winapp-cli/ui-automation.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,10 @@ winapp ui screenshot -a myapp --capture-screen --output with-popups.png
9797

9898
### Read element state
9999
```powershell
100-
# Read text/value content (works for RichEditBox, TextBox, Slider, labels)
100+
# Read text/value content (works for RichEditBox, TextBox, ComboBox, Slider, labels)
101101
winapp ui get-value doc-texteditor-53ad -a notepad
102102
winapp ui get-value SearchBox -a myapp
103+
winapp ui get-value CmbTheme -a myapp # reads ComboBox selected item via SelectionPattern
103104
104105
# Check toggle/selection state, value, scroll position
105106
winapp ui get-property chk-agreecheckbox-b2c3 -a myapp --property ToggleState

docs/npm-usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ function uiGetProperty(options?: UiGetPropertyOptions): Promise<WinappResult>
495495

496496
### `uiGetValue()`
497497

498-
Read the current value from an element. Tries TextPattern (RichEditBox, Document), ValuePattern (TextBox, ComboBox, Slider), then Name (labels). Usage: winapp ui get-value <selector> -a <app>
498+
Read the current value from an element. Uses smart fallback: TextPattern (RichEditBox, Document), ValuePattern (TextBox, Slider), SelectionPattern (ComboBox, RadioButton, TabView), then Name (labels). Usage: winapp ui get-value <selector> -a <app>
499499

500500
```typescript
501501
function uiGetValue(options?: UiGetValueOptions): Promise<WinappResult>

docs/ui-automation.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ winapp ui search "Save" -a notepad # find elements containing "Save"
128128
winapp ui search "error" -a myapp # case-insensitive match
129129
```
130130

131+
When a text search matches multiple elements (e.g., SettingsExpander where Group, Button, and Text all share the same name), the CLI automatically picks the only invokable element. If multiple are invokable, it lists all matches with slugs.
132+
131133
For non-invokable search results (e.g., a TextBlock inside a Button), the search
132134
automatically surfaces the nearest **invokable ancestor** — the parent element you can use with `invoke`.
133135
This works for all search selectors:
@@ -268,10 +270,11 @@ winapp ui set-value sld-volume-b2c3 75 -a myapp
268270
```
269271

270272
### get-value
271-
Read the current value from an element. Tries TextPattern (RichEditBox, Document), ValuePattern (TextBox, Slider), then Name (labels).
273+
Read the current value from an element. Uses a smart fallback chain: TextPattern (RichEditBox, Document)ValuePattern (TextBox, Slider) → SelectionPattern (ComboBox, RadioButton, TabView) → Name (labels).
272274
```bash
273275
winapp ui get-value doc-texteditor-53ad -a notepad # read full document text
274276
winapp ui get-value SearchBox -a myapp # read TextBox content
277+
winapp ui get-value CmbTheme -a myapp # read ComboBox selected item
275278
winapp ui get-value sld-volume-b2c3 -a myapp # read Slider value
276279
winapp ui get-value lbl-title-a1b2 -a myapp --json # JSON: { "elementId": "...", "text": "..." }
277280
```
@@ -436,7 +439,7 @@ steps:
436439
437440
### Assert element state with `wait-for`
438441
`wait-for --value` polls until an element's value matches the expected string, using the same
439-
smart fallback as `get-value` (TextPattern → ValuePattern → Name). Returns exit code 0 on match,
442+
smart fallback as `get-value` (TextPattern → ValuePattern → SelectionPattern → Name). Returns exit code 0 on match,
440443
exit code 1 on timeout — making it a CI-friendly assertion. Use `--property` to check a specific
441444
UIA property instead.
442445

0 commit comments

Comments
 (0)