Add table_pattern: table headers + cell addressing for native grids#417
Merged
Conversation
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.
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 51 |
| Duplication | 0 |
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.
|
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.



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_patternadds 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 indicesThird feature of the ROUND-15 native-UIA depth lane.
Design
base.py_unsupporteddefaults) + real reads inwindows_backend.py(TablePattern=10012GetCurrentRow/ColumnHeaders; GridPattern=10006GetItemenriched by GridItemPattern=10007 row/col/span), with module-level_header_names/_read_cellhelpers to keep every method under CC 10 (radon-clean).cell_by_headeris pure facade logic composingtable_headers+table_cell.__all__→AC_table_headers/AC_table_cell/AC_cell_by_header→ read-onlyac_*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_headerresolving 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.