Skip to content

refactor: simplify Android hidden-content hinting pipeline #342

@thymikee

Description

@thymikee

Problem

The Android snapshot -i path currently computes hidden-content hints on the full snapshot tree and then copies hints onto the interactive tree via signature matching.

Current flow (interactive mode):

  1. Parse XML tree once
  2. Build full snapshot
  3. Annotate native scroll hints (dumpsys)
  4. Derive presentation hints on full tree
  5. Build interactive snapshot
  6. Copy hints full -> interactive using tight/loose signatures

This works, but it is hard to reason about and fragile because index/shape differ between full and interactive outputs.

Goal

Keep behavior unchanged for agents while reducing internal complexity and matching fragility.

Proposed direction

  • Derive and attach hidden-content hints directly for interactive output.
  • Use full-tree geometry only as context, not as the source object graph to copy from.
  • Remove signature-based hint copy step if possible.

Non-goals

  • No contract change for snapshot / snapshot -i output.
  • No change to visible-first semantics.

Acceptance criteria

  • snapshot -i keeps current hidden-content hint behavior on Android (Expensify/Settings style lists).
  • Existing Android snapshot tests pass without reintroducing XML re-parse.
  • Implementation no longer depends on tight/loose signature copy for full -> interactive hint transfer.

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