Integrate upstream concepts: cmd/ctrl multi-select, data-* paths, draw polish, event cap, iframe selection#5
Merged
Conversation
The cmd/ctrl multi-select (benjitaylor#179) relies on click events, but macOS fires a contextmenu event for Ctrl+Click. Prevent its default while the primary modifier is held so the OS menu doesn't pop mid-selection. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
getElementPath() now appends a stable data-* locator (data-testid, data-test, data-cy, data-qa, data-component, then the first meaningful non-framework data-* attribute) to each segment, giving agents more robust selectors. Framework-internal attrs (data-reactid, data-v-*, etc.) are filtered out. Reimplements the concept from benjitaylor#177 by @panrafal. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Escape in draw mode now closes an open annotation/edit popup while staying in draw mode (previously it exited draw mode entirely). The draw canvas also shows a pencil cursor, switching to a pointer when hovering a stroke. Drops the stale circle-detection tweak from the upstream PR (the stroke classifier was rewritten since). Reimplements the remaining concepts from benjitaylor#114 by @stevysmith. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The memory store's events array grew without limit in long-running processes. addEvent() now trims the oldest events once the array exceeds a fixed cap, keeping recent events (which getEventsSince consumes) intact. Reimplements the concept from benjitaylor#98 by @bianbiandashen, without the recursive addEvent() bug, the periodic timer, or the extra environment-variable knobs in the original. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
deepElementFromPoint, the drag-select element scan, and the marker re-resolve path now traverse same-origin iframes (recursively, including nesting), converting child-frame rects to top-level viewport coordinates. Cross-origin frames are detected and skipped. Adds tests for the iframe helpers; existing component/type tests are kept intact. Fixes a cross-realm bug in the original (elements inside an iframe failed `instanceof HTMLElement` against the top realm and were silently dropped) via a realm-aware isHTMLElement check. Reimplements the concept from benjitaylor#81 by @liuxiaopai-ai (addresses issue benjitaylor#71), without deleting the existing test suite. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR integrates the worthwhile concepts from five upstream PRs against
benjitaylor/agentation. Per the project values (bundle size, surgical changes, no test deletion), most were reimplemented cleanly rather than cherry-picked, since the upstream code carried style churn, bugs, or test deletions. Each commit credits the original author.Items handled
click; macOS firescontextmenufor Ctrl+Click. Added a capture-phasecontextmenupreventDefault while the primary modifier is held. Cmd/Ctrl+Click new-tab navigation is already blocked by the existing capture-phase clickpreventDefault.data-*attributes in element pathgetElementPath()appends a stabledata-*locator (data-testid/data-test/data-cy/data-qa/data-component, else first meaningfuldata-*), filtering framework-internal attrs (data-reactid,data-v-*, etc.).addEvent()called itself recursively (stack overflow). Reimplemented minimally: push then trim the events array to a fixed cap. Dropped the periodic timer and the three new env-var knobs.deepElementFromPoint, the drag-select scan, and the marker re-resolve path (recursive, nested frames, cross-origin skipped, child rects mapped to viewport coords). Kept all existing tests and added new ones. Also fixed a cross-realm bug present in the original — iframe elements failedinstanceof HTMLElementagainst the top realm and were silently dropped; added a realm-awareisHTMLElementcheck.Build / test
pnpm build(package, via tsup): successpnpm --filter agentation test: 100 passed (existing suite preserved; added 5 iframe-helper tests + 5 data-attr path tests)tsc --noEmit: cleanRebased onto current
main.🤖 Generated with Claude Code