Skip to content

DataGrid cells lost from UIA tree after async commit triggers row state transition #34

Closed

Description

Summary

The E2E test Interactive_DataGrid_ClickEditTabCommit in tests/Reactor.AppTests/Tests/DataGridTests.cs fails on main: after an edit commit lands via the new UseMutation path, cells in rows that underwent state transitions disappear from the UIA tree entirely, and the outer DataGrid's AutomationId (EditableGrid) also becomes unfindable.

This is a pre-existing issue on main (reproduced identically there) — not a regression from any open feature branch.

Reproduction

  1. Run dotnet test tests/Reactor.AppTests --filter "FullyQualifiedName~Interactive_DataGrid_ClickEditTabCommit" on main.
  2. The test fails at line 57 with Assert.IsNotNull failed. 'Smith' should be visible.

Diagnostic snapshot at failure

Added a temporary diagnostic dump right before the assertion. The commit succeeded (EditStatus shows Last edit: 1:Alicia,Smith), but the UIA tree state after WaitForName("Smith") times out is:

EditStatus text: Last edit: 1:Alicia,Smith     ← commit reached state
EditableGrid NOT FOUND                          ← outer AutomationId gone
TextBlock count: 20
TextBlock texts:
  [Loaded: DataGrid_EditableGrid] [Last edit: 1:Alicia,Smith] [3 items]
  [Id] [⯆] [First Name] [⯆] [Last Name] [⯆] [Salary] [⯆]
  [1] [Alicia] [Smith]               ← row 0: missing Salary cell
  [2] [Jones]                        ← row 1: FirstName in TextBox editor, missing Salary
  [3] [Carol] [Lee] [$91,000]        ← row 2: all 4 cells present
TextBox count: 1, values: [Bob]

The text "Smith" and "Jones" exist in TextBlocks, but their AutomationProperties.Name isn't set — FindByName("Smith") cannot match. Alicia, Carol, Lee are findable by Name. Row 2 (untouched by the edit/commit sequence) renders all 4 cells correctly; rows 0 (committing) and 1 (begin-editing) both lose their trailing Salary cell.

Suspected root cause

Introduced in 49e1fe4 — feat(async): route DataGrid row-commit through UseMutation. The UseMutation.OnOptimistic/OnSuccess callbacks drive state.BeginAsyncCommit / state.CompleteAsyncCommit which fire StateChanged and trigger re-renders of rows that are simultaneously transitioning state (committing vs. newly editing). The DataGridComponent + VirtualList + ChildReconciler interaction appears to drop trailing cells and clear AutomationProperties.Name/AutomationId during those re-renders.

The Reactor DataGrid's correctness at the component level is verified by 423 passing selfhost fixtures (including DataGrid_Edit_*), so this is specifically a UIA-level tree visibility bug exposed only by cross-process Appium queries after an async mutation round-trip — the selfhost tests exercise the reconciler but don't assert against AutomationProperties.Name across the cross-process UIA pipeline.

Suggested investigation path

  1. Add a selfhost fixture that commits an edit via the UseMutation path and then walks the real VisualTreeHelper tree, asserting AutomationProperties.Name / AutomationId on every cell and on the outer DataGrid. That should reproduce the failure without WinAppDriver.
  2. Suspect areas:
    • Reconciler.Update.UpdateDefaultAutomationName — the "author override" heuristic may be clearing names after ElementPool.CleanElement on recycled TextBlocks.
    • ChildReconciler handling of rows whose cell count stays constant but whose cell types flip (e.g. TextBlock → TextField → TextBlock across a commit).
    • The Grid cell array construction in DataGridComponent.RenderRow when state.IsCommitting(rowKey) wraps the row in Opacity(0.6).
  3. Use the new devtools MCP (mur devtools) to drive the host app and snapshot the live UIA tree at each state transition.

Workaround for CI

Quarantine the test with [Ignore("See #<this-issue> — DataGrid cells lost from UIA tree after async commit")] until fixed.

Test code

tests/Reactor.AppTests/Tests/DataGridTests.cs:57

Related commit

49e1fe4 feat(async): route DataGrid row-commit through UseMutation

Activity

  1. added 2 commits that reference this issue on Apr 19, 2026
    e86ff69
    0352061
  2. added a commit that references this issue on Apr 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions