Skip to content

Add table_pattern: table headers + cell addressing for native grids#417

Merged
JE-Chen merged 1 commit into
devfrom
feat/table-pattern-batch
Jun 24, 2026
Merged

Add table_pattern: table headers + cell addressing for native grids#417
JE-Chen merged 1 commit into
devfrom
feat/table-pattern-batch

Conversation

@JE-Chen

@JE-Chen JE-Chen commented Jun 24, 2026

Copy link
Copy Markdown
Member

Why

read_control_table (GridPattern) dumps a flat 2-D list of cell names with no header labels and no way to address a single cell by (header, row) — so you can dump a grid but not actually test one. table_pattern adds the missing half:

  • table_headers — the row / column header labels (TablePattern)
  • table_cell — the cell at (row, column) with its span (GridPattern.GetItem + GridItemPattern)
  • cell_by_header — read the cell at (row, "Column Header"), so you can assert "the Status column of row 5 says Shipped" without guessing indices

Third feature of the ROUND-15 native-UIA depth lane.

Design

  • Extends the accessibility backend ABC (base.py _unsupported defaults) + real reads in windows_backend.py (TablePattern=10012 GetCurrentRow/ColumnHeaders; GridPattern=10006 GetItem enriched by GridItemPattern=10007 row/col/span), with module-level _header_names / _read_cell helpers to keep every method under CC 10 (radon-clean). cell_by_header is pure facade logic composing table_headers + table_cell.
  • 5 layers wired: core → facade __all__AC_table_headers / AC_table_cell / AC_cell_by_header → read-only ac_* MCP tools → Script Builder (Native UI). Qt-free verified.

Tests

test/unit_test/headless/test_table_pattern_batch.py — fake backend covers headers, cell-by-index (+ not found), cell_by_header resolving the column (+ unknown column + no-headers → None), the unsupported-backend error, the executor adapters, and 5-layer wiring. 24 passed with the ax_props / virtualized siblings. Real UIA not run in CI.

read_control_table dumps a flat 2D list of cell names with no header
labels and no way to address one cell by (header, row). Add the missing
half: table_headers reads row/column header labels (TablePattern),
table_cell reads the cell at (row, column) with its span (GridItemPattern),
and cell_by_header resolves the column index from the headers so you can
read the cell at (row, named column). Extends the backend ABC + Windows
UIA backend via the same fake-backend seam.
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 51 complexity · 0 duplication

Metric Results
Complexity 51
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@JE-Chen JE-Chen merged commit 94eb8c6 into dev Jun 24, 2026
16 checks passed
@JE-Chen JE-Chen deleted the feat/table-pattern-batch branch June 24, 2026 19:00
@sonarqubecloud

Copy link
Copy Markdown

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.

1 participant