How sparsh works

Sometimes the page moves
between “I meant that” and click.

That little gap is where a good tap can go sideways. sparsh checks what’s under it: is it the thing the person saw, or did the UI sneak in something new?

01You spot something

You see Maya’s message and go to open it.

02The page does a thing

A new message appears, or the row moves while you’re on your way.

03sparsh checks the tap

Does it still match what you were trying to do?

BUILT TO STAY OUT OF THE WAY

What does sparsh cost?

sparsh checks an activation as it happens. It uses a small set of shared event listeners and does work for the interaction, rather than keeping a registry of every control in your app.

We aim to keep that extra work below one millisecond per interaction and measure DOM observer cost with a virtualized 10,000-row interface. These are performance targets, not published benchmark results yet. See the detailed performance plan.

FOUR WAYS A TAP CAN GO SIDEWAYS

What does sparsh check?

◷

AGE

Did it just show up?

Age checks how long something has been visible. A brand-new message that pops up under a tap may not be what the person meant to open.

⌖

CONTINUITY

Did it move while you pressed?

Continuity checks whether the same thing stayed in the same place from pointer down to pointer up. It catches a layout shift or a new control taking over.

◈

SEMANTICS

Did the button’s job change?

Semantics checks things like disabled state, accessible label, link or input value, and an optional data-guard-key.

↻

DOUBLE FIRE

Did the last click uncover something?

Double fire watches for a quick second activation on a different target after the first action changed or collapsed the UI.

DEFAULT PROTECTION

Suspicious taps are stopped.

By default, sparsh runs in enforce mode and stops suspicious activations. You can switch to report mode to observe decisions without blocking, or set modes per policy.

enforce defaultreport observe only

Keyboard users count too.

Keyboard and assistive-technology activations are handled separately. Continuity only runs when there’s an actual pointer press to compare. Escape, moving focus, and scrolling are never blocked.

A QUICK REALITY CHECK

sparsh would rather miss a tricky case than block a tap it can’t explain. It doesn’t catch every visual change yet—opacity-only reveals and some overlays can slip by. See the full policy behavior and known limits.