Skip to content

Tighten text-click with ambiguity detection and auto-fallback - #5

Merged
esokullu merged 3 commits into
mainfrom
codex/investigate-keypress-control-options
Apr 11, 2026
Merged

esokullu merged 3 commits into
mainfrom
codex/investigate-keypress-control-options

Conversation

@esokullu

@esokullu esokullu commented Apr 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Ambiguity detection: click({text: "Save"}) now returns an error with candidate list when multiple elements match, instead of silently clicking the first one
  • Auto-fallback matching: Default behavior cascades exact → prefix → contains (with ambiguity check at each level), so buttons like "Create subscription →" still work without needing explicit textMatch: "contains"
  • textMatch parameter: New optional param (exact, prefix, contains) for explicit control when needed
  • Selector alignment: Added label to text-click selector lists to match INTERACTIVE_SELECTORS (fixes inconsistency where get_interactive_elements showed labels as clickable but click({text}) couldn't find them)
  • System prompt updated: CLICKING section in both Chrome and Firefox explains new behavior
  • Version bump: 1.6.8 → 1.7.0 across all manifests/settings

Test plan

  • npm test — all 31 tests pass
  • No merge conflict markers remain
  • Manual: load page with duplicate button labels → text-click returns ambiguity error with candidates
  • Manual: unique button text → text-click works as before
  • Manual: button with trailing icon/arrow text → auto-fallback finds it via prefix/contains

🤖 Generated with Claude Code

@vercel

vercel Bot commented Apr 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
webbrain Ready Ready Preview, Comment Apr 11, 2026 0:45am

…etection, align selector lists

- Resolve merge conflicts in manifest.json and firefox settings.html (keep v1.7.0)
- Change text-click default from strict exact-only to exact→prefix→contains cascade,
  with ambiguity error (>1 match) enforced at each level
- Update CLICKING system prompt in both Chrome and Firefox to document new behavior
- Add `label` to clickable selector lists to match INTERACTIVE_SELECTORS

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@esokullu esokullu changed the title Add press_keys tool, refine text-based click matching, and bump version to v1.7.0 Tighten text-click with ambiguity detection and auto-fallback Apr 11, 2026
@esokullu
esokullu merged commit 1d88473 into main Apr 11, 2026
2 checks passed
@esokullu
esokullu deleted the codex/investigate-keypress-control-options branch April 11, 2026 00:47
esokullu added a commit that referenced this pull request Jun 22, 2026
feat: autocomplete slash commands
esokullu added a commit that referenced this pull request Jun 23, 2026
- drainQueuedContextMenuPrompts: replace shift()+continue with
  findIndex+splice so prompts for non-active tabs stay in the queue
  instead of being permanently discarded (finding #1)
- tabs.onRemoved / webNavigation.onCommitted: route cleanup through
  getContextMenuPromptStore() so local-storage fallback is cleared too;
  add navigation listener to invalidate stale prompts on page change
  (findings #2, #3)
- runContextMenuPrompt: move clear_context_menu_prompt dispatch to after
  sendMessage() so storage isn't wiped before text is captured (finding #4)
- Extract context-menu-storage.js and context-menu-prompts.js as shared
  factory modules (identical in Chrome/Firefox); remove ~160 lines of
  duplicated code from background.js and sidepanel.js (findings #5, #6)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This was referenced Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant