Repository navigation
fix(analyzers): don't flag string-typed Button labels in REACTOR_A11Y_001 - #1427
Merged
Alexandre Zollinger Chohfi (azchohfi) merged 3 commits intoOct 27, 2026
Conversation
…_001
Button(S("Usage_Refresh"), onClick) and other non-literal string labels
(resource lookups, variables, interpolated strings) are text buttons whose
content provides the accessible name. IconButtonAccessibilityAnalyzer now
skips a first argument whose semantic type is System.String; element/icon
content still reports.
Co-authored-by: Copilot App <[email protected]>
Also skip labels whose ConvertedType is string (a label type with an implicit conversion to string binds to the Button(string, ...) overload), add a test modelling the real Button(string)/Button(Element) overload set, regenerate the analyzer-architecture snippet, and note in the CHANGELOG that glyph/emoji strings stay with the runtime AccessibilityScanner. Co-authored-by: Copilot App <[email protected]>
Barbara Kudiess (bkudiess)
marked this pull request as ready for review
October 27, 2026 16:01
Barbara Kudiess (bkudiess)
requested a review
from Chris Anderson (codemonkeychris)
as a code owner
October 27, 2026 16:01
9 of 16 tasks
Alexandre Zollinger Chohfi (azchohfi)
requested a balanced review from Copilot
October 27, 2026 21:17
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the analyzer’s string-label detection change.
No open issues 🎉
What changed in this PR
This PR reduces false positives in Reactor’s REACTOR_A11Y_001 accessibility analyzer by recognizing non-literal string labels as text-button content.
Changes:
- Uses semantic type information to recognize string labels and expressions converted to
string, while retaining diagnostics for element/icon content. - Adds regression tests for localized labels, string variables, implicit conversions, and overload selection.
- Updates the analyzer guide and changelog to describe the behavior.
| File | Description |
|---|---|
| tests/Reactor.Tests/AnalyzerTests/AccessibilityAnalyzerTests.cs | Adds text-label and element-content regression tests. |
| src/Reactor.Analyzers/AccessibilityAnalyzers.cs | Adds semantic string-type checks before reporting diagnostics. |
| docs/guide/analyzer-architecture.md | Updates the generated snippet and explanation. |
| docs/_pipeline/templates/analyzer-architecture.md.dt | Documents semantic label detection in the guide source. |
| CHANGELOG.md | Records the accessibility analyzer fix and glyph-string limitation. |
Review effort: Balanced
Alexandre Zollinger Chohfi (azchohfi)
approved these changes
Oct 27, 2026
Co-authored-by: Copilot App <[email protected]>
Alexandre Zollinger Chohfi (azchohfi)
merged commit Oct 27, 2026
f92623b
into
microsoft:main
29 checks passed
Barbara Kudiess (bkudiess)
added a commit
to openclaw/openclaw-windows-node
that referenced
this pull request
Nov 10, 2026
…rts and filters (#1895) * feat(usage): rebuild the Usage page with the web page's sessions, charts and filters Replace the classic XAML Usage page with a Reactor page that gives Windows users the same usage information as the web Control UI: reporting range with presets, time zone and scope, totals, daily token and cost charts, started-by attribution, overview stats and top lists, cost windows, heatmap, activity by time, a sessions list with per-session details, provider plans, and CSV/JSON export. Gateway JSON is parsed in OpenClaw.Shared (sessions.usage, .timeseries, .logs, usage.status, usage.cost) and projected by WinUI-free presentation code with unit tests. Released Gateways that reject the newer sessions.usage overview parameters get a basic view; Gateways without sessions.usage fall back to usage.cost totals. Depends on Reactor analyzer fixes microsoft/microsoft-ui-reactor#1427 and microsoft/microsoft-ui-reactor#1428; with stock 0.1.0-preview.12 the build reports 7 REACTOR_DSL_001/REACTOR_A11Y_001 false positives. Co-authored-by: Copilot App <[email protected]> * fix(usage): keep chart marks visible in high contrast Use the existing Usage data palette for marks and selection indicators instead of the native button fill, which can equal the plot background in high contrast. Cover clickable and nonclickable native charts with contrasting theme inputs. Co-authored-by: Copilot App <[email protected]> * fix(usage): preserve filtered and incomplete report states Keep filtered details scoped to matching usage, preserve model lower bounds, clear unsupported legacy selection and show legacy refresh failures. Pair high-contrast weekday text and fill, and strengthen callback and production-theme regression coverage. Co-authored-by: Copilot App <[email protected]> * feat(usage): compact native Usage page on official Reactor preview.17 Replace the classic XAML Usage page with a compact Reactor page backed by read-only Gateway reads. - Cost, token and session totals; Today, 7-day, 30-day and custom ranges with a visible reporting zone; a daily trend with an accessible table; agent, model and provider contributors; capability-gated session browsing; lightweight detail; native conversation access; a web Usage handoff and a secondary CSV export. - Provider allowance stays distinct from session-derived estimates. Partial, stale, failed, unsupported, forbidden and disconnected states are explicit. - Released Gateways that reject the server overview parameters get a bounded basic view (at most 1000 rows). Older Gateways report Unsupported. - Compact header: short custom-range label and inline date pickers on wide hosts, using the shared PageResponsiveLayout helper. - Adopt official Reactor 0.1.0-preview.17 with a hash-verified, repository-local package bootstrap wired into build, CI, CodeQL and Store packaging. - Update the six locales, DESIGN.md palette resources, the architecture ledger and the fixture documentation. Known open items: the mounted UsagePageRenderingTests 937.14 DIP compact transition case still fails, and cached Usage state is not yet reset when the operator Gateway client changes. Co-authored-by: Copilot App <[email protected]> * fix(usage): reset Usage on Gateway switch and stabilize layout waits - Drop reports, plans, details and export state from the previous Gateway when the operator client is replaced; keep range, zone, scope, search, sort and metric. In-flight reads are cancelled and generation-fenced. - Read the operator client once per operation so a replacement between reads cannot split one load across two Gateways or send the previous Gateway's session key to the new one. - UI tests: wait on physical-pixel width for the 937.14 DIP transition and on model/topology convergence for the Custom range reflow. Co-authored-by: Copilot App <[email protected]> * fix(usage): preserve native analysis and shared inset geometry Keep reported-day charts, native expanders and shared provider reads. Integrate the authorized adaptive Settings and embedded inset/toggle ownership ports, and add pinned Usage hit, keyboard and feedback proof coverage. Current source-only shell/test additions remain unvalidated pending the exclusive native lane. Historical proof does not establish acceptance of this candidate. Co-authored-by: Copilot App <[email protected]> * fix(usage): refine native hero, facts and rendering diagnostics Keep compact usage facts responsive, localize the allowance warning, and add owned-window paired capture diagnostics. Native pixel proof remains pending. Co-authored-by: Copilot App <[email protected]> * fix(usage): simplify native controls and polish session layout Co-authored-by: Copilot App <[email protected]> * fix(usage): address analysis correctness and review regressions Preserve query provenance, disclose bounded selected-session details, keep pricing completeness separate from token counts, and coordinate provider refresh after authenticated binding. Bootstrap published Reactor packages before local builds while preserving NoBuild; adopt shared capped-field alignment and focused regressions. Validated source content in an isolated headless snapshot: full build passed; Shared 4909 passed with 25 permitted skips; unfiltered Tray 5557 passed; Debug ARM64 UI tests compiled with no warnings or errors; documentation and 20 offline bootstrap controls passed. Native/UI and Debug/non-Dev Release real-app proof remain blocked. The earlier failed run and retained safety lease are unchanged. No native readiness claim is made. Co-authored-by: Copilot App <[email protected]> * fix(usage): fence deferred exports and stale analysis warnings Check Gateway and page ownership after native file selection, withhold exact session shares for incomplete reports, and share expiry-aware provider attention. Preserve later reset notifications and retained-snapshot render invalidation. Add deferred-file, completeness, provider lifetime and rendered regressions. Repair deterministic Usage fixture coverage and native geometry proof boundaries without removing keyboard, hit-testing, inset or ink assertions. Retain the unassigned mounted testhost crash as a validation blocker. Validation: diff checks and static fixture reproduction passed. Independent source/proof-plan review completed; both follow-up test findings were corrected and independently checked. Windows build, .NET tests, negative controls and native proof remain unrun here because pwsh, dotnet and winapp are unavailable. Co-authored-by: bkudiess <[email protected]> * fix(usage): distinguish quota-window projection from WinUI types Rename only the private LINQ tuple member so the unchanged pure-presentation architecture guard does not mistake it for a WinUI Window. Filtering and ordering are byte-identical after normalizing that identifier. Validation: baseline/candidate token check and git diff --check passed. Full build, Shared/Tray and focused xUnit execution remain blocked locally by missing PowerShell and dotnet; fresh CI and native validation are required. Co-authored-by: bkudiess <[email protected]> * fix(usage): wait for committed warnings and unobstructed proof Keep the failure-detail assertion behind actual native warning layout rather than unchanged fallback text. Prepare each responsive capture through the known host-warning presentation control, retain its Inbox fact, and reject late or unknown notification obstruction without weakening ink or hit-test guards. Validation: diff checks and independent source/rubber-duck review completed, including corrections for capture-window ownership and asynchronous warning admission. Windows build and Shared/Tray tests remain unrun locally because pwsh and dotnet are unavailable. Preserve the original failed UI run, shared pane-toggle failure and whole-fixture timeout as outstanding validation work. Co-authored-by: bkudiess <[email protected]> * fix(usage): await measurable peers during responsive proof Treat temporarily missing UI Automation measurements as not ready while retaining consecutive stable widths, exact geometry, all five captures and foreground ink checks. Keep this repair based on the published head, separate from private native height diagnostics. Co-authored-by: bkudiess <[email protected]> * test(chat): await composer visibility commits around questions Observe the root visibility commit as well as the independently rendered question controls. Preserve native control identity, view-model draft and visibility assertions, and verify native draft text while hidden. Co-authored-by: bkudiess <[email protected]> * test(usage): verify native filter alignment rather than equal heights Respect content-sized native controls while checking row containment, desired-height allocation, wide center alignment and wrapped query separation. Preserve the six theme/width cases and native session action guards. Co-authored-by: bkudiess <[email protected]> * test(chat): retain bounded redirect probe diagnostics Record content-free monotonic phases and responder outcomes without changing the production request, security assertions or timeout budgets. Preserve primary failures and observe responder faults across cleanup races. This collects evidence, not a fix for the retained timeout. Co-authored-by: bkudiess <[email protected]> * fix(usage): retain query recovery and prove physical pane input Keep overview-capable search mounted while a new query loads or fails, without restoring stale figures. Cover retained native focus and recovery through a bounded committed-state wait. Replace the PR-added UIA point-leaf assumption with exact-center native mouse input and required pane transitions. Record the original UIA bridge result, require exact root HWND and foreground ownership, and reject a real test-owned opaque occluder. Preserve geometry and Tab assertions with no Invoke fallback. Full isolated build, Shared (5347 passed, 28 permitted skips), Tray (5797 passed), native compilation and docs/bootstrap checks passed on the repair candidate. Final Release query regression passed. Debug and Release pinned fixtures proved physical transitions and occluder rejection, then failed the retained Tab-to-content assertion; attribution remains inconclusive and that gate is not waived. Earlier failed attempts remain recorded. Co-authored-by: Copilot App <[email protected]> * refactor(usage): trim unrelated and unused page machinery Preserve the approved daily analysis, connection and generation fencing, capability fallback, query recovery, export safeguards and distinct native regressions. Remove unrelated chat/Inbox changes, unused count state and forwarding, web-only fixture analytics, orphan resources and duplicate cases. Validated exact tree aa2374d: full build; Shared 5347 passed with 28 permitted skips; unfiltered Tray 5828 passed; focused suites 175 and 246 passed; ARM64 UI compilation and docs/skills/bootstrap checks passed. Native runtime proof remains separate. Co-authored-by: Copilot App <[email protected]> * test(usage): follow native title-bar tab order in pinned proof Preserve physical hit and occlusion checks, then assert exact native title-bar stops before visible page focus. Verify Shift+Tab leaves content and Tab returns to the same control. The prior direct history-to-content assertion contradicted unchanged main XAML order. Validated final source with full build, Shared 5445 passed/28 permitted skips, unfiltered Tray 5993 passed, focused 177/246, UI/integration compilation and workflow/docs checks. The exact pinned fixture passed 1/1 across Light and Dark with 20 physical transitions, two occluder negatives and explicit forward/reverse focus receipts; owned kernel job drained before release. Co-authored-by: Copilot App <[email protected]> --------- Co-authored-by: Copilot App <[email protected]> Co-authored-by: roboclaw-bot <[email protected]> Co-authored-by: bkudiess <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
REACTOR_A11Y_001(IconButtonAccessibilityAnalyzer) treated everyButton(label, onClick)whose first argument was not a string literal as icon-only and demanded.AutomationName(...). Text buttons with a localized or computed label are false positives, because their text content already provides the accessible name:We found this in an app where all UI copy comes from
.reswresources, so every text button reported the warning.Fix: after the existing cheap syntactic filters (factory name, arity, literal check,
.AutomationNamechain walk), the analyzer asks the semantic model about the first argument. If its type, or the type it is converted to, isstring, the call binds toButton(string, ...)and is a text button, so the analyzer skips it. Element or icon content such asButton(icon, ...)orButton(TextBlock("🗑"), ...)still reports. The analyzer staysnetstandard2.0-safe.The guide's mirrored
a11y-rulesnippet (analyzer-architecture) has been regenerated, andCHANGELOG.mdhas a Fixed entry. The diagnostic id is unchanged, soAnalyzerReleasesdoesn't change.mur checkhas no A11Y_001 rule to keep in sync;CheckCommand.csonly maps the id to a help link.Linked issue / spec
Part of spec
docs/specs/006-accessibility-design.md§6.3 (Roslyn analyzer). No issue filed.Test plan
tests/Reactor.Tests/AnalyzerTests/AccessibilityAnalyzerTests.cs:Button(string)/Button(Element)overloads with an implicit-to-string label type: text cases produce no diagnostic and theElementcase reports.dotnet test tests/Reactor.Tests --no-build -p:Platform=x64 --filter-class "*AccessibilityAnalyzer*": passed, 9/9.dotnet test tests/Reactor.Tests --no-build -p:Platform=x64 --filter "FullyQualifiedName~AnalyzerTests": passed, 3190/3190.ConvertedTypecheck removed, the overload-set test fails. Both pass once the code is restored.dotnet build src/Reactor.Analyzers -c Release: 0 warnings, 0 errors.dotnet run --project tools/Reactor.DocPipeline -- compile --topic analyzer-architecture --skip-screenshots --skip-diagrams: succeeded. The guide diff is limited to the snippet and one prose sentence.dotnet run --project tools/Reactor.DocPipeline -- check-tier --topic analyzer-architecture: 0 errors, plus one pre-existing non-fatalREACTOR_DOC_TIER_W001warning.ee0a7142: 42/42 check runs completed. 40 succeeded, includingBuild solution(Release), Unit Tests, Selftests, Packaged and AOT selftests, E2E, Integration and Coverage. 2 were path-filtered skips (Audit ledger gate,Devtools trim mstat).dotnet build Reactor.slnx --no-restore -c Releaselocally. The CIBuild solutionjob covers it and passed.Risk / breaking changes
The analyzer now reports fewer warnings, never new ones, so projects with
WarningsAsErrorsfor A11Y_001 can only see fewer errors. There's no public API change. The semantic lookup runs only after the syntactic filters, so it adds little cost.Known limit: an icon-glyph or emoji label passed as a
stringconstant or variable, such asButton(Glyphs.Delete, f), is now skipped. Glyph string literals likeButton("✕", f)were already skipped. The runtimeAccessibilityScannerA11Y_001 check still flags empty, whitespace and emoji-like labels. Arguments named out of order (Button(onClick: f, label: x)) are still read positionally, as before this PR.