Skip to content

config: ignoreSelectorsVisual and toleratedDomDrift are documented but never read #306

Description

@JonasJesus42

Two .parityignore options are declared in the schema, documented in docs/config.md, and read by
nothing:

option Status
ignoreSelectorsVisual declared + documented, never consumed
toleratedDomDrift declared, never consumed

For contrast, ignoreMetaKeys, ignoreConsolePatterns and ignoreRequestPatterns are all read
(checks/meta-seo.ts, checks/console-errors.ts, checks/network-summary.tsdiff/network.ts).

$ grep -rn "ignoreSelectorsVisual" packages/parity/src
src/types/schema.ts:793:  ignoreSelectorsVisual: z.array(z.string()).default([]),
src/commands/cache.ts:135:      ignoreSelectorsVisual: [],
src/commands/vitals.ts:197:      ignoreSelectorsVisual: [],

Only the declaration and two empty initializers.

Why it matters

docs/config.md presents ignoreSelectorsVisual as the way to keep a rotating banner or a
third-party widget out of the visual diff. A user who sets it gets silence, not suppression
the noisy region keeps producing findings and there is no error, no warning, nothing to suggest the
config was ignored. That is worse than not offering the option: it costs the user a debugging
session to discover the feature does not exist.

Found while implementing #296, where I had cited it (wrongly) as the existing mechanism.

Options

  1. Implement it. In checks/visual-regression.ts, drop matching regions from the DOM snapshot
    comparison and from the LLM's section list before diffing. Non-trivial: the pixel diff is
    whole-screenshot, so a selector-based exclusion means either masking the region in the bitmap or
    only filtering the semantic/DOM layers. Worth deciding which layers it is honestly able to
    cover, and documenting that limit.
  2. Remove both and the docs. Least code, and expectedDivergences (score: an upgrade component should not count as a divergence forever #296) now covers the
    "expected difference" case better anyway, by reclassifying instead of blinding.
  3. Warn when set but unimplemented. A one-line stopgap that at least stops the silent no-op.

I lean toward 2 for ignoreSelectorsVisual — it overlaps with expectedDivergences and the pixel
layer cannot honour it cleanly — and toward 1 or 2 for toleratedDomDrift depending on whether the
DOM-drift check still wants a per-key tolerance.

Either way it should not stay as it is.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdocumentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions