You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GuiBackend._ROLE_MAP currently maps 29 AT-SPI role strings and falls back to Role.UNKNOWN for everything else. Several standard AT-SPI roles emitted by GTK3/GTK4, Qt, Electron/Chromium, and Firefox/Zen (switch, toggle button, spin button, heading, alert, progress bar, status bar, scroll pane, table, table row, tree table, document web, document frame) are missing.
Because Element.is_wrapper() treats unnamed Role.UNKNOWN nodes with only click/focus actions as layout wrappers, unlabeled switches or toggle buttons can be silently collapsed and omitted from tree() and snapshot.actionable(). Even named controls render as [unknown], breaking --role filtering in click-text. By contrast, the macOS (ax.py) and Windows (uia.py) backends already map switches, toggles, spinners/incrementors, headings, and tables to normalized Role values.
core/computer_use_linux/backends/ax.py:30-56 (_ROLE_MAP, _SUBROLE_MAP) and core/computer_use_linux/backends/uia.py:43-55 (_ROLE_MAP) for cross-platform role alignment
Acceptance Criteria
Map common AT-SPI roles in GuiBackend._ROLE_MAP consistently with ax.py and uia.py (e.g. switch / toggle button -> Role.CHECKBOX, spin button / progress bar -> Role.SLIDER, heading -> Role.TEXT, alert -> Role.DIALOG, table / tree table / table row -> Role.LIST / Role.TREE / Role.LIST_ITEM, scroll pane / document web / document frame / status bar -> Role.PANEL).
Verify unlabeled switch and toggle button controls are preserved by GuiBackend._keep(), Element.render(), and snapshot.actionable() rather than collapsed by Element.is_wrapper(), and that spin button values remain captured in light reads (_VOLATILE).
Add an offline unit test suite (mocking AT-SPI nodes without requiring a live bus) covering role normalization and wrapper preservation, and register it in .github/workflows/ci.yml.
Activity