Repository navigation
Conversation
A search box takes a query of a word or two, not prose to continue. In Microsoft Teams' search box (an AXComboBox, placeholder "Search (⌘ E)" / "Look for people, messages, files, and more.", DOM id ms-searchux-input) the model turned "san" into "dbox: https://sandbox.openai.com/", a URL in no part of its context, while the prompt framed the query as a chat message with the open conversation's history. SearchFieldDetector recognizes single-line search fields by the AXSearchField role or subrole, a search label (title, description, placeholder; whole words), or a DOM id with a word starting "search". It reuses the cached label reading the credential check already makes, now named fieldLabelReading. A browser's address bar is browser chrome (no DOM attributes) and stays supported. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XWP9XF2imh1ayEA62r6khb
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
| let isBrowserChrome = BrowserAppDetector.isBrowser(bundleIdentifier: bundleIdentifier) | ||
| && !candidate.vendsDOMAttributes | ||
| if SearchFieldDetector.mightBeSearchField(role: candidate.role, isBrowserChrome: isBrowserChrome) { |
There was a problem hiding this comment.
Firefox search boxes remain eligible
Firefox page fields lack the DOM attributes checked here, so isBrowserChrome becomes true even for page search boxes. The detector then exits before checking an explicit AXSearchField role or subrole. Cotabby can still offer prose completions in those boxes, and accepting one changes the query.
Distinguish page fields from the address bar before applying this exception, and add a Firefox-shaped test.
7hdmm9pp2w-code
left a comment
There was a problem hiding this comment.
The approach looks good and reuses the sign-in field label cache nicely. Two concerns:
- Address bars of browsers not on
BrowserAppDetector's list (Vivaldi, Opera, Dia —company.thebrowser.diadoesn't match the Arc prefix — Comet, Atlas) aren't exempt as browser chrome. Chromium labels the omnibox "Address and search bar", so it would match "search". Could you verify one of them? - The doc says a Firefox page's search box is recognized by role only. But
mightBeSearchFieldreturns false for all browser chrome, and every Firefox field counts as chrome (no DOM attributes), so nothing is recognized in Firefox.
Small one: "find" matches labels like "How did you find us?". Limiting the weaker keywords to placeholder or description text would be safer.
Context: I built main with #885, #882, #879, #883, #866 and #867 merged on top (no conflicts) and ran the full test suite the way tests.yml does. All tests touched by these PRs pass. The only two failures also fail on plain main (locale-dependent, see #891). These reviews are based on reading the code; I have not tested the UI by hand.
Summary
Leave search boxes to the app
A search box takes a query of a word or two, not prose to continue. In
Microsoft Teams' search box (an
AXComboBox, placeholder "Search (⌘ E)" /"Look for people, messages, files, and more.", DOM id
ms-searchux-input)the model turned "san" into "dbox: https://sandbox.openai.com/", a URL in no
part of its context, while the prompt framed the query as a chat message with
the open conversation's history.
SearchFieldDetectorrecognizes single-line search fields by theAXSearchFieldrole or subrole, a search label (title, description,placeholder; whole words), or a DOM id with a word starting "search". It
reuses the cached label reading the credential check already makes, now named
fieldLabelReading, so the check adds no extra Accessibility reads. Abrowser's address bar is browser chrome (no DOM attributes) and stays
supported.
Validation
main(8cdbea2); builds against main's own inference workspace.AXTextGeometryResolverTests.test_resolveCaretRect_returnsRealGeometry_forNativeTextFieldfails, as it does onmainon this machine.ScreenTextExtractorTests.test_extractText_blankNormalImageReturnsNoRecognizedTextfailed once with a VisionCRImageReaderErrorand passed on rerun; this change does not touch OCR.SearchFieldDetectorTestsandFocusSnapshotResolverLiveTestscover the Teams placeholder, search roles/subroles, DOM ids, ordinary fields such as "Research notes", multi-line fields, and the browser address bar.Risk / rollout notes
Fields that look like search boxes no longer get suggestions. The match is on
whole words in the label, so "Research notes" is not treated as a search field.
Summary by CodeRabbit
New Features
Bug Fixes
Correct the Firefox search-field exception before merging.
Summary
This PR leaves single-line search boxes to the host app.
Keeping browser address bars supported is explicitly intended by
senadaruc.Reviews (1) · Last reviewed commit: "Leave search boxes to the app" · Reviewed by Greptile