Repository navigation
fix: hide skipped AI notes and match near-duplicate screenshots - #1317
Conversation
Skipped notes stay out of the Check for visuals summary and the managed comment, and the section is left out when every note was skipped. The before/after note treats pHashes within 4 bits as the same picture, and skips when a hash is missing or malformed. Co-authored-by: Zach Dunn <zachdunn@users.noreply.github.com>
|
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one): 2
🚫 Excluded labels (none allowed): 1
Please check the settings in the CodeRabbit UI or the
|
The Check for visuals AI notes were showing lines for notes that never ran, and the before/after note required two perceptual hashes to be identical. Compression can flip a few bits, so the same picture saved twice could look different.
Skipped notes now stay out of the check summary and the managed comment. When every note was skipped, that section is left out and the rest of the summary stays as it was. A before and an after count as the same picture when their pHashes differ by at most 4 bits. A missing or malformed hash skips the note. Label reuse (
matchPerceptualReuse) still requires an exact pHash, which is the follow-up Zach Dunn (@zachdunn) noted on #1303.What it does
identical-before-afterwith a Hamming distance of 4 on the stored 16-digit pHash. The threshold is the constantIDENTICAL_PHASH_DISTANCE.How to try it
This ships with the API worker. After it deploys, the next comment sync on a repo with
check.aiset shows the quieter notes.A warning still renders, and a skipped note beside it does not:
When every note was skipped, that block is absent. The check summary keeps its checklist and does not gain an AI notes heading.
Technical notes
Stored pHashes are 16 lowercase hex digits. Anything else is unreadable, and the before/after note is skipped rather than flagged. Distance is only used by
identicalBeforeAfterNote.Test plan
pnpm --filter @uploads/api exec vitest run src/github-check-ai-notes.test.ts src/github-check-run.test.ts src/github-comment-render.test.tsNo UI source files changed. The sample above is the rendered comment. Check for visuals should report no UI changes.