Repository navigation
Image ignore regions in visualci.yml (sc-9018); CLI 0.2.22 - #134
Merged
Merged
Conversation
VisualCIdocspring/visualci · build #167 · 339 unchanged · no changes This PR vs base: 7 changed since #122, across 3 builds docspring/visualci · journeys · build #165 · 12 unchanged · no changes This PR vs base: 2 changed since #119, across 3 builds Updated as builds change. Agents can review with VisualCI's MCP tools. |
ndbroadbent
force-pushed
the
image-ignore-regions
branch
from
December 3, 2026 15:12
ec6c9a5 to
4f03f42
Compare
ndbroadbent
marked this pull request as ready for review
December 3, 2026 15:12
…c-9018); CLI 0.2.22 An ignore rule can now carry `region` (bands along the image's edges: top, bottom, left, right, in pixels) and `rects` (x, y, width, height). For the snapshots its glob matches, those pixels are left out of the image diff: never counted as changed, nor in the regions or the fingerprint. A page that differs only inside them gets the new page state `masked` and its snapshot stays unchanged. - visualci-core: `ScopedIgnoreRule.region`/`rects`, validated with clear messages (at most 100 areas in all); `ImageMask` resolves them against a diff's canvas; `diff::diff_masked` skips masked pixels and hatches them in the overlay; `DiffResult` gains `masked` and `masked_pixels`. - app/: `BuildSettings::image_mask` takes the areas from the build's own rules (its file's, else the project's), so past builds are compared and shown with their own settings. The mask's hash is part of the diff cache key. A new mask counts as hiding more, so it brings the visualci.yml review item. Migration allows the `masked` page state. - get_snapshot and the download manifest list each page's masked areas; the PR comment names masked areas next to the images it shows. - Review UI: masked areas hatched over the base, head, diff and slider views; "masked" page pill and pixel count. - Docs: visualci.yml reference (Masking part of an image), the mobile page (Liquid Glass tab bar), design.md; skills regenerated; plugin 0.1.51; visualci.schema.json regenerated.
ndbroadbent
force-pushed
the
image-ignore-regions
branch
from
December 3, 2026 15:27
4f03f42 to
fd364be
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Shortcut: sc-9018. Requested by Fleetlayer's iPhone suite: iOS 26's Liquid Glass tab bar lenses a pixel or so differently on each simulator run, so 1 to 4 of 16 shots showed as changed in the bottom ~150 px.
Rebased onto the repo layout change (#137): frontend/ at the top level, app/ in the root workspace.
Config shape
The existing scoped ignore rules gain two image fields, next to
json_pathsandtext_patterns:Invalid ones are refused with a message naming the rule: an empty
region, a zero or oversized side, a zero-size rect, unknown fields, and more than 100 areas in all. A rule must still ignore something (text or image).Where masking happens
visualci_core::diff::diff_masked: masked pixels are never counted as changed, so they stay out of the counts, the regions and the fingerprint. The overlay hatches them.DiffResultgainsmasked(areas in canvas pixels) andmasked_pixels(the differing pixels the mask hid).BuildSettings::image_maskcollects the areas from the build's own rules (itsbuilds.configfile, else the project's), the same model as text rules, so a past build is compared and shown with its own settings.diffs::find_or_computeresolves the areas against the canvas, and the mask's hash goes into the diff cache key. A page that differs only inside the mask is the new page statemasked(migration), and its snapshot is unchanged. A new mask counts as hiding more, so it brings thevisualci.ymlreview item.get_snapshotgives each page'smaskedandmasked_pixelsnext toregions. The download manifest hasmasked. The review UI hatches the areas over the base, head, diff and slider views, shows a "masked" pill and the masked pixel count. The PR comment shows the raw images, so it says how many areas were masked instead of hatching them.Not done: a ±1 px shift tolerance.
Tests (build box, all green)
cargo fmt --all --check, clippy-D warnings,cargo testagainst Postgres 17 and RustFS (new: config parsing and refusals, mask resolution, diff with changes inside, partly outside and without the mask).tests/masks.rs: end to end through the API. A change only inside the iOS mask concludes unchanged with page statemasked. A change partly outside reports only the outside region. A non-matching glob is unaffected. MCP and the review page's API list the masked areas. Adding a mask hides more.) MCP goldens updated for the new schema and descriptions; PR comment golden updated.pnpm build,pnpm test(newmasked-areas.test.tsx),skills.mjs --check.VisualCI build: what should change
site/visualci.schema.json: the newregion/rectsfields and theEdges/Rectdefinitions.json/request snapshots: the MCP tools lists (update_project's andget_snapshot's descriptions, the ignore rule schema) andget_skill(the visualci-config skill description).CLI and core changed, so the workspace is 0.2.22 (plugin 0.1.51). The docs'
VISUALCI_VERSIONpins move after the release.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.