Skip to content

fix: hide the fade and the blend when there is nothing to compare - #399

Merged
nGervasyuk merged 1 commit into
Visual-Regression-Tracker:masterfrom
nGervasyuk:fix/hide-fade-when-settled
Aug 23, 2026
Merged

nGervasyuk merged 1 commit into
Visual-Regression-Tracker:masterfrom
nGervasyuk:fix/hide-fade-when-settled

Conversation

@nGervasyuk

@nGervasyuk nGervasyuk commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

Problem

The fade slider and the difference blend are offered on every screenshot, including ones where there is nothing to compare. On a new run the baseline pane reads "No image available" — and the fade still invites you to reveal a baseline that isn't there. An ok run matched the baseline it has, so fading between the two shows nothing either.

Change

Show both controls only when the checkpoint has a baseline it differs from:

Status Fade / blend Why
new hidden no baseline behind the checkpoint at all
ok hidden matched its baseline, which is also why it carries no diff
unresolved shown under review
unresolved, no diff shown dimensions differ, so fading is the only comparison left
approved / autoApproved shown keeps the diff it was approved with, and what was approved is still worth looking at

The predicate lives next to the other status helpers as canCompareToBaseline, so the rule is stated once and covered by unit tests.

Gating on diffName — the condition the diff toggle uses — would have been wrong in both directions: it would drop the controls on a dimension mismatch, where they are the only way left to compare, and it says nothing about a run that matched its baseline.

Tests

  • unit tests for canCompareToBaseline: under review, dimension mismatch, approved, autoApproved, ok, new, and no baseline
  • integration tests asserting both controls are absent on an ok and a new screenshot, and present on an approved one alongside the diff toggle
  • the two existing "forgets the fade/blend on the next screenshot" tests now walk onto another run under review, since a settled one no longer carries a fade to forget — their original intent is unchanged

Full Playwright suite (87) and unit suite (26) pass locally.


Nothing to configure. Independent of the other open frontend PRs (#397, #398, #399, #400, #401) — verified that they all merge onto master in sequence without conflicts, in any order.

Both controls read a checkpoint against its baseline, so they only mean
something when the two differ. A new run has no baseline behind it at all —
that is the pane reading 'No image available' while the fade still offers to
reveal it — and an ok run matched the baseline it has.

Everything else keeps them: an unresolved run under review, a dimension
mismatch, where fading is the only comparison left since no diff could be
produced, and an approved run, which keeps the diff it was approved with and
is still worth looking at.

The two tests that walk to the next screenshot now step onto another run
under review, since a settled one no longer carries a fade to forget.
@nGervasyuk
nGervasyuk force-pushed the fix/hide-fade-when-settled branch from 7744960 to dae094d Compare August 21, 2026 07:17
@nGervasyuk nGervasyuk changed the title fix: hide the fade and the blend once a run is settled fix: hide the fade and the blend when there is nothing to compare Aug 21, 2026
@sonarqubecloud

Copy link
Copy Markdown

@pashidlos pashidlos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nGervasyuk
nGervasyuk merged commit a8923c0 into Visual-Regression-Tracker:master Aug 23, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants