Skip to content

feat(skills): uno-dev automation ids on every control, and selectors before snapshots - #184

Merged
kazo0 merged 2 commits into
mainfrom
dev/steve/uno-dev-automation-ids
Oct 12, 2026
Merged

kazo0 merged 2 commits into
mainfrom
dev/steve/uno-dev-automation-ids

Conversation

@kazo0

@kazo0 kazo0 commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Companion to unoplatform/uno.app-mcp#181 (dev/sb/element-selector-targeting-1.4), which lets every element tool take automationId or name in place of a snapshot handle, resolved against the live tree at call time.

What

  • uno-dev agent and uno-build-app: a rule that every control a person acts on, and every element a check reads, carries AutomationProperties.AutomationId (PascalCase, role-named, unique on its page, bound to the item key inside templates), written with the XAML rather than added later.
  • uno-testing: locate by automationId or name first and snapshot only to discover or assert; handles when the element has neither; coordinates last. The tool reference documents the selector parameters, scopeRef, the no-match and ambiguity errors, and uno_app_type_text focusing its target. "Handles expire" becomes "selectors do not expire; handles do".
  • UseStudio in apps the agent creates: MainWindow.UseStudio(showHotReloadIndicator: false, launchHotDesignOnStart: false); under #if DEBUG. The Hot Reload indicator and Hot Design button otherwise sit over the app in every Debug screenshot, which is why the agent captured its final screenshots from Release builds through adb and UI Automation instead of through the App MCP (one FieldCheck session spent 50 adb calls and 12 Release build commands on that). Hot Reload and the App MCP are unaffected by the flag.
  • The top-level skills/ copies are updated to match.

Why

In the 2026-10-08 FieldCheck runs the Uno agent took a visual-tree snapshot before most element actions (17 to 32 per session, 6 to 9k chars each) and fell back to coordinate clicks when handles went stale (55 / 10 / 12 per session). With selectors an action is one call; with automation ids in the XAML the agent knows the selector before the app runs.

Verified

With the branch packed locally and a FieldCheck app from an earlier run: on desktop and on Android the App MCP offers the selector parameters, resolves name live (DataContext and screenshot by name, ambiguity list with fresh handles for duplicates), and rejects a bogus automationId and a two-selector call with the documented errors. A skill-ab smoke run with this checkout passes.

One thing the branch should know: the snapshot renders a name with spaces as #Primary_navigation, while the name selector needs the exact value Primary navigation; an agent that copies the token from the tree gets "No element matched". The skill text points at the XAML value, but rendering the raw name, or matching the underscored form too, would remove the trap.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SYer42kcr3PXtoro9RDXEL

kazo0 and others added 2 commits October 8, 2026 16:09
…before snapshots

uno.app-mcp#181 lets every element tool take automationId or name in place of
a snapshot handle, resolved against the live tree at call time. In the
FieldCheck runs the agent took a snapshot before most actions and fell back
to coordinate clicks when handles went stale; the new path is one call.

- uno-dev and uno-build-app: every control a person acts on, and every element
  a check reads, gets AutomationProperties.AutomationId as the XAML is written.
- uno-testing: locate by automationId or name first, snapshot only to discover
  or assert, handles when the element has neither, coordinates last; the tool
  reference documents the selector parameters, scopeRef and the no-match and
  ambiguity errors; type_text focuses its target.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SYer42kcr3PXtoro9RDXEL
…o-dev creates

App.xaml.cs calls UseStudio(showHotReloadIndicator: false, launchHotDesignOnStart: false): nothing of
Studio's sits over the app in Debug screenshots or under pointer clicks, so there is no reason to capture
from a Release build. Hot Reload and the App MCP are unaffected.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SYer42kcr3PXtoro9RDXEL
@kazo0
kazo0 added this pull request to stack #187 October 9, 2026 18:30
@kazo0 kazo0 changed the title feat(uno-dev): automation ids on every control, and selectors before snapshots feat(skills): uno-dev automation ids on every control, and selectors before snapshots Oct 12, 2026
@kazo0
kazo0 force-pushed the dev/steve/uno-dev-automation-ids branch from 81d6a61 to be51dc5 Compare October 12, 2026 11:09
@kazo0
kazo0 merged commit e376671 into main Oct 12, 2026
3 of 4 checks passed
@kazo0
kazo0 deleted the dev/steve/uno-dev-automation-ids branch October 12, 2026 11:19
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