Skip to content

fix(cu): bind Electron text to clicked element - #933

Closed
hqhq1025 wants to merge 1 commit into
apache:mainfrom
hqhq1025:codex/cu-electron-text-identity
Closed

fix(cu): bind Electron text to clicked element#933
hqhq1025 wants to merge 1 commit into
apache:mainfrom
hqhq1025:codex/cu-electron-text-identity

Conversation

@hqhq1025

Copy link
Copy Markdown
Contributor

Summary

  • assign a document-local token to the exact editable DOM element focused by a semantic Electron click
  • require the same connected, editable, active element before and after insert_text
  • fail closed before dispatch when the click result lacks element identity or the document/element was replaced
  • bound the page-side identity map to the latest focused element

This removes the old type-time elementFromPoint lookup, so same-page layout reflow cannot redirect text to a different field.

Verification

  • built @maka/core, @maka/storage, and @maka/runtime serially
  • npm --workspace @maka/computer-use test (128/128 passing)
  • git diff --check

@Astro-Han Astro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Two P1 issues remain in the Electron text-target binding:

  • P1: The normal new-document path calls __makaComputerUseReadElement before the page helper has been installed, so clicking an empty Electron field and typing can fail before insertion.
  • P1: The incrementing element token is not bound to a document fingerprint or session. Reloading the same URL can reuse a token for another field, allowing an old session’s text to be inserted into the wrong target and reported as verified.

Please install/read the helper through one consistent path and bind tokens to the document identity plus session, invalidating them on navigation or reload.

@hqhq1025

Copy link
Copy Markdown
Contributor Author

Superseded by #984, which consolidates #930-#933 into one target-identity boundary and addresses the requested changes. Stable AX token delivery is tracked in trycua/cua#2210.

@hqhq1025 hqhq1025 closed this Jul 14, 2026
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.

2 participants