Donobu's AI operations can now be scoped to one region of a page instead of always judging the full viewport. page.ai.within(subject) takes a Playwright locator or a plain-language description, and any assert, extract, or locate chained off it only sees that region's screenshot and DOM subtree.
This closes a common false-green case: page.ai.assert('shows 3 items') could pass because some other widget on the page said "3 items," not the one you meant. It is built for repeated components: pick the row for one user, or one pricing card among several, and assert against just that scope. Scopes nest, and a scope handle can be stored and reused across multiple checks.
- Takes a Playwright locator or a natural-language description as the subject
assert,extract, andlocateall respect the scope, and scopes can nest- Closes the false-green case where a match elsewhere on the page caused a pass
- A covering overlay, like a modal or cookie banner, is measured and disclosed instead of silently ignored
- Unscoped calls are unchanged and still judge the full viewport