Skip to content

feat(interaction): add explicit focus and blur primitives - #126

Open
NianJiuZst wants to merge 1 commit into
Tencent:mainfrom
NianJiuZst:codex/focus-blur-primitive
Open

feat(interaction): add explicit focus and blur primitives#126
NianJiuZst wants to merge 1 commit into
Tencent:mainfrom
NianJiuZst:codex/focus-blur-primitive

Conversation

@NianJiuZst

Copy link
Copy Markdown
Contributor

Summary

  • add explicit bsk focus and bsk blur commands with ref/selector targeting
  • route both methods through the daemon and Agent Window sandbox, including OOPIF refs
  • verify the target's deep active-element state and return machine-readable focus results
  • add protocol schemas, CLI parsing, IPC coverage, extension tests, and skill documentation

Motivation

Focus was previously only an incidental part of fill, press, and select. Agents could not deliberately enter or leave focus-driven UI states without falling back to arbitrary JavaScript.

Validation

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets --locked -- -D warnings
  • cargo test --workspace --locked
  • pnpm lint
  • extension TypeScript compile
  • extension tests: 57 files / 690 tests
  • extension production build
  • node --test scripts/*.test.mjs

Real browser probe

Loaded this branch's unpacked extension into Chrome for Testing 152 with an isolated daemon/profile:

  1. bsk focus '#probe' returned focused: true; an independent page evaluation observed document.activeElement.id === "probe".
  2. bsk blur '#probe' returned was_focused: true, focused: false; an independent page evaluation observed that the target was no longer document.activeElement.

@NianJiuZst
NianJiuZst marked this pull request as ready for review August 21, 2026 14:47
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