Skip to content

--computed: snapshot :hover and :focus states #51

Closed

Description

@tmashara

What
With --computed, also snapshot :hover and :focus (and :focus-visible) styles of interactive elements (links, buttons, inputs, [tabindex]), by forcing the state with CDP CSS.forcePseudoState, and diff them like the other computed styles.

Why
From the metabase.com run (feedback.md, computed-style proposal, item 5): unshot hover and focus states were the biggest coverage gap, and dead-CSS removal breaks exactly those. Today they need a hand-written before hook per element, and the skill lists them as "not verified" on every run. No visual-testing tool we looked at (Argos, Percy, uiverify.ai) covers this.

How
In computed.ts, after the normal snapshot, for each matched interactive element: force the state through a CDP session, read the same PROPS, and record only properties that differ from the element's resting state. Key the entries as <key>:hover so they diff and group like other findings. Cap the element count per page, and say when the cap was hit. Pixels are not shot for these states.

Activity

  1. added
    enhancement
    on Oct 29, 2026
  2. added a commit that references this issue on Oct 29, 2026
    123c283
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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions