Skip to content

Filter accessibility snapshots by role and accessible name - #86

Merged
wolfiesch merged 3 commits into
mainfrom
feat/snapshot-query
Oct 26, 2026
Merged

wolfiesch merged 3 commits into
mainfrom
feat/snapshot-query

Conversation

@wolfiesch

Copy link
Copy Markdown
Owner

Problem

Accessibility snapshots could only be scoped by frame, root ref, depth, and node count. Locating one control (for example a "More message options" button in a large mail UI) required reading the whole tree, and max_nodes truncated before the target was reached.

Change

browser_snapshot in accessibility mode accepts an optional query: { role?, name? }:

  • role: exact, case-insensitive AX role.
  • name: case-insensitive substring of the accessible name (not description or value).
  • Both must match when supplied. Filtering happens before max_nodes, composes with root_ref/frame_id, keeps actionable refs and frame IDs, and sets truncated when more matches exist. DOM editable fallbacks and the scripting outline are filtered the same way.
  • Other modes reject query.

Core RPC schema, host protocol types, MCP, OMP, Pi, the TypeScript SDK, README, and the MCP reference are updated together.

Verification

  • Extension, OMP, SDK, and MCP typecheck/tests; cargo test in host-rs; protocol schema fixtures.
  • Live Chrome: query: {role: "button"} returned only the page button; query: {name: "LEARN"} returned the "Learn more" link and its text nodes; query in text mode was rejected as invalid_request.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T07:08:41.201523Z c3cefd3 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c3cefd3536

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/extension/src/browser.ts Outdated
@wolfiesch
wolfiesch force-pushed the feat/snapshot-query branch from 1dba523 to 75b6720 Compare October 26, 2026 07:48
@wolfiesch
wolfiesch merged commit e3b0de1 into main Oct 26, 2026
9 checks passed
@wolfiesch
wolfiesch deleted the feat/snapshot-query branch October 26, 2026 07:51
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