ci(visual): pin time on screenshots to remove clock-driven diff noise#22
Merged
Conversation
This was referenced May 12, 2026
afonsojramos
added a commit
that referenced
this pull request
May 12, 2026
## Summary Followup to #22. The first time-pin attempt only worked on the Linux DEs whose panels are single-threaded. macOS, Windows, KDE, MATE still drifted because each used the wrong mechanism. - **macOS**: switched to the correct Sonoma+ Control Center key (`defaults -currentHost write com.apple.controlcenter Clock -int 16`) + hide the dock (`autohide=true`, `autohide-delay=1000`) so the Calendar.app icon's daily date no longer drifts. Bumped killall sleep to 8s. - **Linux**: swapped `libfaketime.so.1` → `libfaketimeMT.so.1`. The MT variant intercepts time syscalls in multi-threaded panels (Plasma, MATE) that the non-MT lib was missing. - **Windows**: extended `VISUAL_PREPARE_CMD` to `Set-Date '2026-01-01 00:00:00'` + disable `w32time`. The taskbar clock will still tick during the ~5s of test execution but starts at the same point, so PRs only show seconds-level drift instead of full wall-clock drift. Tint2 looks visually identical between runs (clock shows `00:00 Thursday 01 January` both times) but PNG bytes differ — residual font-AA noise, not chasing. (Replaces #24, which was branched from before #22 merged.) ## Test plan - [ ] All 14 visual jobs still pass - [ ] Inspect each platform's new screenshot to confirm clock is hidden (macOS/Win) or frozen at 00:00 (Linux) - [ ] Two consecutive runs on `main` after merge produce an auto-refresh PR with empty or trivially small diff
3 tasks
afonsojramos
added a commit
that referenced
this pull request
May 12, 2026
#28) ## Summary Even after #22, #25, and #26, the auto-refresh PR keeps reopening every push because residual clock/dock/wallpaper drift survives time-pinning on some platforms (macOS menu bar clock, Linux MATE/Tint2 panels, Windows taskbar clock). Suppressing every clock source per-OS is whack-a-mole; this PR sidesteps it by masking the saved screenshot to only the rects we care about. - **Fixture**: after `showWindow()`, emit `VISUAL:bounds={"tray":{...},"window":{...},"scale":N}` with `mb.tray.getBounds()`, `mb.window.getBounds()`, and the primary display's scale factor for DIP→physical-pixel conversion. - **run.ts**: pixel-check the *original* full-screen capture (tray detection still works on platforms like Linux SNI where `tray.getBounds()` returns `{0,0,0,0}`), then mask the on-disk PNG to keep only the tray + window rects (with 4px padding) and write the masked version. Everything outside — clock, dock, wallpaper, pre-launched File Explorer — becomes solid black. Auto-refresh PR diffs from here on out should only fire when the actual tray icon or popover window rendering changes, not when the OS clock ticks. ## Test plan - [ ] All 14 visual jobs pass (pixel check still operates on full screen pre-mask) - [ ] Inspect a sample of the new screenshots: tray-icon + cyan/yellow window visible on black background, no clock or other OS chrome - [ ] Two consecutive runs on `main` after merge → auto-refresh PR diff is empty or close to it
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.
Summary
Each visual-tray run currently produces a different screenshot per platform every time, dominated by the OS clock ticking. That trains reviewers to dismiss image diffs in the auto-refresh PR without looking, and defeats the point of having screenshots in
PLATFORMS.md. This PR removes the clock-driven noise per platform without touching system time globally.defaults write com.apple.controlcenter "NSStatusItem Visible Clock" -bool false+killall ControlCenterto hide the menu bar clock entirely. Runs once after build, beforebun run test:visual.faketime, wrap eachpanel_cmdwithfaketime "@2026-01-01 00:00:00" bash -c "...". The libfaketime LD_PRELOAD intercepts time syscalls in the panel process and its children, so clock applets in MATE/Xfce/LXQt/KDE/Cinnamon/Tint2/GNOME/Budgie all display a frozen2026-01-01 00:00:00.VISUAL_PREPARE_CMDto setHKCU:\…\Explorer\Advanced\HideClock = 1before restarting explorer. Best-effort on Server 2025 where Win11-style taskbar may ignore it; can iterate if needed.After this lands, the next auto-refresh PR diff should be empty (or close to it) on platforms that re-run with no real rendering change — making any actual regression in tray icon / window painting immediately visible.
Test plan
.github/visual-screenshots/*.pngto confirm no clock is visible (or that it shows00:00)