Skip to content

G40/41 contrast probe scores textless decorative elements (status LEDs, dots) — Lc pairs with no reader #30

Description

@rz1989s

What happened

Build mode (check-gates.mjs --render), engine v1.1.0 on omp. An 8×8px status LED — a pure decoration with no text — got flagged as a contrast failure:

{"selector":"span","color":"oklch(92% 0.008 250)","backgroundColor":"oklch(78% 0.16 152)","width":8,"height":8}
→ 40 · Contrast — span: APCA Lc 18 < 60

The element: <span class="dot" aria-hidden="true"></span> — a live-status LED in a mission-control-style dashboard (rextorsec/rextor PR #75). The (color, bg) pair is inherited-text-vs-own-fill; no reader ever reads it.

What doesn't exempt the element

  • font-size: 0 — no effect; PAIRS_EXPR (render-core.mjs) pushes every body * with a color or bg
  • aria-hidden="true" — no effect (the repro element carries it)

Workaround in use

Give every LED an explicit self-contrasting color so the pair clears Lc 60 by construction:

.dot    { background: var(--color-ok);   color: var(--color-accent-ink); }  /* Lc 64 */
.seg    { background: var(--color-slot); color: var(--color-ink); }        /* Lc 68 */
.seg-on { background: var(--color-ok);   color: var(--color-accent-ink); }

These are semantic no-ops that exist purely to satisfy the probe — a smell that the probe is over-collecting on instrument-style UIs.

Proposal

In PAIRS_EXPR, skip elements that have no renderable text AND no text-bearing pseudo-content:

const ownText = [...el.childNodes].some(n => n.nodeType === 3 && n.textContent.trim());
const pseudo = getComputedStyle(el, "::before").content !== "none" || getComputedStyle(el, "::after").content !== "none";
if (!ownText && !pseudo) continue;   // pure decoration — no reader

Optionally also skip aria-hidden="true" elements (belt for cases where decoration carries stray whitespace text nodes).

Siblings

Environment

  • keystone engine 1.1.0 (~/.omp/plugins/node_modules/@getpipher/keystone)
  • omp host, Chromium driver, build flow Step 7.1
  • Target: rextorsec/rextor apps/dashboard/ (localhost operator dashboard — the instrument-UI case this bites hardest)

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions