fix(macos): support title-based element lookup - #107
Merged
Merged
Conversation
ZhengdaWang (zhengdawang443)
requested review from
mijun (houlianpi) and
tongyu70020
as code owners
September 20, 2026 09:06
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
Fix macOS Appium Mac2 element discovery for controls whose accessible text is exposed only through the
titleattribute, such as native context-menu items.Snapshots, structured queries, explicit locators, semantic targets, and ambiguity diagnostics now preserve and match
title.Related issue
No issue linked. This fixes a verified macOS element-location failure and updates the public locator contract.
Design document
No separate design document. This change was implemented through a confirmed direct
/spec-drivenrequest and SPEC delta.SPEC updates
Updated and confirmed before implementation:
SPEC.mdfsq_agent/core/SPEC.mdfsq_agent/models/SPEC.mdThe updated contracts define
titleas a supported macOS snapshot, query, and locator signal.Changes
titleto the publicMacOSLocatormodel.titlein compact macOS snapshots.titlein structured element queries while retaining the complete value in generated locators.titlein semantictargetmatching.@titlelocator constraints.titlein ambiguity candidate summaries.Verification
.venv/bin/python -m pytest tests/test_macos_elements.py tests/test_macos_harness.py tests/test_models.py -q.venv/bin/python -m pytest -q.venv/bin/ruff check fsq_agent/models/_core.py fsq_agent/drivers/macos/_elements.py fsq_agent/drivers/macos/_appium_mac2.py tests/test_macos_elements.py.venv/bin/ruff format --check fsq_agent/models/_core.py fsq_agent/drivers/macos/_elements.py fsq_agent/drivers/macos/_appium_mac2.py tests/test_macos_elements.pyEvidence
Live Appium Mac2 page source confirmed that native menu item text is exposed through
title, includingSave Link As…andSave Page As…. A title XPath query returned both matching elements.No screenshots or generated artifacts are included.
Release or documentation impact
The public macOS locator schema now accepts
title. No README, packaging, setup, or release workflow changes are required.Checklist
Spec-driven development
SPEC.mdand every relevant moduleSPEC.md.Quality and safety
.envfiles, generated logs, reports, screenshots, or workspace output.