Conversation
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e72b2664a4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
src/utils/screenshot-diff.ts
Outdated
| differentPixels > 0 | ||
| ? summarizeNonTextDiffDeltas({ | ||
| diffMask, | ||
| width: baseline.width, | ||
| height: baseline.height, |
There was a problem hiding this comment.
Gate non-text delta generation on successful OCR analysis
This path computes nonTextDeltas for every pixel mismatch even when OCR is unavailable, so text-only changes get treated as "non-text" residuals and can be mislabeled as icons/toggles. In environments without tesseract (or when OCR fails), this produces misleading guidance rather than OCR-masked residuals; the non-text pass should be skipped unless OCR analysis is present.
Useful? React with 👍 / 👎.
| if (flags.overlayRefs && !result.match && !result.dimensionMismatch) { | ||
| const overlayResult = await client.capture.screenshot({ | ||
| path: outputPath ? deriveCurrentOverlayPath(outputPath) : undefined, | ||
| overlayRefs: true, | ||
| }); |
There was a problem hiding this comment.
Delete stale current-overlay artifact on no-diff runs
The overlay guide is only captured on mismatch, but there is no cleanup when a later diff screenshot --overlay-refs --out ... run matches (or has a dimension mismatch). That leaves an old *.current-overlay.* file on disk, which can be mistaken for fresh output by users or scripts that rely on the deterministic filename.
Useful? React with 👍 / 👎.
Summary
Add region-aware screenshot diff output with light current-screen context, region outlines, structured changed-region metadata, best-effort Tesseract OCR text deltas, and non-text residual hints for icons, controls, separators, and backgrounds.
Wire
diff screenshot --overlay-refsto capture a separate current-screen overlay guide and map changed regions to current refs, while keeping raw OCR boxes internal to the non-text masking pass. Update docs and the agent-device skill guidance for the new workflow.Validation
pnpm formatpnpm vitest run src/utils/__tests__/screenshot-diff-non-text.test.ts src/utils/__tests__/screenshot-diff-ocr.test.ts src/utils/__tests__/output.test.ts src/utils/__tests__/screenshot-diff.test.ts src/__tests__/cli-diff.test.ts src/utils/__tests__/cli-option-schema.test.tspnpm check:quickpnpm check:unitgit diff --check/Users/thymikee/Downloads/IMG_8160.PNGand/Users/thymikee/Downloads/simulator_screenshot_B3AD5337-53C6-4B34-AB5B-CDB8A0864CB9.pngviacompareScreenshots