Skip to content

refactor(ios): share option-filter predicates between query-sweep and private-AX snapshot backends #775

@thymikee

Description

@thymikee

What to build

The query-sweep and private-AX snapshot backends each reimplement the option filters (compact, interactiveOnly, scope, viewport visibility) with drift: on the same production login screen the private backend's interactive filter admitted 6 nodes where the query sweep admitted 16, and historically the query tier silently flipped interactiveOnly:false while the daemon scope-filtered a second time.

Extract the option predicates into one shared module applied to both flat-shaped backends (a natural stage of the snapshot capture plan). Explicitly out of scope: the recursive tree walk's visibility logic (scroll-hidden hints, occlusion, hidden-content anchors) is traversal-coupled and stays where it is — moving it would be a rewrite, not a deepening.

Acceptance criteria

  • One predicate module decides include/exclude for compact, interactiveOnly, scope, and viewport visibility; flatSnapshotNode and appendPrivateAXNode both consume it.
  • A filter-matrix unit test runs the same node fixtures through both backends' inclusion paths and asserts identical decisions.
  • On a screen where both backends can capture (e.g. the production-login shape), their filtered node sets agree on interactive elements (allowing for genuinely backend-specific nodes).
  • The recursive path's behavior is untouched (existing regular-snapshot tests pass unchanged).

Blocked by

Landing of refactor/ios-snapshot-capture-plan (stacked on #758).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions