Repository navigation
[net11.0][Android] Update UITest snapshot baselines for Shell and NavigationPage toolbar hide scenarios - #38770
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 38770Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 38770" |
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
This comment has been minimized.
This comment has been minimized.
|
Note 🔍
|
MauiBot
left a comment
There was a problem hiding this comment.
AI Review Summary
@praveenkumarkarunanithi — new AI review results are available based on commit
a0fce3d.
🗂️ Review Sessions — click to expand
🚦 Gate — Test Before & After Fix
Gate Result: ⚠️ SKIPPED
No tests were detected in this PR.
Recommendation: Add tests to verify the fix using the write-tests-agent.
📋 Pre-Flight — Context & Validation
PR #38770 Pre-Flight
Context
- Title:
[net11.0][Android] Update UITest snapshot baselines for Shell and NavigationPage toolbar hide scenarios - Base/head:
net11.0<-fix-net11test(a0fce3d88aa3b0fdb19234ce4e92785febeb1eb4) - Materialized review commit:
3f71fe510c6fc76dd1426335fd2a3c3896376dde - Platform: Android
- Purpose: Update expected screenshots after #38058 deferred inset dispatch until the native
AppBarLayoutcollapse completed layout, replacing screenshots that captured an intermediate state. - Gate: Skipped because automated diff detection found no tests. The existing
gate/content.mdwas intentionally not touched.
Direct Diff Inspection
The PR changes exactly two existing binary Android UI-test baselines and no source or test code:
src/Controls/tests/TestCases.Android.Tests/snapshots/android/NavBarHidden.pngsrc/Controls/tests/TestCases.Android.Tests/snapshots/android/ShellPages_NavBarVisibilityHide.png
Both old and new images are 1080x1735. ImageMagick comparison found:
| Snapshot | Differing pixels (AE) | Normalized RMSE |
|---|---|---|
NavBarHidden.png |
372,520 | 0.274888 |
ShellPages_NavBarVisibilityHide.png |
85,077 | 0.142799 |
The corresponding UI tests are:
ToggleHasNavigationBar_HidesBar_VisualShellPages_NavBarVisibilityHide
The bounded verification command is:
pwsh .github/scripts/BuildAndRunHostApp.ps1 -Platform android -TestFilter "FullyQualifiedName~ToggleHasNavigationBar_HidesBar_Visual|FullyQualifiedName~ShellPages_NavBarVisibilityHide"No additional mandatory regression tests were supplied in the STEP 5a request.
Candidate Constraints
EstablishBrokenBaseline.ps1 excludes snapshot paths (*snapshots*, *.png) from fix-file detection. Because this PR contains only PNG baselines, a conforming try-fix attempt is expected to report Blocked with No fix files detected rather than edit unrelated production code. Candidate attempts must preserve the unrelated pre-existing worktree changes under .github/scripts, .github/skills, and eng/scripts.
🔬 Code Review — Deep Analysis
Code Review — PR #38770
Independent Assessment
What this changes: Replaces the Android expected screenshots for ToggleHasNavigationBar_HidesBar_Visual and ShellPages_NavBarVisibilityHide. The capture geometry remains 1080×1735, but the rendered content moves below the top system inset instead of beginning partially behind it.
Inferred motivation: Commit b381b1c8b3 (#38058) changed hidden-toolbar inset redispatch to occur after the native AppBarLayout collapses. These baselines align the existing visual tests with that settled layout.
Reconciliation with PR Narrative
Author claims: The prior baselines captured an intermediate layout after #36072, while #38058 now defers inset dispatch until the AppBar collapse has laid out.
Agreement/disagreement: The code and pixels support the claim. Both old images visibly clip their first content row at the top edge; both replacements restore a normal status-bar inset. The PR changes no runtime or test logic and keeps the same device-size capture.
Prior Review Reconciliation
No prior ❌ Error findings found across top-level reviews, inline review comments, or PR issue comments.
Blast Radius Assessment
- Runs for all instances: No runtime behavior changes; only two Android test expectations change.
- Startup impact: None.
- Static/shared state: None.
- Adjacent scenarios: Visible-toolbar baselines are unchanged, so the scope is limited to the two hidden-toolbar transitions.
CI Status
- Required-check result: Undetermined;
gh pr checks --requiredcould not authenticate and returned no check rows. - Gate result: Skipped because the PR contains only PNG baselines and diff detection found no tests.
- Classification: Evidence gap. The existing UI tests are the correct regression scenarios, but this review has no completed run proving both replacement images match a fresh Android capture.
- Action taken: Confidence capped at low. Gate was not re-run.
Findings
The one permitted MAUI expert pass produced no actionable inline findings; inline-findings.json is a valid empty array. No concrete defect was found in the submitted pixels.
💡 Suggestion — Make asynchronous screenshot settling explicit
Both consuming tests call VerifyScreenshot() without retryTimeout, while #38058 intentionally moves inset work into View.Post. The built-in Android delay and single retry may be sufficient, but using the repository-preferred bounded retryTimeout would better express and tolerate the asynchronous settling behavior. This is test-hardening feedback, not evidence that either replacement baseline is wrong.
Failure-Mode Probing
- Hidden toolbar still captures the intermediate state: the new expected image would reject the old clipped state; a bounded retry would further reduce timing sensitivity.
- Visible toolbar is toggled immediately afterward:
NavBarVisible.pngis unchanged, so the PR does not silently redefine the adjacent visible state. - Capture geometry changed: disproved; old and new files are all 1080×1735.
- Baseline masks unrelated rendering changes: the differences are broad because the content shifts vertically, but visual inspection shows the key semantic change is restoration of the top safe-area position expected from #38058.
External Output Contract
Not applicable.
Verdict: NEEDS_DISCUSSION
Confidence: low
Summary: The replacements are visually and causally consistent with #38058, and no blocking code-review finding was identified. Approval is withheld only because the trusted Gate skipped the binary-only diff and required CI status could not be collected; a focused Android run of the two screenshot tests is needed to close that evidence gap.
🛠️ Try-Fix — Analysis & Comparison
PR #38770 Try-Fix Aggregate
Candidate 1 — Baseline-Gated Alternative (gpt-5.3-codex)
Result: Blocked
Approach: Attempt an alternative only after EstablishBrokenBaseline.ps1 establishes a restorable allow-list, rather than repeating the PR's direct Android snapshot replacement.
Mechanism-level difference: The candidate would change behavior only through files explicitly reverted by the baseline script, avoiding an expected-image update. Baseline establishment stopped before such a surface existed.
Files changed / diff: None; candidate diff is empty.
Verification: The baseline command failed with DIRTY WORKING DIRECTORY - Cannot establish baseline. The required focused Android UI-test filter was not run because proceeding without baseline state would violate the try-fix restoration boundary.
Failure analysis: Pre-existing unrelated worktree modifications caused the baseline precondition to fail. In addition, this snapshot-only PR changes paths excluded by the baseline detector (*snapshots*, *.png), so no eligible production fix is expected. Inline expert self-review recorded 0 findings. The exact restore command ran and reported Restored False because no baseline state had been created.
Full narrative: ../try-fix-1/content.md
Candidate 2 — Test-Side Screenshot Stabilization (gpt-5.6-sol)
Result: Blocked
Approach: Wait for Android navigation-bar/native AppBarLayout collapse layout and deferred inset propagation to settle before ToggleHasNavigationBar_HidesBar_Visual and ShellPages_NavBarVisibilityHide capture screenshots.
Prior approaches avoided: Unlike the PR, this candidate would change capture timing instead of accepting new pixels through PNG replacement. Unlike Candidate 1's generic baseline-gated hypothesis, it identifies a specific frame-sampling race and does not reopen or rerun Candidate 1.
Mechanism-level difference: The PR changes what frame is expected. Candidate 2 would causally order screenshot capture after collapse layout and deferred inset dispatch reach final geometry, preventing an intermediate frame from being sampled.
Files changed / diff: None; candidate diff is empty.
Verification: The baseline command again stopped on the preserved pre-existing dirty worktree before creating .github/.baseline-state.json or a RevertedFiles allow-list. The focused Android UI-test command was therefore not run; no full suite, gate, correction, or retest ran.
Failure analysis: This hypothesis was not disproved; it could not be implemented within the mandatory safety boundary. Editing test source without an allow-list would be unrestorable, while editing the excluded PNGs would repeat the PR. Inline expert self-review recorded 0 findings. The exact restore command ran and correctly reported Restored False because no baseline state existed.
Full narrative: ../try-fix-2/content.md
Aggregate Outcome
Two candidates were attempted in the required order and no further candidates were launched. Both are Blocked, with no tracked candidate changes and no empirical pass/fail result. The common blocker is the mandatory baseline script rejecting the pre-existing dirty worktree before it can evaluate this snapshot-only PR; the PR's only changed paths are also excluded by the baseline detector.
🏁 Report — Final Recommendation
⚠️ Final Recommendation: REQUEST CHANGES
Winner: pr-plus-reviewer
pr-plus-reviewer best preserves the submitted fix while making the two affected visual assertions resilient to the asynchronous layout settling introduced by #38058. The PR's replacement images are visually credible: the old baselines clip top content, the new 1080×1735 images restore the expected safe-area offset, and the expert review found no concrete defect. However, the submitted PR does not contain the bounded retry hardening, so selecting this candidate requires changes to PR HEAD.
Comparative Ranking
| Rank | Candidate | Change | Validation | Assessment |
|---|---|---|---|---|
| 1 | pr-plus-reviewer |
Keeps both submitted PNGs and adds a 2-second retryTimeout to the two hidden-toolbar screenshot assertions |
Build/deploy passed; both tests failed in unchanged WaitForElement setup before reaching the modified assertions |
Best mechanism and narrowest hardening; result remains unverified rather than disproved |
| 2 | pr |
Replaces NavBarHidden.png and ShellPages_NavBarVisibilityHide.png with settled-layout captures |
Gate skipped; no focused test result | Pixels and #38058's root cause align, but asynchronous capture stability is implicit and merge evidence is absent |
| 3 | try-fix-2 |
Proposed waiting for AppBar collapse/inset propagation before capture | Blocked before edits; no diff and no tests | Sound concept, but pr-plus-reviewer is its concrete implementation |
| 4 | try-fix-1 |
Generic baseline-gated alternative | Blocked before edits; no diff and no tests | No implementation or mechanism beyond the safety boundary |
No candidate produced a passing regression run, so there is no passed candidate that a failed candidate could outrank. pr-plus-reviewer's two failures occurred before either changed line and therefore provide no candidate-specific regression signal; they are still recorded as failed validation and cap confidence.
Expert Review
inline-findings.jsoncontains[]; the single permitted MAUI expert pass found no actionable line-addressable issue in the binary-only submitted diff.- Old and new captures have identical dimensions.
- The visible-toolbar adjacent baseline remains unchanged.
- The new images match #38058's intended post-collapse safe-area geometry instead of the visibly clipped intermediate state.
Required Change
Apply pr-plus-reviewer/reviewer.patch, which adds the repository-preferred bounded retryTimeout to:
ToggleHasNavigationBar_HidesBar_VisualforNavBarHiddenShellPages_NavBarVisibilityHide
Do not add arbitrary sleeps or tolerance. The next CI run should confirm that both tests reach and pass their screenshot assertions; this review does not claim they passed locally.
Confidence
Low. The design comparison favors pr-plus-reviewer, but Gate skipped the raw PR and the one focused candidate run failed during page setup before exercising either the PNGs or reviewer changes.
📱 UI Tests — Button,Label,Layout
Detected UI test categories: Button,Label,Layout
✅ Deep UI tests — 422 passed, 0 failed, 7 skipped across 3 categories on platform-pool agent (replaces in-process counts above).
🧪 UI Test Execution Results (deep, platform pool)
| Category | Tests | Snapshot diffs |
|---|---|---|
Button |
104/106 (2 skipped) ✓ | — |
Label |
123/125 (2 skipped) ✓ | — |
Layout |
195/198 (3 skipped) ✓ | — |
📎 Download drop-deep-uitests artifact (TRX + snapshot diffs) |
🧭 Next Steps — reviewer changes required
The reviewer-enhanced candidate identified changes that are not yet in the submitted PR.
Why: The PR's two Android baselines match the settled safe-area geometry from #38058, and pr-plus-reviewer strengthens the affected assertions with bounded retries for that asynchronous layout. Its only validation run failed in unchanged setup waits before reaching either modified assertion, so the improvement is preferred with low confidence rather than claimed as passing.
Address the actionable findings in this review before merging.
This comment has been minimized.
This comment has been minimized.
Tests Failure Analysis
🧪 CI Analysis — click to expand📊 maui-prNo failures found. 🧪 maui-pr-devicetestsNo results available. 🧪 maui-pr-uitestsNo results available. 🧭 Follow-up — actions and refreshNext action: Comment
|
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue.
Thank you!
Description of Change
This PR addresses the UI test snapshot failures that occurred in the net11.0 branch and updates the baselines to match the resolved layout behavior after PR #38058.
In ToggleHasNavigationBar_HidesBar_Visual and ShellPages_NavBarVisibilityHide test cases, added the updated snapshots resulting from fix PR #38058. Previously in PR #36072, insets were redispatched immediately before the native AppBarLayout collapse finished layout, capturing an intermediate state. Deferring the inset dispatch in #38058 allows the layout to settle properly and restores the correct safe-area positioning.
Issues Fixed
Fixes Test cases:
Tested the behaviour in the following platforms