Skip to content

Commit b7684a3

Browse files
fix(snapshots): Omit diff_mask_path for layout_changed images
odiff does not generate a mask file when images differ in dimensions, so including a path would point to a non-existent file. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4d3a940 commit b7684a3

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/commands/snapshots/diff.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,12 +224,18 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
224224
_ => "changed",
225225
};
226226
changed_count += 1;
227+
let mask = if status == "layout_changed" {
228+
let _ = fs::remove_file(&mask_path);
229+
None
230+
} else {
231+
Some(path_as_url(&mask_path))
232+
};
227233
images.push(ImageResult {
228234
name,
229235
status: status.to_owned(),
230236
diff_percentage: response.diff_percentage,
231237
diff_pixel_count: response.diff_count,
232-
diff_mask_path: Some(path_as_url(&mask_path)),
238+
diff_mask_path: mask,
233239
error: None,
234240
});
235241
}

0 commit comments

Comments
 (0)