Skip to content

feat(relator): support multiple anchors, flip arg order to target-first - #61

Open
rickcedwhat-ai wants to merge 1 commit into
mainfrom
feat/relator-multi-anchor
Open

feat(relator): support multiple anchors, flip arg order to target-first#61
rickcedwhat-ai wants to merge 1 commit into
mainfrom
feat/relator-multi-anchor

Conversation

@rickcedwhat-ai

Copy link
Copy Markdown
Collaborator

Summary

  • anchor now accepts Locator | Locator[] — multiple anchors are chained via .filter({ has: a }) to find the nearest common ancestor of all anchors and the target
  • Arg order flipped to (target, anchor, container?) so the subject comes first
  • container retained for cases where the same anchor+target pair exists in multiple isolated contexts (e.g. dialog vs main page) with no unique distinguishing content anchor

Test plan

  • Verify single anchor still works (backwards-compatible call shape aside from arg flip)
  • Verify two anchors narrows to the correct element when neither alone is unique
  • Verify container still correctly pre-scopes when needed

🤖 Generated with Claude Code

- `anchor` now accepts `Locator | Locator[]` — multiple anchors are chained
  via `.filter({ has: a })` to find the nearest common ancestor of all
  anchors and the target
- arg order flipped to `(target, anchor, container?)` so the subject
  comes first, matching natural reading order

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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