Repository navigation
fix(automation): Default AutomationProperties strings to empty - #26233
Conversation
|
Claude finished @morning4coffe-dev's task in 22s —— View job Review summaryVerdict: ship. No blocking issues. Issues: 0 high, 0 medium, 1 low (inline nit on test coverage). Code review assessment (by inspection only, nothing built or run):
Cross-cutting notes:
|
| Assert.AreEqual(string.Empty, peer.GetItemStatus(), "ItemStatus"); | ||
| Assert.AreEqual(string.Empty, peer.GetItemType(), "ItemType"); | ||
| Assert.AreEqual(string.Empty, peer.GetLocalizedLandmarkType(), "LocalizedLandmarkType"); | ||
| } |
There was a problem hiding this comment.
Nit (low): the tests only cover the unset state. Since the point is WinUI parity, consider adding one case that sets a value and then ClearValues it (or sets null explicitly) and asserts the resulting getter value. That would show the default is restored as "" and would pin down what an explicit null returns. LocalizedControlType is also absent from the peer test, probably because the peer falls back to the control-type string, but a one-line comment saying so would help the next reader.
There was a problem hiding this comment.
Added When_String_Properties_Are_Cleared_Then_Empty_String_Is_Returned (6f163a0). It sets and then clears all eight properties with ClearValue.
I left out an explicit SetValue(null) case on purpose. WinUI turns a null HSTRING into "", while Uno stores null there, and that's a separate parity gap from the default this PR fixes. I also added the comment about LocalizedControlType falling back to the control type name.
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
Claude finished @morning4coffe-dev's task in 12s —— View job Review summaryVerdict: ship. No blocking issues. Issues: 0 high, 0 medium, 0 low. Code review (by inspection only, nothing built or run):
Cross-cutting notes:
|
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 244694 found UI Test snapshots differences: Details
|
6f163a0 to
8433629
Compare
|
Claude finished @morning4coffe-dev's task in 11s —— View job Review summaryVerdict: ship. No blocking issues. Issues: 0 high, 0 medium, 0 low. Code review (by inspection only; nothing built or run):
Cross-cutting notes:
|
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 244947 found UI Test snapshots differences: Details
|
GitHub Issue: closes #25260
PR Type:
🐞 Bugfix
What changed? 🚀
Eight string attached properties on
AutomationPropertieswere registered with anulldefault:AcceleratorKey,AccessKey,FullDescription,HelpText,ItemStatus,ItemType,LocalizedControlTypeandLocalizedLandmarkType. On WinUI an unset string property reads as an empty string (they're declared asStringwith no default inStaticMetadata.g.cpp, and the getters inAutomationProperties.cppjust return the stored value), soAutomationProperties.GetHelpText(element)gave""there andnullhere.They now default to
string.Empty.I went through every consumer of these properties: the peers,
AriaMapper, the WASM semantic DOM, the Win32 / macOS / iOS / Android bridges,AccessKeyStringBuilderandCommandingHelpers. They all already useIsNullOrEmptyor?? "", so nothing in Uno behaves differently except the returned value.Behavior change: app code that compares these getters to
nullwill now see"", the same as on WinUI.Tests:
Given_AutomationPropertiesDefaultschecks both the attached property getters and the values a default peer returns.PR Checklist ✅
Screenshots Compare Test Runresults.🤖 Generated with Claude Code