Skip to content

Added a support for GradientBrushes on Shape.Stroke#22208

Merged
kubaflo merged 17 commits into
dotnet:inflight/currentfrom
kubaflo:fix-21983
Apr 7, 2026
Merged

Added a support for GradientBrushes on Shape.Stroke#22208
kubaflo merged 17 commits into
dotnet:inflight/currentfrom
kubaflo:fix-21983

Conversation

@kubaflo

@kubaflo kubaflo commented May 4, 2024

Copy link
Copy Markdown
Contributor

Issues Fixed

Code from this sample: https://github.com/crhalvorson/MauiPathGradientRepro
Fixes #21983

Before After

@kubaflo kubaflo requested a review from a team as a code owner May 4, 2024 14:44
@kubaflo kubaflo requested review from PureWeen and jsuarezruiz May 4, 2024 14:44
@dotnet-policy-service dotnet-policy-service Bot added the community ✨ Community Contribution label May 4, 2024
@jsuarezruiz

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@jsuarezruiz jsuarezruiz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are no changes in public APIs, although the implementation in Windows is missing. I think if we decide to include this enhancement, I can apply changes in this PR by helping to implement on Windows.

@Eilon Eilon added the area-drawing Shapes, Borders, Shadows, Graphics, BoxView, custom drawing label May 6, 2024
@jsuarezruiz

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@jsuarezruiz

Copy link
Copy Markdown
Contributor

There are no changes in public APIs, although the implementation in Windows is missing. I think if we decide to include this enhancement, I can apply changes in this PR by helping to implement on Windows.

@Redth @PureWeen Thoughts?

@kubaflo kubaflo self-assigned this Mar 9, 2025
Copilot AI review requested due to automatic review settings March 8, 2026 10:55
@github-actions

github-actions Bot commented Mar 8, 2026

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 22208

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 22208"

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for applying GradientBrush (linear/radial) to Shape.Stroke, restoring expected behavior for Shapes (e.g., Path, Ellipse) on Android and iOS/macOS platforms, and adds UI test coverage plus baseline snapshots for issue #21983.

Changes:

  • Use the stroke brush to set up gradient paint state during stroke rendering (ShapeDrawable).
  • Implement gradient-aware stroke drawing for Paths on Android (shader) and MaciOS (stroked-path clipping + gradient fill).
  • Add a HostApp repro page + Appium screenshot test and platform baseline images.

Reviewed changes

Copilot reviewed 6 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/Graphics/src/Graphics/Platforms/MaciOS/PlatformCanvas.cs When a gradient is active, stroke a path by converting it to a stroked outline and filling it with the gradient.
src/Graphics/src/Graphics/Platforms/Android/PlatformCanvas.cs Applies the gradient shader to the stroke paint when drawing a path.
src/Core/src/Graphics/ShapeDrawable.cs Uses the stroke brush to set up paint state before calling DrawPath.
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21983.cs Adds an Issues UI test that verifies gradient strokes via screenshot.
src/Controls/tests/TestCases.HostApp/Issues/Issue21983.xaml Adds XAML repro page demonstrating gradient stroke on Path and Ellipse.
src/Controls/tests/TestCases.HostApp/Issues/Issue21983.xaml.cs Code-behind for the new repro page.
src/Controls/tests/TestCases.Android.Tests/snapshots/android/GradientShouldBeAppliedToStrokes.png Android screenshot baseline for the new UI test.
src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/GradientShouldBeAppliedToStrokes.png iOS screenshot baseline for the new UI test.

Comment on lines 550 to 554
if (_shader != null)
{
CurrentState.StrokePaintWithAlpha.SetShader(_shader);
}
_canvas.DrawPath(platformPath, CurrentState.StrokePaintWithAlpha);

Copilot AI Mar 8, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In PlatformDrawPath, the stroke Paint's Shader is only set when _shader != null, but it is never cleared when _shader is null. If a previous draw set a gradient shader, subsequent non-gradient strokes can accidentally keep using the old shader (especially in scenarios where callers draw multiple paths without a state restore). Consider explicitly clearing the shader (SetShader(null)) in the else path, or moving shader application into state so SaveState/RestoreState reliably restores it.

Suggested change
if (_shader != null)
{
CurrentState.StrokePaintWithAlpha.SetShader(_shader);
}
_canvas.DrawPath(platformPath, CurrentState.StrokePaintWithAlpha);
var strokePaint = CurrentState.StrokePaintWithAlpha;
if (_shader != null)
{
strokePaint.SetShader(_shader);
}
else
{
// Ensure we don't reuse a shader from a previous draw when no shader is desired
strokePaint.SetShader(null);
}
_canvas.DrawPath(platformPath, strokePaint);

Copilot uses AI. Check for mistakes.
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.AppiumTests.Issues

Copilot AI Mar 8, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new Issues UITest uses the Microsoft.Maui.AppiumTests.Issues namespace, while other tests under TestCases.Shared.Tests/Tests/Issues commonly use the Microsoft.Maui.TestCases.Tests.Issues namespace. To keep test discovery/grouping consistent with the rest of the Issues suite, consider switching this file to the standard Issues test namespace used in this project.

Suggested change
namespace Microsoft.Maui.AppiumTests.Issues
namespace Microsoft.Maui.TestCases.Tests.Issues

Copilot uses AI. Check for mistakes.
@kubaflo

kubaflo commented Mar 8, 2026

Copy link
Copy Markdown
Contributor Author

🤖 AI Summary

