Skip to content

feat(app): show notice when base images have already been updated#750

Merged
danadajian merged 6 commits intomainfrom
feat/base-images-already-updated-notice
Mar 27, 2026
Merged

feat(app): show notice when base images have already been updated#750
danadajian merged 6 commits intomainfrom
feat/base-images-already-updated-notice

Conversation

@danadajian
Copy link
Contributor

@danadajian danadajian commented Mar 27, 2026

Summary

  • Adds a new tRPC query getVisualRegressionStatus that checks the GitHub commit status for the visual regression context
  • When the status is already success (base images were accepted in a prior session or by another reviewer), a green banner is shown above the Accept button
  • The query is only made when commitHash, owner, and repo are all present in the URL — diffId-only flows are unaffected
  • Fixes a bug where the new test count could go negative per package when orphaned diff.png files (no corresponding new.png) were present

Changes

  • app/backend/src/getVisualRegressionStatus.ts (new) — fetches listCommitStatusesForRef via octokit, returns { isAlreadyUpdated: boolean }
  • app/backend/src/schema.ts — adds getVisualRegressionStatusInputSchema
  • app/backend/src/router.ts — registers getVisualRegressionStatus query
  • app/frontend/components/main-page.tsx — calls the new query and renders a green banner when isAlreadyUpdated is true
  • action/src/run.ts — tracks valid (non-orphaned) diff paths separately and uses them for per-package newTestCount calculation

Test plan

  • Navigate to a Comparadise URL with a commitHash whose visual regression status is already success → green banner "Base images have already been updated for these diffs." appears above the Accept button
  • Navigate to a URL with a commitHash still in pending state → no banner shown
  • Navigate to a URL with only diffId (no commitHash) → no banner shown, query is not fired
  • Accept visual changes for a pending hash → after acceptance the banner should appear on next load
  • Run with a package that has an orphaned diff.pngnewTestCount for that package is 0 or positive, never negative

Generated with Claude Code

danadajian and others added 6 commits March 27, 2026 09:44
Adds a new tRPC query that checks the GitHub commit status for the
visual regression context. When the status is already 'success' (base
images were accepted in a prior session or by another reviewer), a
green banner is displayed above the Accept button on the review page.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When a package had orphaned diff.png files (no corresponding new.png),
pkgDiffCount was inflated because it read from the raw diffFilePaths array
instead of the filtered set of valid diffs. Track valid diff paths during
the orphan-deletion pass and use them for per-package counting.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… updated

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@danadajian danadajian merged commit bb31af9 into main Mar 27, 2026
3 checks passed
@danadajian danadajian deleted the feat/base-images-already-updated-notice branch March 27, 2026 16:22
@eg-oss-ci
Copy link

🎉 This PR is included in version 1.42.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants