Skip to content

fix(record): preserve form button clicks - #602

Open
tlysanhuo wants to merge 1 commit into
Tencent:mainfrom
tlysanhuo:fix/record-input-buttons
Open

tlysanhuo wants to merge 1 commit into
Tencent:mainfrom
tlysanhuo:fix/record-input-buttons

Conversation

@tlysanhuo

Copy link
Copy Markdown

Recording a form submission or reset could omit the click entirely: input submit/reset/image controls entered the text-fill path, and buttons beside search fields could be swallowed by the search-decoration heuristic. Keep those controls on the click path and use reset inputs’ visible values as their recorded names.

Fixes #593.

The regression cases cover filling then clicking submit/reset/image buttons, ordinary input buttons and nested button content, with and without a search field. They assert trusted browser clicks, actual submit/reset events, the fill-before-click order and the reset field value. Search decoration still produces no extra click. Includes opt-in browser regressions and paired English/Chinese changelog entries.

Validation on Node.js 22.23.4 / Chrome for Testing 157.0.8103.38 (Linux):

  • The 16 new regressions on unchanged main: 13 failed, 3 passed. With this fix: all 16 passed, including 10 real-Chrome cases.
  • Full default extension suite: 3,701 passed, 428 opt-in tests skipped; the new browser suite was run separately.
  • Existing recording/descriptor tests plus new unit cases: 54 passed.
  • Extension TypeScript check, production build and pnpm lint passed. The lint command includes DSH checks: 713 tests passed, 10 skipped; upstream dependency source-map warnings were non-fatal.
  • Changelog synchronization and git diff --check passed.

Browser tests bundle and run the production capture module using native CDP input in an isolated browser/profile. This is not a full installed-extension/daemon/CLI end-to-end run. Rust tests were not run because no Rust code changed.

Implemented and tested with Codex assistance; no independent human review is claimed.

Run the browser regressions with:

BSK_CLICK_CHROME=/path/to/chrome pnpm --filter @browser-skill/extension exec vitest run src/content/__tests__/record-input-buttons.browser.test.ts

The browser regressions are opt-in and were run locally; this PR does not change CI workflows.

@tlysanhuo
tlysanhuo marked this pull request as ready for review November 5, 2026 09:18

This branch has not been deployed

No deployments
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.

录制遗漏 input[type=submit] 和 input[type=reset] 的真实点击

1 participant