📊 Expand Full Review
🔍 Pre-Flight — Context & Validation
📝 Review SessionAdded a support for GradientBrushes on Shape.Stroke (#21983) · bb9a0fb

Issue: #21983 - GradientBrushes are not supported on Shape.Stroke
PR: #22208 - Added a support for GradientBrushes on Shape.Stroke
Author: kubaflo
Platforms Affected: Android, iOS (Windows excluded - future work)
Files Changed: 3 implementation files, 3 test files, 2 snapshot baselines

Issue Summary

When applying a LinearGradientBrush or RadialGradientBrush to the Stroke property of a Shape (Path, Ellipse, etc.), only the first color of the gradient was applied (as if it were a SolidColorBrush). Fill and Background gradients worked correctly. This was a regression from Xamarin.Forms.

Fix Approach

The PR uses a layered approach:

  1. ShapeDrawable.cs (cross-platform): Calls canvas.SetFillPaint(stroke, dirtyRect) before DrawPath, so the paint state includes gradient info when drawing strokes.
  2. PlatformCanvas.cs (Android): In PlatformDrawPath, applies _shader (set by SetFillPaint) to StrokePaintWithAlpha before drawing.
  3. PlatformCanvas.cs (MaciOS): In PlatformDrawPath, when _gradient != null, uses FillWithGradient with ReplacePathWithStrokedPath() to convert the stroke to a filled outline and fill it with the gradient.

Reviewer Feedback Summary

Reviewer Comment Status
jsuarezruiz Windows implementation is missing ⚠️ Open
Copilot Android: shader not cleared when _shader == null (gradient bleed risk) ⚠️ Open
Copilot Test uses wrong namespace AppiumTests.Issues vs TestCases.Tests.Issues ⚠️ Open

Concerns Identified

File:Location Issue Severity
PlatformCanvas.cs (Android):550-554 _shader applied to StrokePaintWithAlpha but never cleared when null - gradient could bleed to subsequent non-gradient strokes ⚠️ Medium
Issue21983.cs:6 Wrong namespace: Microsoft.Maui.AppiumTests.Issues instead of Microsoft.Maui.TestCases.Tests.Issues ⚠️ Low
Issue21983.cs Missing newline at end of file ℹ️ Minor
Issue21983.cs:1 Wrapped in #if !WINDOWS - test skipped on Windows ℹ️ Intentional
Windows No gradient stroke implementation for Windows ⚠️ Missing

Fix Candidates

# Source Approach Test Result Files Changed Notes
PR PR #22208 SetFillPaint + platform-specific shader/gradient for stroke drawing ⏳ PENDING (Gate) ShapeDrawable.cs, Android/PlatformCanvas.cs, MaciOS/PlatformCanvas.cs Original PR

🚦 Gate — Test Verification
📝 Review SessionAdded a support for GradientBrushes on Shape.Stroke (#21983) · bb9a0fb

Result: ⚠️ PARTIAL - Environment Blocker
Platform: android
Mode: Full Verification (attempted)

Check Expected Actual Result
Tests WITHOUT fix FAIL FAIL
Tests WITH fix PASS INCONCLUSIVE (ADB0010: Broken pipe) ⚠️

Tests FAIL without fix ✅ - Confirmed. The build succeeded and tests failed as expected (screenshot mismatch - gradient not applied to stroke).

Tests WITH fix - BLOCKED ❌ - The Android emulator became unresponsive after the first ~15-minute test run. The second deployment attempt failed with ADB0010: Mono.AndroidTools.InstallFailedException: Unexpected install output: cmd: Failure calling service package: Broken pipe (32). This is a transient infrastructure issue, not a code problem.

Decision: Proceeding to Report per autonomous execution rules (Gate fails due to environment → proceed to Report).


🔧 Fix — Analysis & Comparison
📝 Review SessionAdded a support for GradientBrushes on Shape.Stroke (#21983) · bb9a0fb

Fix Candidates

# Source Approach Test Result Files Changed Notes
PR PR #22208 SetFillPaint + platform shader/gradient for stroke drawing ⚠️ INCONCLUSIVE (Gate environment blocker) 3 files Original PR

Exhausted: N/A (Skipped - Gate environment blocker prevented full verification)
Selected Fix: PR's fix (skipped try-fix exploration due to Gate not completing)

Reason for skipping: The Gate's "with fix" run failed due to an Android emulator infrastructure issue (ADB0010: Broken pipe). Per autonomous execution rules, try-fix exploration requires Gate to pass first. Skipping Phase 3 and proceeding to Report.


📋 Report — Final Recommendation
📝 Review SessionAdded a support for GradientBrushes on Shape.Stroke (#21983) · bb9a0fb

⚠️ Final Recommendation: REQUEST CHANGES

Summary

PR #22208 implements GradientBrush support on Shape.Stroke for Android and iOS/macOS, fixing issue #21983. The approach is conceptually sound and the screenshot baseline images confirm the visual result is correct. However, there are two code quality issues that should be addressed before merging: an Android state management bug that could cause gradient bleed between consecutive non-gradient strokes, and a wrong test namespace that breaks test organization.

Root Cause

The DrawStrokePath method in ShapeDrawable previously only called canvas.StrokeColor = stroke.ToColor(), which resolves a GradientBrush to just its first color (via ToColor()). The fix adds canvas.SetFillPaint(stroke, dirtyRect) which passes the full gradient paint state to the platform canvas before DrawPath is called. Each platform canvas then uses that gradient state during stroke drawing:

  • Android: Applies _shader to StrokePaintWithAlpha in PlatformDrawPath
  • iOS/macOS: Converts the path to a stroked outline via ReplacePathWithStrokedPath() then fills it with FillWithGradient

Issues Found

1. ⚠️ Android: Shader not cleared for non-gradient strokes (potential regression)

File: src/Graphics/src/Graphics/Platforms/Android/PlatformCanvas.cs:550-554

// Current code (PR):
if (_shader != null)
{
    CurrentState.StrokePaintWithAlpha.SetShader(_shader);
}
_canvas.DrawPath(platformPath, CurrentState.StrokePaintWithAlpha);

When _shader == null (solid color stroke), StrokePaintWithAlpha.SetShader() is never called. If a previous draw call set a gradient shader on StrokePaintWithAlpha, that shader persists. RestoreState() disposes _shader (sets it to null) but does not clear the shader reference on StrokePaintWithAlpha. This means a solid-color stroke rendered after a gradient stroke on the same canvas could accidentally inherit the old gradient.

Suggested fix:

var strokePaint = CurrentState.StrokePaintWithAlpha;
strokePaint.SetShader(_shader != null ? _shader : null);  // Always set (clears if null)
_canvas.DrawPath(platformPath, strokePaint);

Or use the Copilot-suggested else { strokePaint.SetShader(null); } pattern.

2. ⚠️ Wrong test namespace (breaks test organization)

File: src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21983.cs:6

// Current (wrong):
namespace Microsoft.Maui.AppiumTests.Issues

// Expected (correct):
namespace Microsoft.Maui.TestCases.Tests.Issues

All other tests in Tests/Issues/ use Microsoft.Maui.TestCases.Tests.Issues. Using the wrong namespace may cause test runners to not discover or categorize the test correctly with the rest of the Issues test suite.

3. ℹ️ Minor: Missing newline at end of test file

File: src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21983.cs - No \n at end of file.

4. ℹ️ Windows not implemented

The PR adds a TODO comment and #if !WINDOWS guard on the test. This is acceptable for an initial implementation, but Windows support remains absent (noted by reviewer jsuarezruiz).

Fix Quality Assessment

The core fix approach is correct and the visual results are confirmed by the screenshot baselines in the PR. The platform implementations use appropriate native mechanisms (Android shader, iOS/macCatalyst stroked path fill). The main concern is the Android state management gap that could cause regressions in mixed gradient/solid-color rendering scenarios.

Gate Result

⚠️ PARTIAL - Tests confirmed to FAIL without fix (bug correctly reproduced). "With fix" run was blocked by Android emulator infrastructure failure (ADB0010: Broken pipe) — environment issue, not a code problem. try-fix phase skipped due to Gate not completing.

Requested Changes

  1. Fix Android shader clearing: Add else { CurrentState.StrokePaintWithAlpha.SetShader(null); } in PlatformDrawPath to prevent gradient shader bleed.
  2. Fix test namespace: Change Microsoft.Maui.AppiumTests.IssuesMicrosoft.Maui.TestCases.Tests.Issues.
  3. Add newline: Add trailing newline to Issue21983.cs.

📋 Expand PR Finalization Review
Title: ✅ Good

Current: Added a support for GradientBrushes on Shape.Stroke

Description: ⚠️ Needs Update
  • Grammar: "Added a support" — git commit titles use imperative mood ("Add", not "Added a")
  • Missing platform prefix — Windows is not fixed (still has a TODO for Windows in ShapeDrawable.cs), so this PR is Android + iOS/macCatalyst only
  • Vague: doesn't call out which control category (Shape)

✨ Suggested PR Description

[!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!

Root Cause

ShapeDrawable.DrawStrokePath had a TODO comment acknowledging that Paint (gradient) support was missing for Shape.Stroke. The method called canvas.StrokeColor = stroke.ToColor(), which extracts only the first color stop from any GradientBrush, effectively reducing it to a solid color. canvas.SetFillPaint() — the mechanism that configures gradient shaders on each platform — was never called for stroke paths, so gradient brushes on Stroke rendered as solid colors.

Description of Change

Three platform-level changes enable gradient stroke rendering on Android and iOS/macCatalyst:

src/Core/src/Graphics/ShapeDrawable.cs

  • Added canvas.SetFillPaint(stroke, dirtyRect) call before canvas.DrawPath(path) in DrawStrokePath
  • Updated the TODO comment to scope it to Windows only (since Android and iOS are now fixed)
  • The existing canvas.StrokeColor = stroke.ToColor() is preserved as the Windows fallback (solid color)

src/Graphics/src/Graphics/Platforms/Android/PlatformCanvas.cs

  • In PlatformDrawPath, applies _shader (set by SetFillPaint) to CurrentState.StrokePaintWithAlpha before drawing, enabling gradient-stroked paths on Android

src/Graphics/src/Graphics/Platforms/MaciOS/PlatformCanvas.cs

  • In PlatformDrawPath, when _gradient is set (by SetFillPaint), uses the existing FillWithGradient() + CGContext.ReplacePathWithStrokedPath() pattern — the standard Core Graphics technique for clipping a gradient fill to the outline of a stroked path

Platforms Fixed

  • ✅ Android
  • ✅ iOS / macCatalyst
  • ❌ Windows — still pending (TODO in ShapeDrawable.cs); falls back to solid color (first gradient stop)

Issues Fixed

Fixes #21983

Before / After

Before After
Code Review: ⚠️ Issues Found

Code Review — PR #22208

🔴 Critical Issues

Android: Gradient shader not cleared after use — subsequent solid-color strokes will render with previous gradient

File: src/Graphics/src/Graphics/Platforms/Android/PlatformCanvas.cs

Problem:
StrokePaintWithAlpha returns the same _strokePaint object each time (it only updates the ARGB color via SetARGB). When PlatformDrawPath calls CurrentState.StrokePaintWithAlpha.SetShader(_shader), the shader persists on _strokePaint across subsequent draw calls. There is no path to clear it:

  • SetFillPaintShader(null) (called by SetFillPaint when switching to a non-gradient paint) only clears FillPaint's shader — not StrokePaint's shader.
  • When the next shape draws a solid-color stroke, _shader is null and the if (_shader != null) block is skipped — so StrokePaintWithAlpha's shader is never cleared.

In Android, a Paint with a Shader renders using the shader's colors (the solid color set via SetARGB is ignored). This means all subsequent solid-color stroke operations after any gradient stroke will still render using the previous gradient's colors.

Current code (buggy):

protected override void PlatformDrawPath(PathF aPath)
{
    var platformPath = aPath.AsAndroidPath();
    if (_shader != null)
    {
        CurrentState.StrokePaintWithAlpha.SetShader(_shader);
    }
    // ❌ If _shader is null, the old shader remains on StrokePaintWithAlpha
    _canvas.DrawPath(platformPath, CurrentState.StrokePaintWithAlpha);
    platformPath.Dispose();
}

Recommended fix:

protected override void PlatformDrawPath(PathF aPath)
{
    var platformPath = aPath.AsAndroidPath();
    // Always set (or clear) the shader — passing null explicitly removes it from the Paint
    CurrentState.StrokePaintWithAlpha.SetShader(_shader);
    _canvas.DrawPath(platformPath, CurrentState.StrokePaintWithAlpha);
    platformPath.Dispose();
}

This same pattern is missing for all other PlatformDraw* methods that use StrokePaintWithAlpha (e.g. DrawLine, DrawArc, DrawRectangle, DrawRoundedRectangle, DrawOval) — they also don't apply the gradient shader. However, Shape.Stroke only routes through PlatformDrawPath, so those other methods are lower risk for this specific PR.


🟡 Suggestions

1. Missing newline at end of Issue21983.cs

File: src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21983.cs

The file ends without a trailing newline (\ No newline at end of file). This is a minor style issue that can cause noisy diffs in the future.

Fix: Add a newline after #endif.


2. PlatformAffected.All is misleading on the HostApp issue attribute

File: src/Controls/tests/TestCases.HostApp/Issues/Issue21983.xaml.cs

[Issue(IssueTracker.Github, 21983, "GradientBrushes are not supported on Shape.Stroke", PlatformAffected.All)]

Windows still has the bug (Shape.Stroke gradient is still a TODO in ShapeDrawable.cs), and the UI test itself is wrapped in #if !WINDOWS. Using PlatformAffected.All implies the fix covers all platforms, which is inaccurate.

Recommended: Change to PlatformAffected.iOS | PlatformAffected.Android (or the equivalent enum values for iOS/macCatalyst + Android) to accurately reflect what this PR fixes.


✅ Looks Good

  • iOS/macCatalyst implementation is clean and correct. Using CGContext.ReplacePathWithStrokedPath() to convert the stroke outline to a clippable fill path, then rendering the gradient via FillWithGradient(), is the standard and well-established Core Graphics pattern. The FillWithGradient helper correctly handles the save/clip/draw/restore lifecycle.

  • ShapeDrawable.cs approach is sound. Calling SetFillPaint(stroke, dirtyRect) before DrawPath correctly reuses the existing gradient infrastructure without duplicating gradient-setup logic. The TODO comment update accurately scopes the remaining Windows limitation.

  • Test coverage is appropriate. A screenshot comparison test with two gradient brush types (Linear and Radial) on two shape types (Path and Ellipse) covers the key scenarios. The #if !WINDOWS guard is correct given the Windows limitation.

  • Before/after screenshots in the PR description clearly demonstrate the fix visually.


@kubaflo kubaflo added s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review) labels Mar 8, 2026
@MauiBot MauiBot added the s/agent-fix-win AI found a better alternative fix than the PR label Mar 23, 2026
PureWeen and others added 5 commits March 25, 2026 09:44
…otnet#34548)

<!-- Please let the below note in for people that find this PR -->
> [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

## Description

Adds a [gh-aw (GitHub Agentic
Workflows)](https://github.github.com/gh-aw/introduction/overview/)
workflow that automatically evaluates test quality on PRs using the
`evaluate-pr-tests` skill.

### What it does

When a PR adds or modifies test files, this workflow:
1. **Checks out the PR branch** (including fork PRs) in a pre-agent step
2. **Runs the `evaluate-pr-tests` skill** via Copilot CLI in a sandboxed
container
3. **Posts the evaluation report** as a PR comment using gh-aw
safe-outputs

### Triggers

| Trigger | When | Fork PR support |
|---------|------|-----------------|
| `pull_request` | Automatic on test file changes (`src/**/tests/**`) |
❌ Blocked by `pre_activation` gate |
| `workflow_dispatch` | Manual — enter PR number | ✅ Works for all PRs |
| `issue_comment` (`/evaluate-tests`) | Comment on PR | ⚠️ Same-repo
only (see Known Limitations) |

### Security model

| Layer | Implementation |
|-------|---------------|
| **gh-aw sandbox** | Agent runs in container with scrubbed credentials,
network firewall |
| **Safe outputs** | Max 1 PR comment per run, content-limited |
| **Checkout without execution** | `steps:` checks out PR code but never
executes workspace scripts |
| **Base branch restoration** | `.github/skills/`,
`.github/instructions/`, `.github/copilot-instructions.md` restored from
base branch after checkout |
| **Fork PR activation gate** | `pull_request` events blocked for forks
via `head.repo.id == repository_id` |
| **Pinned actions** | SHA-pinned `actions/checkout`,
`actions/github-script`, etc. |
| **Minimal permissions** | Each job declares only what it needs |
| **Concurrency** | One evaluation per PR, cancels in-progress |
| **Threat detection** | gh-aw built-in threat detection analyzes agent
output |

### Files added/modified

- `.github/workflows/copilot-evaluate-tests.md` — gh-aw workflow source
- `.github/workflows/copilot-evaluate-tests.lock.yml` — Compiled
workflow (auto-generated by `gh aw compile`)
- `.github/skills/evaluate-pr-tests/scripts/Gather-TestContext.ps1` —
Test context gathering script (binary-safe file download, path traversal
protection)
- `.github/instructions/gh-aw-workflows.instructions.md` — Copilot
instructions for gh-aw development

### Known Limitations

**Fork PR evaluation via `/evaluate-tests` comment is not supported in
v1.** The gh-aw platform inserts a `checkout_pr_branch.cjs` step after
all user steps, which may overwrite base-branch skill files restored for
fork PRs. This is a known gh-aw platform limitation — user steps always
run before platform-generated steps, with no way to insert steps after.

**Workaround:** Use `workflow_dispatch` (Actions UI → "Run workflow" →
enter PR number) to evaluate fork PRs. This trigger bypasses the
platform checkout step entirely and works correctly.

**Related upstream issues:**
- [github/gh-aw#18481](github/gh-aw#18481) —
"Using gh-aw in forks of repositories"
- [github/gh-aw#18518](github/gh-aw#18518) —
Fork detection and warning in `gh aw init`
- [github/gh-aw#18520](github/gh-aw#18520) —
Fork context hint in failure messages
- [github/gh-aw#18521](github/gh-aw#18521) —
Fork support documentation

### Fixes

- Fixes dotnet#34602

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
## Summary

Enables the copilot-evaluate-tests gh-aw workflow to run on fork PRs by
adding `forks: ["*"]` to the `pull_request` trigger and removing the
fork guard from `Checkout-GhAwPr.ps1`.

## Changes

1. **copilot-evaluate-tests.md**: Added `forks: ["*"]` to opt out of
gh-aw auto-injected fork activation guard. Scoped `Checkout-GhAwPr.ps1`
step to `workflow_dispatch` only (redundant for other triggers since
platform handles checkout).

2. **copilot-evaluate-tests.lock.yml**: Recompiled via `gh aw compile` —
fork guard removed from activation `if:` conditions.

3. **Checkout-GhAwPr.ps1**: Removed the `isCrossRepository` fork guard.
Updated header docs and restore comments to accurately describe behavior
for all trigger×fork combinations (including corrected step ordering).

4. **gh-aw-workflows.instructions.md**: Updated all stale references to
the removed fork guard. Documented `forks: ["*"]` opt-in, clarified
residual risk model for fork PRs, and updated troubleshooting table.

## Security Model

Fork PRs are safe because:
- Agent runs in **sandboxed container** with all credentials scrubbed
- Output limited to **1 comment** via `safe-outputs: add-comment: max:
1`
- Agent **prompt comes from base branch** (`runtime-import`) — forks
cannot alter instructions
- Pre-flight check catches missing `SKILL.md` if fork isn't rebased on
`main`
- No workspace code is executed with `GITHUB_TOKEN` (checkout without
execution)

## Testing

- ✅ `workflow_dispatch` tested against fork PR dotnet#34621
- ✅ Lock.yml statically verified — fork guard removed from `if:`
conditions
- ⏳ `pull_request` trigger on fork PRs can only be verified post-merge
(GitHub Actions reads lock.yml from default branch)

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…taType is compiled (dotnet#34717)

## Description

Adds regression tests for dotnet#34713 verifying the XAML source generator
correctly handles bindings with `Converter={StaticResource ...}` inside
`x:DataType` scopes.

Closes dotnet#34713

## Investigation

After thorough investigation of the source generator pipeline
(`KnownMarkups.cs`, `CompiledBindingMarkup.cs`, `NodeSGExtensions.cs`):

### When converter IS in page resources (compile-time resolution ✅)

`GetResourceNode()` walks the XAML tree, finds the converter resource,
and `ProvideValueForStaticResourceExtension` returns the variable
directly — **no runtime `ProvideValue` call**. The converter is
referenced at compile time.

### When converter is NOT in page resources (runtime resolution ✅)

`GetResourceNode()` returns null → falls through to `IsValueProvider` →
generates `StaticResourceExtension.ProvideValue(serviceProvider)`. The
`SimpleValueTargetProvider` provides the full parent chain, and
`TryGetApplicationLevelResource` checks `Application.Current.Resources`.
The binding IS still compiled into a `TypedBinding` — only the converter
resolution is deferred.

### Verified on both `main` and `net11.0`

All tests pass on both branches.

## Tests added

| Test | What it verifies |
|------|-----------------|
| `SourceGenResolvesConverterAtCompileTime_ImplicitResources` |
Converter in implicit `<Resources>` → compile-time resolution, no
`ProvideValue` |
| `SourceGenResolvesConverterAtCompileTime_ExplicitResourceDictionary` |
Converter in explicit `<ResourceDictionary>` → compile-time resolution,
no `ProvideValue` |
| `SourceGenCompilesBindingWithConverterToTypedBinding` | Converter NOT
in page resources → still compiled to `TypedBinding`, no raw `Binding`
fallback |
| `BindingWithConverterFromAppResourcesWorksCorrectly` × 3 | Runtime
behavior correct for all inflators (Runtime, XamlC, SourceGen) |

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
<!-- Please let the below note in for people that find this PR -->
> [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

## Description

Adds arcade inter-branch merge workflow and configuration to automate
merging `net11.0` into the `release/11.0.1xx-preview3` branch.

### Files added

| File | Purpose |
|------|---------|
| `github-merge-flow-release-11.jsonc` | Merge flow config — source
`net11.0`, target `release/11.0.1xx-preview3` |
| `.github/workflows/merge-net11-to-release.yml` | GitHub Actions
workflow — triggers on push to net11.0, daily cron, manual dispatch |

### How it works

Uses the shared [dotnet/arcade inter-branch merge
infrastructure](https://github.com/dotnet/arcade/blob/main/.github/workflows/inter-branch-merge-base.yml):
- **Event-driven**: triggers on push to `net11.0`, with daily cron
safety net
- **ResetToTargetPaths**: auto-resets `global.json`, `NuGet.config`,
`eng/Version.Details.xml`, `eng/Versions.props`, `eng/common/*` to
target branch versions
- **QuietComments**: reduces GitHub notification noise
- Skips PRs when only Maestro bot commits exist

### Incrementing for future releases

When cutting a new release (e.g., preview4), update:
1. `github-merge-flow-release-11.jsonc` → change `MergeToBranch` value
2. `.github/workflows/merge-net11-to-release.yml` → update workflow
`name` field

Follows the same pattern as `merge-main-to-net11.yml` /
`github-merge-flow-net11.jsonc`.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->



<!-- Enter description of the fix in this section -->

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Fixes dotnet#33355

### Description of Change

This report has the goal to provide a detailed progress on the solution
of the memory-leak

The test consists doing 100 navigations between 2 pages, as the image
below suggest

<img width="876" height="502" alt="image"
src="https://github.com/user-attachments/assets/e9e80768-dd40-4445-9fc8-90469579236c"
/>


Running the gc-dump on the desired objects this is what I found.

> BaseLine is the dump when the app starts.

| | | | | |
| ------------------------------------ | ------- | ------------ |
-------------- | ------------------------ |
| Object Type | Count | Size (Bytes) | Expected Count | Status |
| **Page2** | **100** | 84,000 | 1 | ❌ **LEAKED** (99 extra) |
| **PageHandler** | **103** | 9,888 | 4 | ❌ **LEAKED** (99 extra) |
| **StackNavigationManager** | **102** | 16,320 | 1 | ❌ **LEAKED** (101
extra) |
| **StackNavigationManager.Callbacks** | **102** | 5,712 | 1 | ❌
**LEAKED** (101 extra) |
| **NavigationViewFragment** | **102** | 5,712 | ~2 | ❌ **LEAKED** (100
extra) |

So the first fix was to call `Disconnect` handler, on the
`previousDetail` during the `FlyoutPage.Detail_set`. The PageChanges and
Navigated events will not see this, since this `set` is not considered a
navigation in .Net Maui.

After that we see the following data

| | | | | |
| ------------------------------------ | ------- | ------------ |
---------------------- | ------------ |
| Object Type | Count | Size (Bytes) | vs Baseline | Status |
| **Page2** | **100** | 84,000 | Same | ❌ **LEAKED** |
| **PageHandler** | **103** | 9,888 | Same | ❌ **LEAKED** |
| **StackNavigationManager** | **102** | 16,320 | Same | ❌ **LEAKED** |
| **StackNavigationManager.Callbacks** | **1** | 56 | ✅ **FIXED!** (was
102) | ✅ **Good!** |
| **NavigationViewFragment** | **102** | 5,712 | Same | ❌ **LEAKED** |

So, calling the Disconnect handler will fix the leak at
`StackNavigationManager.Callbacks`. Next step was to investigate the
`StackNavigationManager` and see what's holding it.

On `StackNavigationManager` I see lot of object that should be cleaned
up in order to release other references from it. After cleaning it up
the result is

|   |   |   |   |   |
|---|---|---|---|---|
|Object Type|Count|Size (Bytes)|vs Baseline|Status|
|**Page2**|**1**|840|✅ **FIXED!** (was 100)|✅ **Perfect!**|
|**PageHandler**|**4**|384|✅ **FIXED!** (was 103)|✅ **Perfect!**|
|**StackNavigationManager**|**102**|16,320|❌ Still leaking (was 102)|❌
**Unchanged**|
|**StackNavigationManager.Callbacks**|**1**|56|✅ Fixed (was 102)|✅
**Good!**|
|**NavigationViewFragment**|**102**|5,712|❌ Still leaking (was 102)|❌
**Unchanged**|

So something is still holding the `StackNavigationManager` and
`NavigationViewFragment` so I changed the approach and found that
`NavigationViewFragment` is holding everything and after fixing that,
cleaning it up on `Destroy` method. here's the result

|   |   |   |   |   |
|---|---|---|---|---|
|Object Type|Count|Size (Bytes)|vs Previous|Status|
|**Page2**|**1**|840|✅ Same|✅ **Perfect!**|
|**PageHandler**|**4**|384|✅ Same|✅ **Perfect!**|
|**StackNavigationManager**|**1**|160|🎉 **FIXED!** (was 102)|🎉
**FIXED!**|
|**StackNavigationManager.Callbacks**|**1**|56|✅ Same|✅ **Perfect!**|
|**NavigationViewFragment**|**102**|5,712|⚠️ Still present|⚠️
**Remaining**|

With that there's still the leak of `NavigationViewFragment`, looking at
the graph the something on Android side is holding it, there's no root
into managed objects, as far the gcdump can tell. I tried to cleanup the
`FragmentManager`, `NavController` and so on but without success (maybe
I did it wrong).

There's still one instance of page 2, somehow it lives longer, I don't
think it's a leak object because since its value is 1. For reference the
Page2 graph is
```
Page2 (1 instance)
 └── PageHandler
     └── EventHandler<FocusChangeEventArgs>
         └── IOnFocusChangeListenerImplementor (Native Android)
             └── UNDEFINED

```


Looking into www I found that android caches those Fragments, sadly in
our case we don't reuse them. The good part is each object has only 56
bytes, so it shouldn't be a big deal, I believe we can take the
improvements made by this PR and keep an eye on that, maybe that's fixed
when moved to Navigation3 implementation.
@kubaflo

kubaflo commented Apr 1, 2026

Copy link
Copy Markdown
Contributor Author

Code Review — PR #22208

Summary

Adds gradient brush (LinearGradientBrush, RadialGradientBrush) support to Shape.Stroke on Android and iOS/macCatalyst. The approach reuses existing fill-gradient infrastructure:

  • ShapeDrawable.cs: Calls canvas.SetFillPaint(stroke, dirtyRect) before DrawPath to set up gradient state.
  • Android PlatformCanvas: Applies _shader to StrokePaintWithAlpha in PlatformDrawPath.
  • iOS PlatformCanvas: Converts the stroke path to a filled outline via ReplacePathWithStrokedPath() and fills with the gradient via FillWithGradient.

The platform implementations are architecturally sound. Backward compatibility for solid color strokes is maintained (SetFillPaint(SolidPaint) sets _shader = null, so PlatformDrawPath skips the shader path).


Findings

❌ Wrong namespace in test file

Issue21983.cs (Shared.Tests) uses namespace Microsoft.Maui.AppiumTests.Issues — this namespace has 0 usages in the codebase. The correct namespace is Microsoft.Maui.TestCases.Tests.Issues (1,205 usages). This will prevent the test from being discovered by the test runner.

📍 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21983.cs:8

⚠️ Missing newline at end of test file

Issue21983.cs is missing a trailing newline.

📍 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21983.cs:26

💡 Add explanatory comment for SetFillPaint usage in stroke path

In ShapeDrawable.DrawStrokePath, canvas.SetFillPaint(stroke, dirtyRect) repurposes the fill-paint API to configure stroke gradients. A brief comment would help future maintainers understand the intent:

// Use SetFillPaint to configure gradient state (shader/CGGradient)
// which PlatformDrawPath will apply to the stroke rendering.
canvas.SetFillPaint(stroke, dirtyRect);

📍 src/Core/src/Graphics/ShapeDrawable.cs:110

💡 Consider clearing shader from StrokePaint after draw (Android)

On iOS, FillWithGradient disposes _gradient after use. On Android, the shader set on StrokePaintWithAlpha is never explicitly cleared. Analysis confirms this is safe (SaveState/RestoreState scoping prevents leaks), but adding CurrentState.StrokePaintWithAlpha.SetShader(null) after the draw would improve symmetry with iOS.

📍 src/Graphics/src/Graphics/Platforms/Android/PlatformCanvas.cs:550-554


Verdict: Needs Changes

The gradient stroke implementation is correct and the platform approaches (shader on Android, stroked-path-to-fill on iOS) are well-chosen. The namespace issue in the test file must be fixed — it will prevent the test from running. Other findings are suggestions.

kubaflo and others added 2 commits April 5, 2026 17:15
Use path.Bounds instead of dirtyRect for SetFillPaint in stroke
rendering. dirtyRect is the full canvas dirty rectangle, so
gradients would be positioned relative to the entire view rather
than the shape geometry. path.Bounds ensures gradients map to the
actual shape bounds, matching the expected visual output.

Also add retryTimeout to VerifyScreenshot for animation stability,
and remove stale snapshots that will be regenerated from CI with
the corrected gradient coordinates.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@kubaflo kubaflo changed the base branch from inflight/current to main April 5, 2026 15:17
@MauiBot MauiBot added s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates s/agent-fix-win AI found a better alternative fix than the PR and removed s/agent-fix-win AI found a better alternative fix than the PR s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates labels Apr 5, 2026
- Android PlatformCanvas: use 'using var' for strokedOutline Path
  to ensure proper disposal even if an exception occurs
- HostApp Issue21983: remove redundant usings, XamlCompilation
  attribute (default since MAUI), and stray blank line

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dotnet dotnet deleted a comment from MauiBot Apr 7, 2026
@dotnet dotnet deleted a comment from MauiBot Apr 7, 2026
@MauiBot

MauiBot commented Apr 7, 2026

Copy link
Copy Markdown
Collaborator

🚦 Gate - Test Before and After Fix

📊 Expand Full Gate26a08bd · Updated snapshots

Gate Result: ⚠️ ENV ERROR

Platform: ANDROID · Base: main · Merge base: 794a9fa6

Test Without Fix (expect FAIL) With Fix (expect PASS)
🖥️ Issue21983 Issue21983 ⚠️ ENV ERROR ✅ PASS — 537s
🔴 Without fix — 🖥️ Issue21983: ⚠️ ENV ERROR · 2004s

(truncated to last 15,000 chars)

nux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010:    at Xamarin.Android.Tasks.FastDeploy.InstallPackage(Boolean installed) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010:    at Xamarin.Android.Tasks.FastDeploy.InstallPackage(Boolean installed) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/.dotnet/packs/Microsoft.Android.Sdk.Linux/36.1.2/tools/Xamarin.Android.Common.Debugging.targets(333,5): error ADB0010:    at Xamarin.Android.Tasks.FastDeploy.RunInstall() [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:20:32.53
* daemon not running; starting now at tcp:5037
* daemon started successfully
  Determining projects to restore...
  All projects are up-to-date for restore.
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13764208
  Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Debug/net10.0-android36.0/Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13764208
  Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Debug/net10.0-android36.0/Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13764208
  Core -> /home/vsts/work/1/s/artifacts/bin/Core/Debug/net10.0-android36.0/Microsoft.Maui.dll
  Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13764208
  Maps -> /home/vsts/work/1/s/artifacts/bin/Maps/Debug/net10.0-android36.0/Microsoft.Maui.Maps.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13764208
  Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.Core/Debug/net10.0-android36.0/Microsoft.Maui.Controls.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13764208
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13764208
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13764208
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13764208
  Controls.Foldable -> /home/vsts/work/1/s/artifacts/bin/Controls.Foldable/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Foldable.dll
  Controls.Xaml -> /home/vsts/work/1/s/artifacts/bin/Controls.Xaml/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Xaml.dll
  Controls.Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.Maps/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Maps.dll
  Microsoft.AspNetCore.Components.WebView.Maui -> /home/vsts/work/1/s/artifacts/bin/Microsoft.AspNetCore.Components.WebView.Maui/Debug/net10.0-android36.0/Microsoft.AspNetCore.Components.WebView.Maui.dll
  Controls.TestCases.HostApp -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Controls.TestCases.HostApp.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13764208
  Graphics -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13764208
  Essentials -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13764208
  Core -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.dll
  Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13764208
  Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Maps.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13764208
  Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13764208
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13764208
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13764208
  Controls.Xaml -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.Xaml.dll
  Controls.Foldable -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.Foldable.dll
  Microsoft.AspNetCore.Components.WebView.Maui -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.AspNetCore.Components.WebView.Maui.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13764208
  Controls.Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.Maps.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:08:46.18
Broadcasting: Intent { act=android.intent.action.CLOSE_SYSTEM_DIALOGS flg=0x400000 }
Broadcast completed: result=0
Broadcasting: Intent { act=android.intent.action.CLOSE_SYSTEM_DIALOGS flg=0x400000 }
Broadcast completed: result=0
  Determining projects to restore...
  Restored /home/vsts/work/1/s/src/TestUtils/src/VisualTestUtils/VisualTestUtils.csproj (in 1.73 sec).
  Restored /home/vsts/work/1/s/src/TestUtils/src/UITest.NUnit/UITest.NUnit.csproj (in 1.1 sec).
  Restored /home/vsts/work/1/s/src/TestUtils/src/UITest.Core/UITest.Core.csproj (in 6 ms).
  Restored /home/vsts/work/1/s/src/TestUtils/src/VisualTestUtils.MagickNet/VisualTestUtils.MagickNet.csproj (in 4.63 sec).
  Restored /home/vsts/work/1/s/src/TestUtils/src/UITest.Appium/UITest.Appium.csproj (in 3.2 sec).
  Restored /home/vsts/work/1/s/src/TestUtils/src/UITest.Analyzers/UITest.Analyzers.csproj (in 3.15 sec).
  Restored /home/vsts/work/1/s/src/Controls/tests/CustomAttributes/Controls.CustomAttributes.csproj (in 5 ms).
  Restored /home/vsts/work/1/s/src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj (in 2.44 sec).
  5 of 13 projects are up-to-date for restore.
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13764208
  Controls.CustomAttributes -> /home/vsts/work/1/s/artifacts/bin/Controls.CustomAttributes/Debug/net10.0/Controls.CustomAttributes.dll
  Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Debug/net10.0/Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13764208
  Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Debug/net10.0/Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13764208
  Core -> /home/vsts/work/1/s/artifacts/bin/Core/Debug/net10.0/Microsoft.Maui.dll
  Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13764208
  Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.Core/Debug/net10.0/Microsoft.Maui.Controls.dll
  VisualTestUtils -> /home/vsts/work/1/s/artifacts/bin/VisualTestUtils/Debug/netstandard2.0/VisualTestUtils.dll
  UITest.Core -> /home/vsts/work/1/s/artifacts/bin/UITest.Core/Debug/net10.0/UITest.Core.dll
  VisualTestUtils.MagickNet -> /home/vsts/work/1/s/artifacts/bin/VisualTestUtils.MagickNet/Debug/netstandard2.0/VisualTestUtils.MagickNet.dll
  UITest.NUnit -> /home/vsts/work/1/s/artifacts/bin/UITest.NUnit/Debug/net10.0/UITest.NUnit.dll
  UITest.Appium -> /home/vsts/work/1/s/artifacts/bin/UITest.Appium/Debug/net10.0/UITest.Appium.dll
  UITest.Analyzers -> /home/vsts/work/1/s/artifacts/bin/UITest.Analyzers/Debug/netstandard2.0/UITest.Analyzers.dll
  Controls.TestCases.Android.Tests -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll
Test run for /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll (.NETCoreApp,Version=v10.0)
VSTest version 18.0.1 (x64)

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
/home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0)
[xUnit.net 00:00:00.10]   Discovering: Controls.TestCases.Android.Tests
[xUnit.net 00:00:00.29]   Discovered:  Controls.TestCases.Android.Tests
NUnit Adapter 4.5.0.0: Test execution started
Running selected tests in /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll
   NUnit3TestExecutor discovered 1 of 1 NUnit test cases using Current Discovery mode, Non-Explicit run
>>>>> 04/07/2026 14:06:35 FixtureSetup for Issue21983(Android)
>>>>> 04/07/2026 14:06:52 The FixtureSetup threw an exception. Attempt 0/1.
Exception details: System.TimeoutException: GradientBrushes are not supported on Shape.Stroke
   at UITest.Appium.HelperExtensions.Wait(Func`1 query, Func`2 satisfactory, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2757
   at UITest.Appium.HelperExtensions.WaitForAtLeastOne(Func`1 query, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2784
   at UITest.Appium.HelperExtensions.WaitForElement(IApp app, String marked, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency, Nullable`1 postTimeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 793
   at Microsoft.Maui.TestCases.Tests._IssuesUITest.NavigateToIssue(String issue) in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/_IssuesUITest.cs:line 54
   at Microsoft.Maui.TestCases.Tests._IssuesUITest.TryToResetTestState() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/_IssuesUITest.cs:line 25
   at Microsoft.Maui.TestCases.Tests.UITest.FixtureSetup() in /_/src/Controls/tests/TestCases.Shared.Tests/UITest.cs:line 576
>>>>> 04/07/2026 14:06:54 FixtureSetup for Issue21983(Android)
>>>>> 04/07/2026 14:07:11 The FixtureSetup threw an exception. Attempt 1/1.
Exception details: System.TimeoutException: GradientBrushes are not supported on Shape.Stroke
   at UITest.Appium.HelperExtensions.Wait(Func`1 query, Func`2 satisfactory, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2757
   at UITest.Appium.HelperExtensions.WaitForAtLeastOne(Func`1 query, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2784
   at UITest.Appium.HelperExtensions.WaitForElement(IApp app, String marked, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency, Nullable`1 postTimeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 793
   at Microsoft.Maui.TestCases.Tests._IssuesUITest.NavigateToIssue(String issue) in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/_IssuesUITest.cs:line 54
   at Microsoft.Maui.TestCases.Tests._IssuesUITest.TryToResetTestState() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/_IssuesUITest.cs:line 25
   at Microsoft.Maui.TestCases.Tests.UITest.FixtureSetup() in /_/src/Controls/tests/TestCases.Shared.Tests/UITest.cs:line 576
>>>>> 04/07/2026 14:07:11 Log types: logcat, bugreport, server
>>>>> 04/07/2026 14:07:12 Log types: logcat, bugreport, server
  Failed GradientShouldBeAppliedToStrokes [47 s]
  Error Message:
   OneTimeSetUp: System.TimeoutException : GradientBrushes are not supported on Shape.Stroke
  Stack Trace:
     at UITest.Appium.HelperExtensions.Wait(Func`1 query, Func`2 satisfactory, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2757
   at UITest.Appium.HelperExtensions.WaitForAtLeastOne(Func`1 query, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2784
   at UITest.Appium.HelperExtensions.WaitForElement(IApp app, String marked, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency, Nullable`1 postTimeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 793
   at Microsoft.Maui.TestCases.Tests._IssuesUITest.NavigateToIssue(String issue) in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/_IssuesUITest.cs:line 54
   at Microsoft.Maui.TestCases.Tests._IssuesUITest.TryToResetTestState() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/_IssuesUITest.cs:line 25
   at Microsoft.Maui.TestCases.Tests.UITest.FixtureSetup() in /_/src/Controls/tests/TestCases.Shared.Tests/UITest.cs:line 576
   at UITest.Appium.NUnit.UITestBase.OneTimeSetup() in /_/src/TestUtils/src/UITest.NUnit/UITestBase.cs:line 221
   at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)

Setup failed for test fixture Microsoft.Maui.TestCases.Tests.Issues.Issue21983(Android)
System.TimeoutException : GradientBrushes are not supported on Shape.Stroke
StackTrace:    at UITest.Appium.HelperExtensions.Wait(Func`1 query, Func`2 satisfactory, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2757
   at UITest.Appium.HelperExtensions.WaitForAtLeastOne(Func`1 query, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2784
   at UITest.Appium.HelperExtensions.WaitForElement(IApp app, String marked, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency, Nullable`1 postTimeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 793
   at Microsoft.Maui.TestCases.Tests._IssuesUITest.NavigateToIssue(String issue) in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/_IssuesUITest.cs:line 54
   at Microsoft.Maui.TestCases.Tests._IssuesUITest.TryToResetTestState() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/_IssuesUITest.cs:line 25
   at Microsoft.Maui.TestCases.Tests.UITest.FixtureSetup() in /_/src/Controls/tests/TestCases.Shared.Tests/UITest.cs:line 576
   at UITest.Appium.NUnit.UITestBase.OneTimeSetup() in /_/src/TestUtils/src/UITest.NUnit/UITestBase.cs:line 221
   at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
NUnit Adapter 4.5.0.0: Test execution complete

Test Run Failed.
Total tests: 1
     Failed: 1
 Total time: 58.0818 Seconds

🟢 With fix — 🖥️ Issue21983: PASS ✅ · 537s
  Determining projects to restore...
  All projects are up-to-date for restore.
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13764208
  Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Debug/net10.0-android36.0/Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13764208
  Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Debug/net10.0-android36.0/Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13764208
  Core -> /home/vsts/work/1/s/artifacts/bin/Core/Debug/net10.0-android36.0/Microsoft.Maui.dll
  Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13764208
  Maps -> /home/vsts/work/1/s/artifacts/bin/Maps/Debug/net10.0-android36.0/Microsoft.Maui.Maps.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13764208
  Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.Core/Debug/net10.0-android36.0/Microsoft.Maui.Controls.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13764208
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13764208
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13764208
  Microsoft.AspNetCore.Components.WebView.Maui -> /home/vsts/work/1/s/artifacts/bin/Microsoft.AspNetCore.Components.WebView.Maui/Debug/net10.0-android36.0/Microsoft.AspNetCore.Components.WebView.Maui.dll
  Controls.Foldable -> /home/vsts/work/1/s/artifacts/bin/Controls.Foldable/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Foldable.dll
  Controls.Xaml -> /home/vsts/work/1/s/artifacts/bin/Controls.Xaml/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Xaml.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13764208
  Controls.Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.Maps/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Maps.dll
  Controls.TestCases.HostApp -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Controls.TestCases.HostApp.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13764208
  Graphics -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13764208
  Essentials -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13764208
  Core -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.dll
  Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13764208
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13764208
  Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Maps.dll
  Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13764208
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13764208
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13764208
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13764208
  Microsoft.AspNetCore.Components.WebView.Maui -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.AspNetCore.Components.WebView.Maui.dll
  Controls.Foldable -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.Foldable.dll
  Controls.Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.Maps.dll
  Controls.Xaml -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.Xaml.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:06:56.83
Broadcasting: Intent { act=android.intent.action.CLOSE_SYSTEM_DIALOGS flg=0x400000 }
Broadcast completed: result=0
Broadcasting: Intent { act=android.intent.action.CLOSE_SYSTEM_DIALOGS flg=0x400000 }
Broadcast completed: result=0
  Determining projects to restore...
  All projects are up-to-date for restore.
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13764208
  Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Debug/net10.0/Microsoft.Maui.Graphics.dll
  Controls.CustomAttributes -> /home/vsts/work/1/s/artifacts/bin/Controls.CustomAttributes/Debug/net10.0/Controls.CustomAttributes.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13764208
  Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Debug/net10.0/Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13764208
  Core -> /home/vsts/work/1/s/artifacts/bin/Core/Debug/net10.0/Microsoft.Maui.dll
  Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13764208
  Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.Core/Debug/net10.0/Microsoft.Maui.Controls.dll
  UITest.Core -> /home/vsts/work/1/s/artifacts/bin/UITest.Core/Debug/net10.0/UITest.Core.dll
  UITest.NUnit -> /home/vsts/work/1/s/artifacts/bin/UITest.NUnit/Debug/net10.0/UITest.NUnit.dll
  UITest.Appium -> /home/vsts/work/1/s/artifacts/bin/UITest.Appium/Debug/net10.0/UITest.Appium.dll
  VisualTestUtils -> /home/vsts/work/1/s/artifacts/bin/VisualTestUtils/Debug/netstandard2.0/VisualTestUtils.dll
  VisualTestUtils.MagickNet -> /home/vsts/work/1/s/artifacts/bin/VisualTestUtils.MagickNet/Debug/netstandard2.0/VisualTestUtils.MagickNet.dll
  UITest.Analyzers -> /home/vsts/work/1/s/artifacts/bin/UITest.Analyzers/Debug/netstandard2.0/UITest.Analyzers.dll
  Controls.TestCases.Android.Tests -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll
Test run for /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll (.NETCoreApp,Version=v10.0)
VSTest version 18.0.1 (x64)

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
/home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0)
[xUnit.net 00:00:00.16]   Discovering: Controls.TestCases.Android.Tests
[xUnit.net 00:00:00.50]   Discovered:  Controls.TestCases.Android.Tests
NUnit Adapter 4.5.0.0: Test execution started
Running selected tests in /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll
   NUnit3TestExecutor discovered 1 of 1 NUnit test cases using Current Discovery mode, Non-Explicit run
>>>>> 04/07/2026 14:16:35 FixtureSetup for Issue21983(Android)
>>>>> 04/07/2026 14:16:38 GradientShouldBeAppliedToStrokes Start
>>>>> 04/07/2026 14:16:41 GradientShouldBeAppliedToStrokes Stop
  Passed GradientShouldBeAppliedToStrokes [3 s]
NUnit Adapter 4.5.0.0: Test execution complete

Test Run Successful.
Total tests: 1
     Passed: 1
 Total time: 19.1990 Seconds

⚠️ Issues found
  • ⚠️ Issue21983 without fix: Exception calling "Matches" with "2" argument(s): "Value cannot be null. (Parameter 'input')"
📁 Fix files reverted (4 files)
  • eng/pipelines/ci-copilot.yml
  • src/Core/src/Graphics/ShapeDrawable.cs
  • src/Graphics/src/Graphics/Platforms/Android/PlatformCanvas.cs
  • src/Graphics/src/Graphics/Platforms/MaciOS/PlatformCanvas.cs

@kubaflo

kubaflo commented Apr 7, 2026

Copy link
Copy Markdown
Contributor Author

/azp run maui-pr-uitests

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@MauiBot

MauiBot commented Apr 7, 2026

Copy link
Copy Markdown
Collaborator

🤖 AI Summary

📊 Expand Full Review26a08bd · Updated snapshots
🔍 Pre-Flight — Context & Validation

Issue: #21983 - GradientBrushes are not supported on Shape.Stroke
PR: #22208 - Added a support for GradientBrushes on Shape.Stroke
Author: kubaflo
Platforms Affected: Android, iOS/macOS (Windows excluded — future work per TODO comment)
Files Changed: 3 implementation files, 3 test files, 3 snapshot baselines

Issue Summary

When applying a LinearGradientBrush or RadialGradientBrush to the Stroke property of a Shape (Path, Ellipse, etc.), only the first color of the gradient was applied (as if it were a SolidColorBrush). Fill and Background gradients worked correctly. Regression from Xamarin.Forms. Affects Android (confirmed at 17.10.0-preview4) and also observed on Windows.

Prior Agent Review

This PR was previously reviewed by the agent (labels: s/agent-reviewed, s/agent-changes-requested, s/agent-fix-win, s/agent-fix-implemented). The prior agent found an issue with Android shader state management and the author implemented the suggested fix. The current PR state reflects those improvements:

  • Android implementation now uses GetFillPath + FillPaintWithAlpha (avoids shader bleed on StrokePaintWithAlpha)
  • Namespace in test file is now correct: Microsoft.Maui.TestCases.Tests.Issues

Fix Approach (Current PR State)

The PR uses a layered gradient-to-stroke pipeline:

  1. ShapeDrawable.cs (cross-platform): Calls canvas.SetFillPaint(stroke, path.Bounds) before canvas.DrawPath(path) to push gradient state (_shader/_gradient) into the platform canvas. Also keeps canvas.StrokeColor = stroke.ToColor() for solid-color fallback on Windows.
  2. PlatformCanvas.cs (Android): In PlatformDrawPath, if _shader != null, converts stroke geometry to a filled outline via StrokePaintWithAlpha.GetFillPath(), then draws with FillPaintWithAlpha (which has the gradient shader from SetFillPaint). Falls back to original DrawPath with StrokePaintWithAlpha when no gradient.
  3. PlatformCanvas.cs (MaciOS): In PlatformDrawPath, if _gradient != null, uses FillWithGradient(() => { ReplacePathWithStrokedPath(); }) to convert the stroke path to a filled outline and render with gradient. Falls back to normal DrawPath(CGPathDrawingMode.Stroke).

Key Findings

  • Gate ✅ PASSED — tests FAIL without fix, PASS with fix
  • The Android approach uses FillPaintWithAlpha (not StrokePaintWithAlpha), which cleanly avoids the shader bleed concern raised in the prior review
  • StrokeColor + SetFillPaint both set state; on non-gradient stroke, _shader/_gradient remains null and the else branch uses the solid color correctly
  • HostApp page tests Path with LinearGradientBrush stroke, Ellipse with RadialGradientBrush stroke, and Ellipse with RadialGradientBrush fill (for comparison)
  • Windows implementation is intentionally deferred (TODO comment updated accordingly)
  • Copilot inline review comments from prior pass are now addressed

Remaining Open Points

  • Windows gradient stroke support not implemented (deferred)
  • SetFillPaint is called even for solid color SolidColorBrush strokes (where _shader will be null); no functional regression but adds a no-op call

Fix Candidates

# Source Approach Test Result Files Changed Notes
PR PR #22208 ShapeDrawable.SetFillPaint + Android GetFillPath/FillPaintWithAlpha + iOS ReplacePathWithStrokedPath/FillWithGradient ✅ PASSED (Gate) ShapeDrawable.cs, Android/PlatformCanvas.cs, MaciOS/PlatformCanvas.cs Original PR, author already incorporated prior agent fix suggestion

🔧 Fix — Analysis & Comparison

Fix Candidates

# Source Approach Test Result Files Changed Notes
1 try-fix (claude-opus-4.6) Direct shader on StrokePaint — skip GetFillPath, apply _shader directly to StrokePaintWithAlpha and draw stroke normally ✅ PASS 3 files Simpler than PR: no geometry conversion, preserves dash/caps/joins naturally
2 try-fix (claude-sonnet-4.6) Add dedicated SetStrokePaint(Paint, RectF) API to ICanvas — proper new method with separate _strokeShader field in Android PlatformCanvas; no changes to PlatformDrawPath ✅ PASS 8 files (ICanvas, AbstractCanvas, PlatformCanvas, PlatformCanvasState, ScalingCanvas, PictureCanvas, ShapeDrawable, 8× PublicAPI.Unshipped.txt) Significant scope: public API change across multiple canvas types; needed 5 test iterations to align gradient bounds
3 try-fix (gpt-5.3-codex) Android SaveLayer + SrcIn mask — draw stroke as opaque mask, then fill bounds with gradient using PorterDuff.Mode.SrcIn; no GetFillPath, no shader assignment, no new API ✅ PASS 2 files Compositional approach; needed layer bounds refinement
4 try-fix (gpt-5.4, gemini unavailable) Bitmap-backed clipped stroke fill — GetFillPath to outline, render gradient to offscreen bitmap for stroke bounds, clip to outline, draw bitmap back ✅ PASS 2 files Most complex approach; offscreen bitmap allocation
PR PR #22208 SetFillPaint + GetFillPath/FillPaintWithAlpha (Android) + ReplacePathWithStrokedPath/FillWithGradient (iOS) ✅ PASSED (Gate) 3 files Original PR

Cross-Pollination

Model Round New Ideas? Details
claude-opus-4.6 2 NO NEW IDEAS "Five approaches exhaustively cover the design space"

Exhausted: Yes
Selected Fix: Attempt 1 (Direct shader on StrokePaint) — Passes all tests, simplest implementation (3 files, no intermediate Path allocation, no geometry conversion), and preserves all stroke attributes (dash, caps, joins) naturally. The PR's GetFillPath converts stroke geometry to fill outline which adds complexity and could subtly alter dash-pattern rendering. Direct SetShader + clear-after is idiomatic Android; the GPU handles gradient coloring natively along the stroke width.


📋 Report — Final Recommendation

⚠️ Final Recommendation: REQUEST CHANGES

Phase Status

Phase Status Notes
Pre-Flight ✅ COMPLETE Issue #21983 — gradient brush not rendered on Shape.Stroke; prior agent review already addressed namespace and shader-bleed issues
Gate ✅ PASSED android — tests FAIL without fix, PASS with fix
Try-Fix ✅ COMPLETE 4 attempts (all ✅ PASS), cross-pollination exhausted; simpler alternative found
Report ✅ COMPLETE

Summary

PR #22208 adds GradientBrush support for Shape.Stroke on Android and iOS/macOS, fixing issue #21983. The fix is correct and the Gate passed. However, try-fix exploration identified a simpler Android implementation (Attempt 1) that avoids the GetFillPath geometry conversion used in the current PR — direct SetShader on StrokePaintWithAlpha is the idiomatic Android approach and preserves all stroke attributes (dash patterns, line caps, joins) without intermediate object allocation.

Root Cause

In ShapeDrawable.DrawStrokePath, canvas.StrokeColor = stroke.ToColor() resolves a GradientBrush to only its first color. The fix adds canvas.SetFillPaint(stroke, path.Bounds) to push full gradient state into the platform canvas, then each platform canvas detects and applies the gradient during PlatformDrawPath.

Fix Quality

The PR's approach is functionally correct and Gate-verified. The suggested alternative simplifies the Android path:

Current PR (Android PlatformDrawPath):

if (_shader != null)
{
    using var strokedOutline = new Path();
    CurrentState.StrokePaintWithAlpha.GetFillPath(platformPath, strokedOutline);
    _canvas.DrawPath(strokedOutline, CurrentState.FillPaintWithAlpha);
}
  • Converts stroke geometry to a fill outline (CPU-side allocation + disposal)
  • Draws the outline with FillPaintWithAlpha (shares fill paint state)

Simpler alternative (Attempt 1):

if (_shader != null)
{
    var strokePaint = CurrentState.StrokePaintWithAlpha;
    strokePaint.SetShader(_shader);
    _canvas.DrawPath(platformPath, strokePaint);
    strokePaint.SetShader(null);  // explicit clear prevents bleed
}
  • No intermediate Path allocation
  • Draws the original stroke path with shader applied — GPU handles gradient coloring
  • Explicitly clears shader after draw (no bleed risk)
  • Preserves stroke attributes (dashes, caps, joins) accurately; GetFillPath converts these into fill geometry which can subtly alter rendering for complex strokes

The iOS approach in both PR and Attempt 1 is functionally equivalent (ReplacePathWithStrokedPath + gradient fill). Attempt 1 uses a direct Clip/DrawGradient sequence instead of the FillWithGradient wrapper, which is slightly more explicit.

Suggested Change (Android only)

In src/Graphics/src/Graphics/Platforms/Android/PlatformCanvas.cs, replace the GetFillPath block with direct shader assignment:

-            if (_shader != null)
-            {
-                using var strokedOutline = new Path();
-                CurrentState.StrokePaintWithAlpha.GetFillPath(platformPath, strokedOutline);
-                _canvas.DrawPath(strokedOutline, CurrentState.FillPaintWithAlpha);
-            }
-            else
-            {
-                _canvas.DrawPath(platformPath, CurrentState.StrokePaintWithAlpha);
-            }
+            if (_shader != null)
+            {
+                var strokePaint = CurrentState.StrokePaintWithAlpha;
+                strokePaint.SetShader(_shader);
+                _canvas.DrawPath(platformPath, strokePaint);
+                strokePaint.SetShader(null);
+            }
+            else
+            {
+                _canvas.DrawPath(platformPath, CurrentState.StrokePaintWithAlpha);
+            }

This was validated as ✅ PASS by Attempt 1 (claude-opus-4.6).

Other Observations

  • Windows gradient stroke is deferred (TODO comment updated) — acceptable for now
  • canvas.StrokeColor = stroke.ToColor() is still called alongside SetFillPaint — for non-gradient strokes _shader is null and the solid color path is taken correctly
  • Test (UITest screenshot + VerifyScreenshot(retryTimeout)) is well-structured and covers Path + Ellipse with both Linear and Radial gradient strokes

@kubaflo kubaflo changed the base branch from main to inflight/current April 7, 2026 14:44
@kubaflo kubaflo merged commit 82f20f8 into dotnet:inflight/current Apr 7, 2026
12 of 36 checks passed
@PureWeen PureWeen mentioned this pull request Apr 14, 2026
PureWeen added a commit that referenced this pull request Apr 29, 2026
## Blazor
- Fix: Filter precompressed RCL assets from MAUI Blazor Hybrid APKs by
@mattleibow in #33917
  <details>
  <summary>🔧 Fixes</summary>

- [.NET MAUI Blazor Hybrid App should not precompress
assets](#33773)
  </details>

- [Windows] Fix for Runtime error when closing external window with WPF
Webview Control by @BagavathiPerumal in
#34006
  <details>
  <summary>🔧 Fixes</summary>

- [Runtime error when closing external window with WPF Webview
Control](#32944)
  </details>

## Button
- [Android] ImageButton CornerRadius not being applied - fix by @kubaflo
in #30074
  <details>
  <summary>🔧 Fixes</summary>

- [ImageButton CornerRadius not being applied on
Android](#23854)
  </details>

- Fix Disabled visual state ignored when Button has locally-set
BackgroundColor/TextColor by @Dhivya-SF4094 in
#34444
  <details>
  <summary>🔧 Fixes</summary>

- [[regression/9.0] VisualState "Disabled" is not properly applied for
Button with custom
appearance](#34363)
  </details>

## CollectionView
- Fix CollectionView grid spacing updates for first row and column by
@KarthikRajaKalaimani in #34527
  <details>
  <summary>🔧 Fixes</summary>

- [[MAUI] I2_Vertical grid for horizontal Item Spacing and Vertical Item
Spacing - horizontally updating the spacing only applies to the second
column](#34257)
  </details>

- Fix CollectionView record struct selection on Windows by
@jeremy-visionaid in #33488

- [Android] Ensure disconnected ItemsViewHandler doesn't hold onto the
items source by @filipnavara in
#24610
  <details>
  <summary>🔧 Fixes</summary>

- [Crash on NullReferenceException with measurement cells in
CollectionView](#24304)
  </details>

- [Windows] Fixed VisualState Setters not working properly for
CollectionView by @Dhivya-SF4094 in
#27230
  <details>
  <summary>🔧 Fixes</summary>

- [VisualState Setters not working properly on Windows for a
CollectionView](#27086)
- [[regression/8.0.3] [Windows][CollectionView]Label Disappear when set
Style in
ContentPage.Resources](#19209)
- [[Windows] Label style defined as ContentPage Resource doesn't
propagate to
CollectionView](#18701)
  </details>

- [Windows] Fixed Margin doesn't work inside CollectionView EmptyView by
@Dhivya-SF4094 in #29897
  <details>
  <summary>🔧 Fixes</summary>

- [Margin doesn't work inside CollectionView
EmptyView](#8494)
  </details>

- [Android, Windows] Fix CarouselView PreviousPosition/PreviousItem
incorrect during animated ScrollTo() by @praveenkumarkarunanithi in
#34570
  <details>
  <summary>🔧 Fixes</summary>

- [[Android] CurrentItemChangedEventArgs.PreviousItem and
PositionChangedEventArgs.PreviousPosition Not Updating Correctly When
Using ScrollTo or Setting
Position](#29544)
  </details>

- [iOS] CarouselView2: Update internal scroll indicators for
compositional layout by @SubhikshaSf4851 in
#33639
  <details>
  <summary>🔧 Fixes</summary>

- [[iOS] Horizontal Scroll Bar Not Visible on CarouselView
(CV2)](#29390)
  </details>

- [CarouselViewHandler2] Fir fox CurrentItem does not work when
ItemSpacing is set by @SyedAbdulAzeemSF4852 in
#32135
  <details>
  <summary>🔧 Fixes</summary>

- [[CarouselViewHandler2] CurrentItem does not work when ItemSpacing is
set](#32048)
  </details>

- [iOS] Fix for Incorrect Scroll in Loop Mode When CurrentItem Is Not
Found in ItemsSource by @SyedAbdulAzeemSF4852 in
#32141
  <details>
  <summary>🔧 Fixes</summary>

- [[Android & iOS] Setting an invalid CurrentItem causes scroll to last
item in looped
CarouselView](#32139)
  </details>

- [Android] IndicatorView: Add TalkBack accessibility descriptions for
indicators by @praveenkumarkarunanithi in
#31775
  <details>
  <summary>🔧 Fixes</summary>

- [[Android] IndicatorView does not convey correct accessibility
information](#31446)
  </details>

- [iOS, macOS] Fixed CollectionView KeepLastItemInView Not Updating
Correctly When Items Are Added Dynamically by @NanthiniMahalingam in
#32191
  <details>
  <summary>🔧 Fixes</summary>

- [[.NET10] I9 - Scroll_Position - "KeepLastItemInView" does not keep
the last item at the end of the displayed list when adding new
items.](#31825)
  </details>

- [Windows, Android] Resolved issue with dynamic Header/Footer
reassignment in CollectionView. by @prakashKannanSf3972 in
#28403
  <details>
  <summary>🔧 Fixes</summary>

- [[Windows, Android] Toggling Header/Footer in CollectionView
Dynamically is not working](#27959)
- [CollectionView HeaderTemplate and FooterTemplate are not displayed
when ItemsSource is initially set to
null](#28337)
- [[Android] Header and Footer Not Visible in CollectionView When
EmptyView is Selected
First](#28351)
  </details>

- [Android] Fix CollectionView inside disabled RefreshView blocks scroll
by @Vignesh-SF3580 in #34702
  <details>
  <summary>🔧 Fixes</summary>

- [C6-The C6 page cannot scroll on Windows and Android
platforms.](#34666)
  </details>

- [Android] CollectionView: Fix SelectedItem visual state not applying
when re-selecting same item by @KarthikRajaKalaimani in
#31591
  <details>
  <summary>🔧 Fixes</summary>

- [CollectionView - SelectedItem visual state manager not
working](#20062)
  </details>

- [Windows] Fixed CollectionView.EmptyView can not be removed by setting
it to Null by @Dhivya-SF4094 in
#29487
  <details>
  <summary>🔧 Fixes</summary>

- [[Windows] CollectionView.EmptyView can not be removed by setting it
to Null](#18657)
- [[Windows] EmptyViewTemplate Not Working in
CarouselView](#29463)
- [EmptyViewTemplate does not do
anything](#18551)
- [[MAUI] I5_EmptyView - The data template selector cannot display the
correct string.](#23330)
  </details>

- [iOS] Support for IsSwipeEnabled on CarouselView2 by @kubaflo in
#29996
  <details>
  <summary>🔧 Fixes</summary>

- [[iOS] IsSwipeEnabled Not Working on CarouselView
(CV2)](#29391)
  </details>

- [iOS, MacOS] Fixed FlowDirection not working on Header/Footer in
CollectionView by @Dhivya-SF4094 in
#32775
  <details>
  <summary>🔧 Fixes</summary>

- [[iOS, MacOS] FlowDirection not working on Header/Footer in
CollectionView](#32771)
  </details>

- [iOS] CollectionView: Fix drag-and-drop reordering into empty groups
by @SuthiYuvaraj in #34151
  <details>
  <summary>🔧 Fixes</summary>

- [CollectionView Drag and Drop Reordering Can't Drop in Empty
Group](#12008)
  </details>

- [Android] CollectionView: Fix drag-and-drop reordering into empty
groups by @SuthiYuvaraj in #31867
  <details>
  <summary>🔧 Fixes</summary>

- [CollectionView Drag and Drop Reordering Can't Drop in Empty
Group](#12008)
  </details>

- [iOS] Fix vertical CarouselView MandatorySingle snapping on iOS by
@Vignesh-SF3580 in #34700
  <details>
  <summary>🔧 Fixes</summary>

- [CarouselView vertical snap points ignored on iOS with
Microsoft.Maui.Controls v10.0.20 (regression from
v9.0.120)](#33308)
  </details>

- [iOS26] Fix CarouselView scrolling to wrong item when navigating to
last item by @Vignesh-SF3580 in
#34013
  <details>
  <summary>🔧 Fixes</summary>

- [[iOS 26] CarouselView does not scroll to the correct last
item](#33770)
  </details>

- Fixed the OnPlatform does not work for header property in Collection
view by @NanthiniMahalingam in #28935
  <details>
  <summary>🔧 Fixes</summary>

- [OnPlatform does not work in Header of
CollectionView](#25124)
  </details>

- [Android] [Candidate branch] Fix
VerifySelectedItemClearsOnNullAssignment,
CollectionViewSelectionShouldClear, SelectedItemVisualIsCleared UI test
failure on Android by @KarthikRajaKalaimani in
#34928

## DateTimePicker
- [iOS] Fix for DatePicker FlowDirection Not Working on iOS by
@SyedAbdulAzeemSF4852 in #30193
  <details>
  <summary>🔧 Fixes</summary>

- [[iOS] DatePicker FlowDirection Not Working on
iOS](#30065)
  </details>

## Drawing
- [Shapes] Line: Fix asymmetric Stretch.None path translation when
right/bottom edge overflows by @NirmalKumarYuvaraj in
#34385
  <details>
  <summary>🔧 Fixes</summary>

- [Line coordinates not computed
correctly](#11404)
- [Lines not drawing
correctly](#26961)
  </details>

- [Android] Fixed GraphicsView drawable is visible outside the canvas by
@NirmalKumarYuvaraj in #28353
  <details>
  <summary>🔧 Fixes</summary>

- [[Android] GraphicsView, The drawn image can also be visible outside
the canvas](#20834)
  </details>

- Fixed Custom Drawable does not support binding by @NirmalKumarYuvaraj
in #29442
  <details>
  <summary>🔧 Fixes</summary>

- [Custom IDrawable control does not databind to a model property when
used inside a CollectionView
ItemTemplate](#20991)
  </details>

- Added a support for GradientBrushes on Shape.Stroke by @kubaflo in
#22208
  <details>
  <summary>🔧 Fixes</summary>

- [GradientBrushes are not supported on
Shape.Stroke](#21983)
  </details>

## Editor
- Fixed Editor HorizontalTextAlignment does not update at run time by
@NirmalKumarYuvaraj in #25129
  <details>
  <summary>🔧 Fixes</summary>

- [Editor HorizontalTextAlignment Does not
Works.](#10987)
- [[iOS/MacOs] Right-To-Left (RTL) alignment is not applied to Editor
placeholder](#30052)
  </details>

- [Windows] Fixed Entry Editor placeholder Text CharacterSpacing by
@SubhikshaSf4851 in #30324
  <details>
  <summary>🔧 Fixes</summary>

- [[Windows] CharacterSpacing not applied to Placeholder text in Entry
and Editor controls](#30071)
  </details>

## Entry
- [Windows] Fix fo setting an Entry's Keyboard to Date causes it to be
interpreted as a password input by @SyedAbdulAzeemSF4852 in
#29344
  <details>
  <summary>🔧 Fixes</summary>

- [[Windows] Entry Keyboad-Type "Date" results in
Password-Entry](#28975)
  </details>

- [Android] Exception thrown when give more than 5000 characters to the
Text property of Entry. by @KarthikRajaKalaimani in
#30242
  <details>
  <summary>🔧 Fixes</summary>

- [Android crash when Entry has >5000
characters](#30144)
  </details>

## Essentials
- Bump MonoApiToolsMSBuildTasksPackageVersion to 0.5.0 and ship
Essentials.AI public APIs by @mattleibow via @Copilot in
#34574

- [Mac] DeviceDisplay.KeepScreenOn not being respected on Mac OS by
@HarishwaranVijayakumar in #32708
  <details>
  <summary>🔧 Fixes</summary>

- [[Mac Catalyst] DeviceDisplay.KeepScreenOn not being respected on Mac
OS](#26059)
  </details>

## Flyoutpage
- [Windows] FlyoutPage: update CollapseStyle at runtime by
@devanathan-vaithiyanathan in #29927
  <details>
  <summary>🔧 Fixes</summary>

- [Flyout Page SetCollapseStyle doesn't have any
change](#18200)
  </details>

## Gestures
- [Android] Fix for TapGestureRecognizer doesn't fire by
@HarishwaranVijayakumar in #34497
  <details>
  <summary>🔧 Fixes</summary>

- [[Android] TapGestureRecognizer doesn't
fire](#5825)
  </details>

## Image
- [Android] Fix Share.RequestAsync SecurityException on Android 10+
caused by missing ClipData by @HarishwaranVijayakumar in
#34417
  <details>
  <summary>🔧 Fixes</summary>

- [[Bug] Share.RequestAsync throws java.lang.SecurityException
(uid=1000) on Android 10+ due to missing
intent.ClipData](#34370)
  </details>

- [Windows]Fixed the MauiImage with logical name containing path issue
by @sheiksyedm in #32864
  <details>
  <summary>🔧 Fixes</summary>

- [MauiImage with LogicalName containing path - is not working on
Windows](#32356)
  </details>

- [Android, Windows & iOS] Fix Downsize/ScaleImage to maintain aspect
ratio and prevent upscaling by @SyedAbdulAzeemSF4852 in
#30808
  <details>
  <summary>🔧 Fixes</summary>

- [[Android & Windows] In GraphicsView, the aspect ratio is not
maintained when Downsize is called with both maxWidth and
maxHeight](#30803)
  </details>

## Label
- [iOS , macOS] Fixed Label text cropping when a width request is
specified on the label inside a VerticalStackLayout with specified width
request by @NanthiniMahalingam in
#29166
  <details>
  <summary>🔧 Fixes</summary>

- [Label text gets cropped when a width request is specified on the
label inside a
VerticalStackLayout](#28660)
- [[iOS] Label with a fixed WidthRequest has wrong
height](#26644)
  </details>

- [Android] Fix Label word wrapping clips text depending on alignment
and layout options by @Dhivya-SF4094 in
#34533
  <details>
  <summary>🔧 Fixes</summary>

- [Bug: Android Label word wrapping clips text depending on alignment
and layout options](#34459)
  </details>

- LineHeight and decorations for HTML Label - fix by @kubaflo in
#31202
  <details>
  <summary>🔧 Fixes</summary>

- [LineHeight with HTML Label not
working](#22193)
  - [lineheight is broken ](#22197)
  </details>

- [iOS] Fix Label with TailTruncation not rendering after
empty-to-non-empty text transition by @kubaflo in
#34812
  <details>
  <summary>🔧 Fixes</summary>

- [Label with LineBreakMode="TailTruncation" does not render text if
initial Text is null or empty on first render
(iOS)](#34591)
  </details>

## Layout
- [Android] Fix overflowing children clipped when parent Opacity < 1 by
@SyedAbdulAzeemSF4852 in #34565
  <details>
  <summary>🔧 Fixes</summary>

- [Maui Android parent view inappropriately creates clipping mask when
its opacity is less than 1, cropping out
children](#22038)
  </details>

- Fixed the FlexLayout reverse issue with the AlignContent by
@Ahamed-Ali in #32134
  <details>
  <summary>🔧 Fixes</summary>

- [FlexLayout alignment issue when Wrap is set to Reverse and
AlignContent is set to SpaceAround, SpaceBetween or
SpaceEvenly](#31565)
  </details>

- [iOS/Mac] Fixed BoxView in AbsoluteLayout did not return to its
default AutoSize for Height and Width after reset by @Dhivya-SF4094 in
#31648
  <details>
  <summary>🔧 Fixes</summary>

- [[iOS, Catalyst] BoxView in AbsoluteLayout does not return to default
AutoSize for Height/Width after
reset](#31496)
  </details>

## Map
- [Windows] Implement WinUI 3 MapControl handler using Azure Maps by
@jfversluis in #34138

## Modal
- [Android] PopToRootAsync for modal pages - improvements by @kubaflo in
#26851
  <details>
  <summary>🔧 Fixes</summary>

- [Shell PopToRootAsync doesn't happen instantly - previous pages flash
quickly. Only happens in NET
9](#26846)
  </details>

- [Android] Fix HideSoftInputOnTapped doesn't work on Modal Pages by
@HarishwaranVijayakumar in #34770
  <details>
  <summary>🔧 Fixes</summary>

- [HideSoftInputOnTapped doesn't work on Modal
Pages](#34730)
  </details>

## Navigation
- [iOS] Alert popup may be displayed on wrong window when modal page
navigation is in progress - fix by @kubaflo in
#31016
  <details>
  <summary>🔧 Fixes</summary>

- [Alert popup may be displayed on wrong window when modal page
navigation is in progress on
iOS/MacOS](#30970)
  </details>

- [Android] Page: Fix OnNavigatedTo called twice when NavigationPage is
FlyoutPage Detail by @KarthikRajaKalaimani in
#31931
  <details>
  <summary>🔧 Fixes</summary>

- [NavigationPage and FlyoutPage both call OnNavigatedTo, so it is
called twice](#23902)
  </details>

## Picker
- Fixed the Picker didn't dismiss it when tapping outside on iOS and
MacCatalyst platform. by @KarthikRajaKalaimani in
#30067
  <details>
  <summary>🔧 Fixes</summary>

- [[regression/8.0.3] iOS Picker dismiss does not work when clicking
outside of the Picker](#19168)
  </details>

- [Windows] Fixed Picker items width wont resize back by
@SubhikshaSf4851 in #33042
  <details>
  <summary>🔧 Fixes</summary>

- [Picker items width won't resize back when its container window gets
resized down.](#32984)
  </details>

## RadioButton
- Fix TalkBack not correctly narrating RadioButtons with Content by
@SubhikshaSf4851 in #34521
  <details>
  <summary>🔧 Fixes</summary>

- [[Android] TalkBack does not correctly narrate RadioButtons with
Content](#34322)
  </details>

## SafeArea
- [Android] Fix SafeAreaShouldWorkOnAllShellTabs test failure on API 36
by @praveenkumarkarunanithi in #34239

## ScrollView
- [iOS] Preserve ScrollView offsets when Orientation changes to Neither
by @Vignesh-SF3580 in #34672
  <details>
  <summary>🔧 Fixes</summary>

- [Incorrect implementation of
ScrollView.Orientation](#34583)
  </details>

## Searchbar
- [Android] Fix SearchBar text bleeding between instances after
navigation by @SyedAbdulAzeemSF4852 in
#34703
  <details>
  <summary>🔧 Fixes</summary>

- [MAUI Android: SearchBar copies content from one to the
other](#20348)
  </details>

- Fixed SearchBar CursorPosition and SelectionLength not updating when
typing by @Dhivya-SF4094 in #34347
  <details>
  <summary>🔧 Fixes</summary>

- [SearchBar - CursorPosition and SelectionLength are not updated when
the user types](#30779)
  </details>

## SearchBar
- [Windows] Fixed SearchHandler issues by @Tamilarasan-Paranthaman in
#29520
  <details>
  <summary>🔧 Fixes</summary>

- [[Windows] SearchHandler APIs are not functioning
properly](#29493)
  </details>

## Shell
- [iOS, Mac] Fix for Background set to Transparent doesn't have the same
behavior as BackgroundColor Transparent by @HarishwaranVijayakumar in
#32245
  <details>
  <summary>🔧 Fixes</summary>

- [Background set to Transparent doesn't have the same behavior as
BackgroundColor =
Transparent](#22769)
  </details>

- [iOS] Fix App crash with NullReferenceException in
ShellSectionRenderer by @devanathan-vaithiyanathan in
#32109
  <details>
  <summary>🔧 Fixes</summary>

- [[iOS] App crash with NullReferenceException in
ShellSectionRenderer](#31961)
  </details>

- [Android] Fixed back button icon selection logic in
ShellToolbarTracker by @kubaflo in
#32080
  <details>
  <summary>🔧 Fixes</summary>

- [IconOverride in Shell.BackButtonBehavior does not
work.](#32050)
  </details>

- Fix TabBarIsVisible Not Updating Dynamically When Set on ShellContent
by @Vignesh-SF3580 in #33090
  <details>
  <summary>🔧 Fixes</summary>

- [Shell.TabBarIsVisible is not updated dynamically at
runtime](#32994)
  </details>

- [iOS, macOS] Shell: Fix RTL flow direction for flyout, menu cells, tab
bar, and Locked flyout position by @NanthiniMahalingam in
#32701
  <details>
  <summary>🔧 Fixes</summary>

- [[iOS, Mac Catalyst] Shell Flyout and Content Do Not Fully Support
RightToLeft (RTL)](#32419)
  </details>

- [IOS] Inconsistent Resize Behavior for Header/Footer - fix by @kubaflo
in #28713
  <details>
  <summary>🔧 Fixes</summary>

- [[IOS, Mac] Inconsistent Resize Behavior for
Header/Footer](#26397)
- [Enable Shell Flyout Header/Footer resize tests on
iOS/Catalyst](#33501)
  </details>

- [Android] Fix for SearchHandler retaining previous page SearchView
data in pages within Shell sections by @BagavathiPerumal in
#29545
  <details>
  <summary>🔧 Fixes</summary>

- [[Shell][Android] The truth is out there...but not on top tab search
handlers](#8716)
  </details>

- [Android] Fix empty space above TabBar after navigating back when
TabBar visibility is toggled by @praveenkumarkarunanithi in
#34324
  <details>
  <summary>🔧 Fixes</summary>

- [Empty space appears above TabBar after navigating back when TabBar
visibility is toggled](#33703)
- [Grid with SafeAreaEdges=Container has incorrect size when tab bar
appears](#34256)
  </details>

## SwipeView
- [Android] SwipeView: Use MeasureSpecMode.Exactly for SwipeItem layout
to fix text visibility by @Ahamed-Ali in
#27399
  <details>
  <summary>🔧 Fixes</summary>

- [[Android] Right SwipeView items are not visible in the
SwipeView.](#27367)
  </details>

- [Android] Prevent the tap that closes an open SwipeView from being
propagated to children by @sjordanGSS in
#24275
  <details>
  <summary>🔧 Fixes</summary>

- [Tapping to close a SwipeView will activate TapGestureRecognizers on
.Content](#23921)
  </details>

## Switch
- [iOS & Mac] Fix for SearchHandler retains previous page state when
switching top tabs by @BagavathiPerumal in
#34735
  <details>
  <summary>🔧 Fixes</summary>

- [[Shell] [iOS & Mac] SearchHandler retains previous page state when
switching top tabs](#34693)
  </details>

## TabbedPage
- [Android] Fixed NullReferenceException in app with TabBar after
returning from minimized state by @NirmalKumarYuvaraj in
#34779
  <details>
  <summary>🔧 Fixes</summary>

- [NullReferenceException in app with TabBar after returning from
minimized state](#34720)
  </details>

## Titlebar
- Fixed BindingContext of the Window TitleBar is not being passed on to
its child content. by @NirmalKumarYuvaraj in
#30080
  <details>
  <summary>🔧 Fixes</summary>

- [The BindingContext of the Window TitleBar is not being passed on to
its child content.](#24831)
  </details>

- [Windows/Mac] Fix RTL FlowDirection causes overlap with native window
control buttons in TitleBar by @devanathan-vaithiyanathan in
#30400
  <details>
  <summary>🔧 Fixes</summary>

- [[Windows, Mac] RTL FlowDirection causes overlap with native window
control buttons in
TitleBar](#30399)
  </details>

## WebView
- [Windows] Fix WebView background color not being applied by
@SubhikshaSf4851 in #34599
  <details>
  <summary>🔧 Fixes</summary>

- [WebView background color has changed after update, can't
override.](#34518)
  </details>

- [Android] Fix for WebView/HybridWebView briefly flashes full screen
before layout completes by @praveenkumarkarunanithi in
#33207
  <details>
  <summary>🔧 Fixes</summary>

- [[Android] HybridWebView briefly resizes to full screen when page is
opened before snapping back to correct
size](#31475)
  </details>

## Xaml
- Improved style inheritance by @kubaflo in
#31317
  <details>
  <summary>🔧 Fixes</summary>

- [Styles based on a style that is based on another style that uses
AppThemeBinding do not inherit properties
correctly.](#31280)
  </details>

- Fix for VisualStateManager Setter.TargetName failing when
ControlTemplate is applied by @BagavathiPerumal in
#33208
  <details>
  <summary>🔧 Fixes</summary>

- [Setter.TargetName + ControlTemplate
crash](#26977)
  </details>


<details>
<summary>🧪 Testing (4)</summary>

- [Testing] Additional Feature Matrix Event Test Cases for Slider and
ScrollView by @nivetha-nagalingam in
#34352
- [Testing] Fixed Build error on inflight/ candidate PR 34885 by
@NafeelaNazhir in #34891
- [Testing] Fixed UI test image failure in PR 34885 - [13/4/2026] by
@NafeelaNazhir in #34933
- Fixed test failure - CursorPositionUpdatesWhenSearchBarGainsFocus by
@Dhivya-SF4094 in #34938

</details>

<details>
<summary>📦 Other (3)</summary>

- Fix Loaded event not called for MAUI View added to native View by
@NirmalKumarYuvaraj in #34345
  <details>
  <summary>🔧 Fixes</summary>

- [Loaded event not called for MAUI View added to native
View](#34310)
  </details>
- Add public IAlertManager and IAlertManagerSubscription interfaces by
@Redth in #34228
  <details>
  <summary>🔧 Fixes</summary>

- [Alert/Dialog system (`DisplayAlert`, `DisplayActionSheet`,
`DisplayPromptAsync`) needs a public extensibility
point](#34104)
  </details>
- Fix crash when displaying alerts on unloaded pages by @kubaflo in
#33288

</details>

<details>
<summary>📝 Issue References</summary>

Fixes #5825, Fixes #8494, Fixes #8716, Fixes #10987, Fixes #11404, Fixes
#12008, Fixes #18200, Fixes #18551, Fixes #18657, Fixes #18701, Fixes
#19168, Fixes #19209, Fixes #20062, Fixes #20348, Fixes #20834, Fixes
#20991, Fixes #21983, Fixes #22038, Fixes #22193, Fixes #22197, Fixes
#22769, Fixes #23330, Fixes #23854, Fixes #23902, Fixes #23921, Fixes
#24304, Fixes #24831, Fixes #25124, Fixes #26059, Fixes #26397, Fixes
#26644, Fixes #26846, Fixes #26961, Fixes #26977, Fixes #27086, Fixes
#27367, Fixes #27959, Fixes #28337, Fixes #28351, Fixes #28660, Fixes
#28975, Fixes #29390, Fixes #29391, Fixes #29463, Fixes #29493, Fixes
#29544, Fixes #30052, Fixes #30065, Fixes #30071, Fixes #30144, Fixes
#30399, Fixes #30779, Fixes #30803, Fixes #30970, Fixes #31280, Fixes
#31446, Fixes #31475, Fixes #31496, Fixes #31565, Fixes #31825, Fixes
#31961, Fixes #32048, Fixes #32050, Fixes #32139, Fixes #32356, Fixes
#32419, Fixes #32771, Fixes #32944, Fixes #32984, Fixes #32994, Fixes
#33308, Fixes #33501, Fixes #33703, Fixes #33770, Fixes #33773, Fixes
#34104, Fixes #34256, Fixes #34257, Fixes #34310, Fixes #34322, Fixes
#34363, Fixes #34370, Fixes #34459, Fixes #34518, Fixes #34583, Fixes
#34591, Fixes #34666, Fixes #34693, Fixes #34720, Fixes #34730

</details>

**Full Changelog**:
main...inflight/candidate
@github-actions github-actions Bot locked and limited conversation to collaborators May 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-drawing Shapes, Borders, Shadows, Graphics, BoxView, custom drawing community ✨ Community Contribution platform/android s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-fix-implemented PR author implemented the agent suggested fix s/agent-fix-win AI found a better alternative fix than the PR s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review) t/enhancement ☀️ New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GradientBrushes are not supported on Shape.Stroke

10 participants