Skip to content

fix: hide Approve/Reject variations buttons when there are no true siblings#379

Merged
nGervasyuk merged 2 commits into
Visual-Regression-Tracker:masterfrom
nGervasyuk:fix/variations-buttons-single-sibling
Jul 17, 2026
Merged

fix: hide Approve/Reject variations buttons when there are no true siblings#379
nGervasyuk merged 2 commits into
Visual-Regression-Tracker:masterfrom
nGervasyuk:fix/variations-buttons-single-sibling

Conversation

@nGervasyuk

Copy link
Copy Markdown
Collaborator

Problem

The Approve/Reject variations buttons appeared whenever another run in the
build merely shared the screen name. So two runs of the same screen that
differ on a fixed axis — e.g. the same screen on iPhone and iPad, same
locale — surfaced the buttons even though there was nothing to bulk-review. The
dialog then listed only the run itself (1 of 1 matching).

Before After
Buttons shown for name-only match (e.g. iPhone + iPad, same locale) Buttons shown only when a real sibling exists

Fix

Mirror the backend sibling definition (findMatchingSiblings): a sibling shares
the screen name and every test-variation axis except the project's group-by
axis (bulkApproveGroupBy, customTags by default). Runs that differ on a
fixed axis are no longer counted as siblings, so the buttons stay hidden when
bulk review would be a no-op.

This keeps the frontend visibility check consistent with what the backend will
actually return, and stays generic to the configured group-by axis (switching a
project to group by device correctly treats different-device runs as siblings).

Testing

  • iPhone + iPad, same locale, group-by customTags → buttons hidden
  • Same device, 2+ locales → buttons shown
  • Group-by device, iPhone + iPad same locale → buttons shown
  • Project with the feature disabled → buttons hidden (unchanged gate) ✅

Known limitation

hasSiblingsToReview counts siblings from the already-loaded testRuns list, so
with a paginated list a sibling on another page may not be counted. The dialog
itself fetches matches from the backend, so bulk review is unaffected — only
button visibility depends on the loaded page.

@nGervasyuk nGervasyuk self-assigned this Jul 16, 2026
@nGervasyuk
nGervasyuk requested a review from pashidlos July 16, 2026 11:42
… axis

The Approve/Reject variations buttons showed whenever another run merely
shared the screen name, so two runs of the same screen on different devices
(e.g. iPhone + iPad, same locale) surfaced the buttons even though there was
nothing to bulk-review — the dialog then listed only the run itself.

Mirror the backend sibling definition: a sibling shares the name and every
test-variation axis except the project's group-by axis (bulkApproveGroupBy,
customTags by default). Runs differing on a fixed axis are no longer counted.
@nGervasyuk
nGervasyuk force-pushed the fix/variations-buttons-single-sibling branch from aa2521a to 5eafbc3 Compare July 16, 2026 11:46

@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

@sonarqubecloud

Copy link
Copy Markdown

@nGervasyuk
nGervasyuk merged commit e7102d2 into Visual-Regression-Tracker:master Jul 17, 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