@swmansion/argent 0.18.1-next.10 → 0.18.1-next.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -150716,6 +150716,14 @@ function formatScreenshotDiffSummary(result) {
150716
150716
  const coordinateSpace = coordinateSpaceForSummary(result.imageSize);
150717
150717
  const lines = ["Screenshot diff summary", "", "Overall:"];
150718
150718
  lines.push(`- status: ${status}`);
150719
+ if (result.sizeNormalization) {
150720
+ const { baseline, current, comparedAt } = result.sizeNormalization;
150721
+ lines.push(
150722
+ `- size_normalized: baseline=${formatSize(baseline)} current=${formatSize(current)} compared_at=${formatSize(comparedAt)}`,
150723
+ " - the inputs share an aspect ratio but not a resolution, so the larger was downscaled before comparing; any pixel or text differences below may include resampling artifacts, and the diff images are at compared_at rather than full size",
150724
+ " - re-capture the baseline at the same scale as the current image (screenshot with scale: 1.0) to compare without resampling"
150725
+ );
150726
+ }
150719
150727
  if (result.dimensionMismatch) {
150720
150728
  lines.push(
150721
150729
  `- dimension_mismatch: expected=${formatSize(result.dimensionMismatch.expected)} actual=${formatSize(result.dimensionMismatch.actual)}`
@@ -150777,6 +150785,7 @@ function screenshotDiffStatus(result) {
150777
150785
  if (result.textAnalysis?.status === "ok" && result.textAnalysis.changes.length > 0) {
150778
150786
  return "changed";
150779
150787
  }
150788
+ if (result.sizeNormalization) return "resized_no_change";
150780
150789
  return "unchanged";
150781
150790
  }
150782
150791
  function formatSize(size) {
@@ -151009,6 +151018,11 @@ async function diffPngFiles(options) {
151009
151018
  }
151010
151019
  const baseline = normalized.baseline;
151011
151020
  const current = normalized.current;
151021
+ const sizeNormalization = decodedBaseline.width === decodedCurrent.width && decodedBaseline.height === decodedCurrent.height ? void 0 : {
151022
+ baseline: { width: decodedBaseline.width, height: decodedBaseline.height },
151023
+ current: { width: decodedCurrent.width, height: decodedCurrent.height },
151024
+ comparedAt: { width: baseline.width, height: baseline.height }
151025
+ };
151012
151026
  const totalPixels = baseline.width * baseline.height;
151013
151027
  const pixelDiff = markChangedPixels({
151014
151028
  baseline,
@@ -151051,7 +151065,8 @@ async function diffPngFiles(options) {
151051
151065
  diffPath: artifactPaths.diffPath,
151052
151066
  contextDiffPath: artifactPaths.contextDiffPath,
151053
151067
  regions,
151054
- textAnalysis
151068
+ textAnalysis,
151069
+ ...sizeNormalization && { sizeNormalization }
151055
151070
  });
151056
151071
  }
151057
151072
  function resolveDiffSettings(topMask) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swmansion/argent",
3
- "version": "0.18.1-next.10",
3
+ "version": "0.18.1-next.11",
4
4
  "mcpName": "io.github.software-mansion/argent",
5
5
  "description": "MCP server for iOS Simulator and Android Emulator control",
6
6
  "license": "Apache-2.0",