chore(recorder): move signals from the action onto the action context#41755
Open
dgozman wants to merge 2 commits into
Open
chore(recorder): move signals from the action onto the action context#41755dgozman wants to merge 2 commits into
dgozman wants to merge 2 commits into
Conversation
JsonRecordActionTool recorded every click as it arrived, so a double click produced two actions that shouldMergeAction() had to collapse. Give it the same stalled-click handling RecordActionTool has, and drop the click branch of shouldMergeAction(). While stalling a click, a following click cancelled the pending one instead of committing it, silently swallowing the first click. Both tools now commit the pending click when a new single click arrives, and only cancel it when the click continues a multi-click, which 'dblclick' reports instead. Also remove ActionInContext.startTime/endTime and SignalInContext.timestamp. endTime and timestamp were never read; startTime had a single consumer, the navigation signal threshold, which now lives in RecorderSignalProcessor._lastActionTimestamp.
Signals (popup, download, dialog, expect) are not part of a recorded action, so drop `ActionBase.signals` and put `signals` on `ActionInContext` instead. Each `RecorderEvent.SignalAdded` consumer keeps its own `ActionInContext[]` and appends the signal to the matching entry, and codegen reads `actionInContext.signals`. Collapse where it is consumed: remove the batch `collapseActions()` / `shouldMergeAction()` helpers and instead replace-or-push the last action inline in each client (RecorderApp, DebugController, recorder-api). `ProgrammaticRecorderApp` no longer merges — it always emits a fresh actionAdded/signalAdded, so `actionUpdated` is gone from the protocol, and signalAdded now carries the regenerated last-action code instead of ''. `RecorderEventSink` now hands clients pure `Action`/`Signal` rather than the in-context wrappers.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Contributor
Test results for "MCP"2 failed 7758 passed, 1249 skipped Merge workflow run. |
Contributor
Test results for "tests 1"10 flaky49539 passed, 1168 skipped Merge workflow run. |
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.
Summary
signalsmoves offActionBaseontoActionInContext({ pageGuid, action, signals }), since signals describe the context of an action, not the action itself.generateActionreadsactionInContext.signals; eachSignalAddedconsumer keeps its ownActionInContext[]and appends the signal to the matching entry.collapseActions()/shouldMergeAction()helpers. The merge (fill same-selector, navigate) is now an inline replace-or-push of the last action in each client — RecorderApp, DebugController, and recorder-api'sRecorderLog.ProgrammaticRecorderAppno longer merges: it always emits a freshactionAdded/signalAdded.actionUpdatedis removed from the protocol enum, andsignalAddednow carries the regenerated last-action code (was'').RecorderEventSinkhands clients pureAction/Signalinstead of the in-context wrappers.Generated output is unchanged; JSONL still serializes
signals.