Skip to content

record: committed input clears are unconditionally omitted from exported traces #58

Description

@EuanTop

Summary

When a user clears a text input that previously contained a value and then
commits the change, the exported trace does not contain an empty fill step.

As a result, some workflows that depend on removing an existing value cannot
be reproduced from the trace.

Steps to reproduce

Use a page containing a prefilled input and a button:

<input aria-label="Search query" value="browser" />
<button>Apply</button>
  1. Start bsk record on the page.
  2. Clear the prefilled input.
  3. Click Apply.
  4. Finish recording and inspect trace.json.

Actual behavior

The Apply click is recorded, but the input clear is omitted:

{
  "steps": [
    {
      "op": "click",
      "target": {
        "role": "button",
        "name": "Apply",
        "tag": "button"
      }
    }
  ]
}

Expected behavior

The committed transition from the existing value to an empty value should be
represented before the click:

{
  "steps": [
    {
      "op": "fill",
      "target": {
        "role": "textbox",
        "name": "Search query",
        "tag": "input"
      },
      "value": ""
    },
    {
      "op": "click",
      "target": {
        "role": "button",
        "name": "Apply",
        "tag": "button"
      }
    }
  ]
}

This report is about a committed change from a non-empty value to an empty
value. A transient empty state while the user continues editing does not need
to become a separate step.

Source observation

The capture layer detects changes relative to the field's initial value, but
the trace reducer currently excludes every non-redacted blank fill:

if (step.op === "fill" && !(step.value ?? "").trim() && !step.redacted) return false;

This appears to make workflows that intentionally clear an existing value
impossible to express in the exported trace.

If preserving committed empty values aligns with the intended recording semantics, I'd be happy to work on the change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions