Commit Graph

18 Commits

Author SHA1 Message Date
Asen's Agent 4f1caa788d rename: multi-click → batch-click
Rename the command from "browser multi-click" to "browser batch-click"
per @AsenL's request. Updated across all files: implementation, action
enum, CLI wiring, router, output formatting, and all tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-03 14:05:54 +08:00
Asen's Agent eb3830d32e test: add multi-click e2e coverage 2026-04-03 09:33:50 +08:00
Asen's Agent 948698bfe3 test: add E2E tests for browser multi-click command
- multi_click_sequential_json: verifies 3 buttons clicked in order
  with correct response shape (total, clicked, results array,
  changed.url_changed + focus_changed, context, meta)
- multi_click_partial_failure_json: verifies MULTI_CLICK_PARTIAL
  error with successful-prefix results and failed_at details when
  second selector doesn't exist

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-03 09:31:05 +08:00
mcfn.feng 6a2b6010fd [packages/cli]fix: increase Chrome startup timeout to 30s and relax snapshot assertion
- Increase DevTools URL discovery timeout from 15s to 30s for CI environments
- Relax snap_selector_flag_limits_subtree assertion to allow ±2 node tolerance
- Increase E2E test workflow timeout to 20 minutes
2026-04-02 23:01:55 +08:00
mcfn.feng c2a2a43de5 [packages/cli]fix: select fixture uses DOM APIs to avoid TrustedHTML error
Chrome 146+ may enforce Trusted Types on certain pages, causing
innerHTML assignments to fail. Replace innerHTML with createElement
+ appendChild in install_select_fixture.
2026-04-02 18:13:32 +08:00
mcfn.feng 5cee89cde8 [packages/cli]fix: type/press key events not reaching correct tab + contenteditable fix
Three issues fixed:

1. Input.dispatchKeyEvent routes to Chrome's active tab, ignoring sessionId.
   - type: add Target.activateTarget before key dispatch loop
   - press: add Target.activateTarget before key dispatch

2. type command used minimal key definitions (just key+text) which didn't
   trigger native text insertion on contenteditable elements.
   - Reuse key_definition() from press module for full CDP key definitions
     (code, windowsVirtualKeyCode, nativeVirtualKeyCode, unmodifiedText)

3. Contenteditable e2e test fixture had element at top:500px, whose center
   (y=531) exceeded headless viewport height (513), causing click to miss.
   - Changed to top:200px

Closes ACT-822
2026-04-02 18:02:23 +08:00
Junliang Feng ead3cbe740 fix(cli): support contenteditable elements in type/fill/focus (#461) 2026-04-02 17:44:26 +08:00
AlexZ a2024fbcb1 [packages/cli]chore: fix formatting in contenteditable test
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 17:41:29 +08:00
AlexZ 7ab8a7c576 [packages/cli]fix: support contenteditable elements in type/fill/focus commands
CDP DOM.focus fails on contenteditable divs (e.g., Lark/Notion/Slate editors)
with "Element is not focusable" (-32000). This change adds a JS .focus()
fallback and click-to-place-cursor for rich text editors.

Changes:
- Add TabContext::focus_element() with JS .focus() fallback when DOM.focus fails
- type command: detect contenteditable and click element center to establish
  cursor position (required by Slate/ProseMirror internal cursor management)
- fill/focus commands: use focus_element() instead of raw DOM.focus
- Add E2E tests for type and focus on contenteditable elements

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 17:39:34 +08:00
Junliang Feng 7cbff7fc00 [codex] cli: keep setup and switch its browser modes to local/cloud (#455) 2026-04-02 16:50:47 +08:00
mcfn.feng 192905515f cli: restore setup command entrypoint 2026-04-02 16:30:26 +08:00
mcfn.feng 0758c9ef62 [packages/cli]feat: add --session get-or-create and --tab alias for browser commands
browser start --session sid: get-or-create semantics — reuses existing
session if found, creates with that ID if not. Works for both local and
cloud modes. Conflicts with --set-session-id (which always force-creates).

browser new-tab --tab tid: visible alias for --set-tab-id — creates tab
with custom ID, returns TAB_ID_CONFLICT on duplicate.
2026-04-02 16:21:56 +08:00
mcfn.feng d358a27ed0 cli: remove setup command and mark it coming soon 2026-04-02 16:17:34 +08:00
mcfn.feng 8af064f04b cli: switch setup browser modes to local/cloud 2026-04-02 16:13:22 +08:00
mcfn.feng 969ef0e038 cli: rename setup isolated mode to local 2026-04-02 16:00:22 +08:00
Junliang Feng d2f9ab93e0 fix: send mouseMoved before mousePressed in dispatch_click (#220)
* [packages/cli]fix: send mouseMoved before mousePressed in dispatch_click (#220)

SPA frameworks (React Router, Vue Router, Next.js) require a prior
mouseMoved event to establish pointer hover state before the click
event synthesizes correctly. Without it, the router's click listener
never fires and the URL remains unchanged (url_changed: false).

Add a single mouseMoved dispatch at (x, y) with button=none before
the existing mousePressed/mouseReleased loop — matches Playwright's
standard click implementation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* [packages/cli]test: fix click_spa_navigation — use hash for pushState in about:blank (#220)

history.pushState with a path-only URL (/spa-destination) throws a
SecurityError in about:blank (null origin). Use a hash fragment
(#spa-destination) instead, which is always allowed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 13:15:06 +08:00
Junliang Feng 66e74cb139 test: add click_spa_navigation E2E test (#220)
[packages/cli]test: add click_spa_navigation E2E test (#220)

Injects a SPA-style fixture (history.pushState on click with
preventDefault) into about:blank and verifies that browser click
triggers the router handler and returns url_changed=true.

Tests the mouseMoved fix — will fail until dispatch_click sends
mouseMoved before mousePressed in click.rs.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 13:08:40 +08:00
mcfn.feng 58545129de [root]refactor: remove actionbook-rs, promote cli-v2 to packages/cli
- Delete packages/actionbook-rs/ (legacy 0.x CLI)
- Delete old packages/cli/ (JS npm wrapper for 0.x)
- Rename packages/cli-v2/ → packages/cli/ (git mv)
- Merge npm wrapper files (bin/actionbook.js, scripts/postinstall.js) into new cli/
- Update package.json: name → @actionbookdev/cli, private → false, add npm distribution fields
- Update sync-versions.js: point Cargo.toml/Cargo.lock sync at packages/cli/
- Update release.yml: build from packages/cli/ instead of packages/actionbook-rs/
- Update test.yml: paths and working-directory from cli-v2 → cli
- Update CLAUDE.md, CONTRIBUTING.md, docs, issue templates
- Delete stale changeset (fix-screenshot-timeout.md)
- Keep 6 platform binary packages unchanged
2026-04-02 00:46:12 +08:00