Skip to content

Test: sweep theme contrast and SVG geometry across every view in three theme modes #3395

Open

Description

@VijitSingh97

What's the problem

The 2.0.0 RC found four theme and geometry defects that no automated test could catch: shared native dialog text at 1.21:1 on the dark surface (#3378), an enabled password placeholder at 4.107:1 (#3379), an empty-state link left at the browser's default blue, 1.84:1 (#3380), and an SVG zone heading starting left of its viewBox (#3381). All four are closed. The cause is not: browser tests assert DOM and text under one colour scheme, and nothing in the browser suite measures a computed colour, the painted box of SVG text, horizontal overflow or a focus ring.

The new Sovereign UI has the same gap. The lean UI spec #3566 requires AA contrast in light, dark and OS-following themes and no horizontal scroll at 375 px on every page (A5), says the shell is done when "the contrast sweep passes" (B), and ends in "an accessibility sweep passes" (K). No test performs that sweep. Per the owner's 2026-10-27 rulings this issue sweeps the new UI only; the old tabs, header theme switcher and mine-cart strip are not visited and nothing is added to the old frontend.

What it impacts

How I found it

  • Findings of the RC4 manual pass (eba5c14) behind the four defects above; owner 2026-10-11: every defect an RC cut finds must be caught by automated tests from now on.
  • Read on 2026-10-27: no file in dashboard/tests/browser on develop-v2.1.0 calls emulateMedia, getComputedStyle, getBBox or reads scrollWidth, and dashboard/tests/frontend/helpers/contrast.mjs reads old-stylesheet tokens with no DOM.
  • The draft shell PR (dashboard: fix #2513 — build the lean UI shell #3584, not merged) carries an inline contrast and overflow check for the shell only: no shared helper, no SVG check, no other view.
  • Owner extension 2026-10-12: overflow at phone width, Tab order and focus rings are also unchecked.
  • Not confirmed: whether the sweep is needed in all four Playwright projects, since engine defaults for dialogs and placeholders differ and the RC defects were seen in Chromium dark; the runtime of the full matrix on the new UI; how the wizard is reached in a fixture.

How important is it

Medium. It is test infrastructure, not a user-facing defect, but the 2.1.0 cutover (#2547) cannot claim an automated AA check without it, and these four defects reached an RC. It needs the shell and pages to exist, so nothing is urgent before they land. Cost M: the old report measured the browser job at about 6 to 9 minutes against its 15-minute limit before any sweep.

Acceptance criteria

Scope

  • New UI only. A new browser test file that matches testMatch in the Playwright config, plus a helper beside it, and no new dependency. Any inline contrast or overflow check in the shell tests is replaced by the helper, so one implementation remains. No explanatory source comments.

Coverage

  • One table in the test lists every entry: view, state and how to reach it. Views: the shell, Overview, Machines, Earnings, Settings, every Advanced drawer section, the first-run sync view (Sovereign: build accurate initial sync and runtime recovery screens #2546) and the setup wizard (Sovereign: redesign setup token, role and essential configuration steps #2543). For each, every dialog it opens (including the shared preview-and-confirm dialog and Update Pithead) and its empty, error and disconnected states. A test fails when the shell exposes a page link or Advanced section that the table does not list.
  • Views that differ by platform (v2.1.0 lean UI spec: four pages, one profile control, an Advanced drawer #3566 J) are checked on the appliance, DIY with a login and DIY without a login fixtures; Tari-off lines are checked once.
  • Modes: Auto under an OS-dark and an OS-light emulation, explicit dark under a light OS and explicit light under a dark OS, the explicit choices set through Advanced > Appearance. Widths: 375 px, tablet and desktop. If the full matrix does not fit the runtime limit, the matrix shrinks, not the checks, and the PR states how.

Checks, applied to every entry

  • Text contrast: every element that owns a text node reaches AA against its first opaque ancestor background (4.5:1; 3:1 for large text). Colours given as rgb(), rgba() and color(srgb ...) parse and translucent values are alpha-composited; a value the helper cannot parse fails instead of being skipped.
  • Every enabled input's ::placeholder passes the same check; disabled inputs are skipped.
  • Every svg text element's getBBox lies inside its svg viewBox, for the Overview chart, the topology map and any gauge, with each state or layer of the topology shown and hidden.
  • At 375 px, document scrollWidth is at most innerWidth and no element box extends past the viewport width, on every entry.
  • Every control reached by Tab shows a visible :focus-visible indicator. Inside the Advanced drawer and every dialog Tab stays inside, and closing returns focus to the opener. From the Configuration JSON editor, Tab reaches its remaining controls in visual order and the pending-change bar's Discard, and Enter on Discard restores the clean draft.

Negative controls and registration

  • One case each, built by injecting the fault into the rendered page rather than editing production styles, and each makes the sweep report it: a dialog paragraph at the browser's default text colour on the dark surface, a bare anchor at the default link blue, an enabled placeholder below 4.5:1, SVG text starting left of its viewBox, content wider than the viewport at 375 px, and a focused control with its outline removed.
  • The required browser job runs the file and the PR quotes the passing CI run id. The job's runtime with the sweep stays inside its limit, or the limit is raised in the same PR; the PR states the runtime before and after.
  • The test documentation says how a PR that adds a page, dialog or state adds its entry to the table.

Possible solutions

Earlier scope, kept as evidence only (superseded 2026-10-27; do not implement from it)

What's the problem

Test debt from 2.0.0 RC testing, for 2.0.1 (owner, 2026-10-11: every defect an RC cut finds must be caught by automated tests going forward).

What slipped
Browser tests assert DOM and text under the default colour scheme. No file in dashboard/tests/browser calls emulateMedia, getComputedStyle or getBBox, and dashboard/tests/frontend/helpers/contrast.mjs:1-3 reads theme tokens with no DOM. RC4 (eba5c14) findings it let through:

what it impacts

Where it runs
Tier-1 CI: .github/workflows/browser.yml, job "Browser user journeys" (a required context on develop), running all four projects in the Playwright config.

How I found it

Discovery details are not separately established in the existing report; preserve and verify the evidence already recorded.

how important is it

Cost
M. The job takes about 6-9 min today against its 15 min timeout (browser.yml), so budget the sweep inside it or raise the limit. Helper about 100 lines (estimate).

acceptance criteria

Done when

  • Red against eba5c14 static assets (PITHEAD_BROWSER_STATIC override, dashboard/tests/browser/fixtures.mjs:8-9) for all four defects, one case each; green on develop with the fixes.
  • Negative control: a dialog paragraph left at the UA colour, or a bare anchor, fails the sweep.
  • Registered: the file matches testMatch, so the required job runs it. CI run ids quoted.

possible solutions

Test to build
Playwright: new dashboard/tests/browser/theme-contrast.test.mjs (matches testMatch in dashboard/tests/browser/playwright.config.mjs) plus a helper beside it; no new dependency. Three modes (dashboard/mining_dashboard/web/static/styles/theme.css:10-20, :67-68): OS dark with Auto (emulateMedia), explicit dark under a light OS, explicit light. Visit Simple, Advanced, Configuration, Backup, the setup wizard, every modal (dashboard/mining_dashboard/web/static/app/modal.mjs:41) and each empty and error state. Assert:

  1. Every element owning a text node reaches 4.5:1 against its first opaque ancestor background; handle rgb(), rgba() and color(srgb ...) values and alpha-composite.
  2. Every enabled input's ::placeholder passes the same check; disabled ones are skipped.
  3. Every svg text getBBox lies inside its viewBox, with the internal mesh shown and hidden.

Activity

  1. added this to the v2.x - post-GA milestone on Oct 11, 2026
  2. added
    dashboard
    testing
    on Oct 11, 2026
  3. VijitSingh97 commented on Oct 12, 2026

    @VijitSingh97
    CollaboratorAuthor

    Extension from the 2.0.0 RC manual-test automation sweep (owner, 2026-10-12: automate what the RC tester did by hand). Add to this issue's test:

    run the same view-and-modal walk at a 390x844 viewport (webkit and mobile-chromium projects, dashboard/tests/browser/playwright.config.mjs:23-24) asserting document scrollWidth <= innerWidth and no element box past the viewport; Tab from the JSON editor reaches the file input then Discard, and Enter on Discard restores the clean draft; focused backup buttons show a visible :focus-visible outline. No browser test checks overflow, Tab order or focus rings today. (Malformed raw JSON keeping its error and Save disabled is already covered: dashboard/tests/browser/config.test.mjs:154-173.)

  4. pithead-developer commented on Oct 21, 2026

    @pithead-developer
    Contributor

    Parked in Icebox under the lean roadmap (owner, 2026-10-21): this tests a surface that v2.1.0 reshapes, so writing it now means rewriting it; the feature PRs carry their own tests.

  5. added
    operator-action
    on Oct 27, 2026
  6. added
    blocked
    and removed
    operator-action
    on Oct 27, 2026
  7. pithead-developer commented on Nov 16, 2026

    @pithead-developer
    Contributor

    Blocked on #2547.
    Blocked on #2515.
    Blocked on #2530.
    Blocked on #2540.
    Blocked on #2543.

    Parked until the lean UI lands (see the park comment above). The native blocked-by links already hold it, and the tick removes blocked when every listed issue closes. It covers every view, so it now also waits for the cutover in #2547.

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

    blockeddashboardtesting

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions