Skip to content

fix(tests): Automations hero wash check fails when the window is maximized between measuring the page and the hero - #2176

Merged
bkudiess merged 1 commit into
openclaw:mainfrom
bkudiess:bkudiess-automations-hero-wash-flake
Nov 13, 2026
Merged

bkudiess merged 1 commit into
openclaw:mainfrom
bkudiess:bkudiess-automations-hero-wash-flake

Conversation

@bkudiess

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes: the Automations hero wash fixture check (Automations_HeroWashScrollsWhileTheBackplateStaysAnchored) fails intermittently with "A visible partial-scroll interval is required for wash tracking." when the window is maximized between measuring the page and measuring the hero.

User Impact

No user-visible change. Mock Gateway fixture shard B stops failing on this test.

Why This Change Was Made

OpenMainAutomationsAsync requests a maximize once and waits only for an element to exist. The wash proof then did three things in this order:

  1. settled the page aperture at scroll zero;
  2. took the top capture through SaveAutomationsWindow, which maximizes the window if it isn't maximized yet;
  3. read the hero once.

If the earlier maximize had not taken effect, step 2 moved the page. The aperture then came from the restored window and the hero from the maximized one, so hero.Top - aperture.Top dropped below the required interval. The failing CI capture shows the window maximized (-8,-8 1936×1048) with the hero at the top of the page. #2152 (fix(tests): Automations fixture tests time out selecting the app theme when Settings opens slowly) addressed only the theme selection.

Changes:

  • Wait for the maximized window state before acquiring the page and resetting the scroll.
  • Measure the aperture, headline and hero together, requiring two identical consecutive samples. A missing or offscreen peer, empty or non-finite bounds, or ElementNotAvailableException resets the samples.
  • Take the top capture, then require a second settled sample equal to the first, so the pixel checks read the capture at the coordinates they measured.
  • After the partial scroll, require the aperture to be unchanged.
  • The failure message now reports the aperture, hero, scale and range.
  • The timing-pattern baseline for this file drops from 70 to 68.

Evidence

  • RED with the real trigger: main plus SetWindowVisualState(Normal) at the start of the wash proof fails both themes with the exact CI message.
  • GREEN: this change plus the same restore at the same point passes both themes. The perturbation was temporary and is not committed.
  • Clean runs: 5 of 5 (both themes each), then 3 of 3 on the final head.

Change Type

  • Bug fix
  • Feature
  • Refactor
  • Docs or instructions
  • Tests or validation
  • Security hardening
  • Chore or infrastructure

Scope

  • Tray or WinUI UX
  • Windows node capability
  • Local MCP or winnode
  • Gateway, connection, or pairing
  • Setup or onboarding
  • Permissions, privacy, or security
  • Tests, CI, or docs

Required proof pools

  • none: test-only change to a mock Gateway fixture UI test. CI runs it natively in fixture shard B.

Validation

Local, head 0f055bc on main e9ed3ba, isolated OPENCLAW_TRAY_* profile. Native runs held the exclusive native-desktop lock, and the real %APPDATA% and %LOCALAPPDATA%\OpenClawTray metadata manifests were unchanged.

Command Result
Wash proof, RED (main plus restored window) ❌ both themes: A visible partial-scroll interval is required for wash tracking. (expected)
Wash proof, GREEN (fix plus the same restore) ✅ 2 passed, also rerun on the final head
Wash proof, clean ✅ 5 of 5, then 3 of 3 on the final head (both themes each)
scripts\validate-test-timing-patterns.ps1 ✅ pass; baseline is 68
./build.ps1 ✅ pass
dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj ✅ 5862 passed, 29 skipped
dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj ✅ 6444 passed
git diff --check ✅ pass

Hanselman dual review (Claude Opus 5.5 and GPT-6 Astra, high effort), with a delta re-review of the final head: no blocking issues.

  • Fixed:
    • My first explanation (NavigationView opening its pane) was wrong, because the pane uses Left display mode. The cause above replaces it.
    • The settle accepted offscreen or empty bounds and did not reset on ElementNotAvailableException. Both models flagged the exception gap.
    • The capture could happen after the measurement.
    • A late layout shift went undetected.
    • The page peer was acquired before the maximize.
  • Not changed (LOW, one model only): an empty aperture directly after the maximize would hit ResetAutomationScrollAsync's existing assert. That helper is shared and left as is.

Real Behavior Proof

  • Environment tested: local Windows 11 interactive desktop (exclusive native-desktop lock), fixture Gateway, isolated profile.
  • PR head or commit tested: 0f055bc (base main e9ed3ba)
  • Exact steps or command run: dotnet test tests\OpenClaw.Tray.UITests -c Debug -r win-x64 -p:DevBuild=false --filter "FullyQualifiedName~Automations_HeroWashScrollsWhileTheBackplateStaysAnchored", with the fixture environment that scripts\test-gateway-fixture.ps1 sets.
  • Evidence after fix: RED failed with the CI message; GREEN and the clean runs passed, as in the table above.
  • Observed result: the wash proof now measures and captures one settled, maximized layout.
  • Screenshot or artifact links verified? N/A
  • Not verified or blocked: the full fixture shard was not run locally; CI runs shard B natively.

Security Impact

  • New permissions or capabilities? No
  • Secrets or tokens handling changed? No
  • New or changed network calls? No
  • Command or tool execution surface changed? No
  • Data access scope changed? No
  • If any answer is Yes, explain the risk and mitigation: N/A

Compatibility and Migration

  • Backward compatible? Yes
  • Config or environment changes? No
  • Migration needed? No
  • If yes, list the exact upgrade steps: N/A

Review Conversations

  • I replied to or resolved every bot review conversation addressed by this PR.
  • I left unresolved only conversations that still need maintainer judgment.

…mized between measuring the page and the hero

SaveAutomationsWindow maximizes a window that is not maximized yet. The hero wash
proof settled only the page aperture, then took the top capture (which could
maximize the window) and read the hero once, so the aperture and hero could come
from different layouts. Maximize first, measure the aperture, headline and hero
in one settled sample, check that the layout did not move across the top capture
or the partial scroll, and report the measured values when the interval is
too small.

Co-authored-by: Copilot App <[email protected]>
@clawsweeper

clawsweeper Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 13, 2026
@clawsweeper

clawsweeper Bot commented Nov 13, 2026

Copy link
Copy Markdown

Codex review: needs maintainer review before merge.

What this changes

The PR maximizes the Automations window before measuring and verifies stable geometry around the hero screenshot.

Example: The Light-theme wash test starts with a restored window before capturing a maximized 1936×1048 window.

  • Before: The aperture and hero can come from different layouts, causing the partial-scroll assertion to fail.
  • After: The test waits for maximization and samples matching geometry before checking wash movement.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, source-supported test repair with reported native negative-control validation and no identified correctness defect; hosted native validation is still pending.
Proof confidence 🐚 platinum hermit (4/6) No shipped behavior changes; the author reports native fixture before/after runs on the final head, while hosted fixture shard B remains in progress.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Contributors encounter false fixture failures when window maximization changes the layout during the hero wash proof.
Reason: The maintainer-authored repair targets a concrete test race and preserves the product contract without adding options or production machinery.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it repairs a source-verifiable test race still present on main, preserves the rendering assertions, and introduces no actionable defect found in this review.

Priority: P3
Reviewed head: 0f055bcfad4abb676e668b203171f682c340edd7

Before merge

None.

Findings

None.

Agent review details

How this fits together

The native Automations fixture test reads UI Automation geometry and window screenshots, then checks that the hero wash scrolls while the page backplate remains anchored.

flowchart LR
  A[Fixture Automations page] --> B[Maximize window]
  B --> C[Settle geometry]
  C --> D[Capture window]
  D --> E[Scroll page]
  E --> F[Check wash and backplate pixels]
Loading

Technical review

Best possible solution:

Keep the repair in the existing fixture test, measuring one maximized layout while preserving the independent wash and backplate assertions.

Do we have a high-confidence way to reproduce the issue?

Source confirms that screenshot capture can maximize the window between aperture and hero measurements; the author reports a matching restored-window negative control, but this review ran no target code.

Is this the best way to solve the issue?

The fix addresses the ordering cause through the existing fixture owner, uses settled geometry rather than a longer delay, and retains the independent rendering checks.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 90653249bd8a.

Provenance checked

  • Hero wash geometry and screenshot ordering keeps the original intent (994539b: The native Automations feature added pixel proof that the decorative wash follows the hero while the surrounding backplate stays anchored.)
  • One-shot UI Automation timing baseline keeps the original intent (e2326cc: The prior fixture repair lowered the baseline after removing two one-shot lookups; this change follows that ratchet by removing two more.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Change size Production +0/-0; tests and baseline +72/-7 The growth stays within the existing fixture and supports maximization readiness and consistent pixel coordinates.

Labels

Label changes:

  • add P3: This repairs a false native-fixture failure without changing shipped application behavior.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This repairs a false native-fixture failure without changing shipped application behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 13, 2026, 1:38 PM ET / 18:38 UTC.

@bkudiess
bkudiess merged commit df302df into openclaw:main Nov 13, 2026
34 checks passed
karkarl added a commit to karkarl/openclaw-windows-node that referenced this pull request Nov 13, 2026
Resolves conflicts with openclaw#2173 (session dashboard tab beside chat), openclaw#2176, openclaw#2175, openclaw#2116 and openclaw#2172:

- ReactorBoardView: embedded board keeps main's compact 12/0 padding, standalone pages keep the shared PageResponsiveLayout PaddingTop/PaddingBottom.
- Resources.resw (all 6 locales): keep this PR's PageAction_Refresh keys and main's Chat_Panel_Dashboard.
- TestTimingPatternBaseline.json: main's counts, then lowered for this branch.

Co-authored-by: Copilot App <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant